/* =============================================
   marcas-inicio.css
   KPO Alpha — Sección de marcas en inicio.php
   y modal de detalle de marca
============================================= */

/* =============================================
   Grid de marcas — reemplaza los placeholders
============================================= */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.brand-card {
    background: var(--clr-white);
    border: 1px solid var(--clr-gray-100);
    border-radius: 12px;
    padding: 22px 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: box-shadow 0.24s ease, transform 0.24s ease, border-color 0.24s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}
.brand-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--clr-green-tint);
    opacity: 0;
    transition: opacity 0.22s ease;
    border-radius: inherit;
    pointer-events: none;
}
.brand-card:hover {
    box-shadow: 0 8px 28px rgba(26, 71, 49, 0.13);
    transform: translateY(-3px);
    border-color: var(--clr-green-light);
}
.brand-card:hover::after { opacity: 0.18; }
.brand-card:active { transform: translateY(-1px); }

/* Logo / imagen de la marca */
.brand-card__logo {
    width: 80px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.brand-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}
.brand-card__logo-placeholder {
    width: 60px;
    height: 60px;
    background: var(--clr-green-tint);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-green-mid);
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

/* Nombre debajo del logo */
.brand-card__name {
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--clr-black);
    text-align: center;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

/* Chip de redes debajo */
.brand-card__redes-count {
    font-size: 0.68rem;
    color: var(--clr-gray-500);
    position: relative;
    z-index: 1;
}

/* Estado de carga / vacío */
.brands-grid--loading,
.brands-grid--empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 16px;
    color: var(--clr-gray-500);
    font-size: 0.88rem;
    font-style: italic;
}

/* =============================================
   Modal de detalle de marca
============================================= */
.bm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    padding: 20px;
}
.bm-modal-backdrop--open {
    display: flex;
}

.bm-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
    animation: bm-in 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overscroll-behavior: contain;
}

@keyframes bm-in {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Imagen de cabecera */
.bm-modal__hero {
    width: 100%;
    height: 200px;
    background: var(--clr-green-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}
.bm-modal__hero img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
    display: block;
}
.bm-modal__hero-placeholder {
    font-family: var(--font-primary);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--clr-green-mid);
    opacity: 0.35;
    letter-spacing: -0.02em;
    user-select: none;
}

/* Botón cerrar */
.bm-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-gray-700);
    transition: background 0.2s, color 0.2s;
    z-index: 2;
    padding: 0;
}
.bm-modal__close:hover { background: #fff; color: var(--clr-black); }
.bm-modal__close svg { width: 16px; height: 16px; display: block; }

/* Cuerpo */
.bm-modal__body {
    padding: 28px 30px 32px;
}

.bm-modal__nombre {
    font-family: var(--font-primary);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--clr-black);
    margin: 0 0 10px;
    line-height: 1.25;
}

.bm-modal__desc {
    font-size: 0.9rem;
    color: var(--clr-gray-500);
    line-height: 1.75;
    margin: 0 0 24px;
}
.bm-modal__desc--empty {
    font-style: italic;
    color: var(--clr-gray-300);
}

/* Separador */
.bm-modal__divider {
    height: 1px;
    background: var(--clr-gray-100);
    margin: 0 0 22px;
}

/* Redes sociales */
.bm-modal__redes-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--clr-gray-500);
    margin-bottom: 14px;
    display: block;
}

.bm-modal__redes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bm-red-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    background: var(--clr-off-white);
    border: 1px solid var(--clr-gray-100);
    border-radius: 30px;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--clr-gray-700);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}
.bm-red-btn:hover {
    background: var(--clr-green-tint);
    border-color: var(--clr-green-light);
    color: var(--clr-green-dark);
    box-shadow: 0 4px 12px rgba(26, 71, 49, 0.12);
    transform: translateY(-1px);
}
.bm-red-btn:active { transform: translateY(0); }

.bm-red-btn__icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bm-red-btn__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.bm-red-btn__icon--placeholder {
    background: var(--clr-green-tint);
    color: var(--clr-green-dark);
}
.bm-red-btn__icon--placeholder svg {
    width: 13px;
    height: 13px;
}

.bm-modal__redes--empty {
    font-size: 0.82rem;
    color: var(--clr-gray-300);
    font-style: italic;
}

/* =============================================
   Responsive
============================================= */
@media (max-width: 560px) {
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bm-modal__hero { height: 160px; }
    .bm-modal__body { padding: 22px 20px 28px; }
    .bm-modal-backdrop { padding: 12px; }
}