/*==================================================
        CATÁLOGO — Diseño editorial, limpio y compacto
==================================================*/

/* ============================
   HERO / ENCABEZADO (compacto)
============================ */
.catalog-hero {
    padding: 22px 0 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.catalog-hero-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 4px;
}

.catalog-hero h1 {
    font-size: clamp(1.4rem, 2.6vw, 1.8rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.4px;
    margin: 0 0 4px;
}

.catalog-hero p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
    max-width: 520px;
}

/* ============================
   SECCIÓN PRINCIPAL
============================ */
.catalog-main {
    padding: 18px 0 60px;
}

/* ============================
   BUSCADOR (barra compacta)
============================ */
.catalogo-page .search {
    margin-bottom: 14px;
    padding: 9px 10px 9px 14px;
    border-radius: 12px;
    max-width: 100%;
    border-color: var(--border);
}

.catalogo-page .search input {
    font-size: 0.9rem;
}

.catalogo-page .search button {
    padding: 9px 20px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* ============================
   TÍTULOS DE SECCIÓN EDITORIALES
============================ */
.catalog-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.catalog-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.2px;
}

/* ============================
   SECCIÓN CATEGORÍAS (AMPLIAS Y PROTAGONISTAS)
============================ */
.catalog-categories-section {
    margin-bottom: 34px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 22px 18px 20px;
    background: #ffffff;
    border: 1px solid #e8ecf2;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.category-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--cat-accent, #007BC4);
    opacity: 0.9;
    transition: height 0.25s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--cat-accent, #007BC4);
    box-shadow: 0 14px 30px -8px rgba(15, 23, 42, 0.12), 0 0 0 1px var(--cat-accent, #007BC4);
}

.category-card:hover::before {
    height: 6px;
}

.category-card.is-selected {
    border-color: var(--cat-accent, #007BC4);
    background: #f8fafc;
    box-shadow: 0 0 0 2px var(--cat-accent, #007BC4), 0 10px 24px -6px rgba(0, 123, 196, 0.18);
}

.category-card-media {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #ffffff 40%, #f4f6fa 100%);
    border: 1px solid #f1f4f8;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    box-sizing: border-box;
}

.category-card-img {
    width: 100%;
    height: 100%;
    max-height: 106px;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-card:hover .category-card-img {
    transform: scale(1.08);
}

.category-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.category-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 999px;
    display: inline-block;
}

/* ============================
   SECCIÓN DESTACADOS
============================ */
.catalog-featured-section {
    margin-bottom: 30px;
}

/* ============================
   ACCIONES DEL CATÁLOGO (VER TODOS / OCULTAR)
============================ */
.catalog-all-action {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 30px;
}

.btn-ver-todos {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 123, 196, 0.22);
    transition: all 0.2s ease;
    border: none;
    background: linear-gradient(135deg, #007BC4, #005D96);
    color: #ffffff;
}

.btn-ver-todos:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 123, 196, 0.32);
}

.btn-ver-todos i,
.btn-ver-todos svg {
    width: 18px;
    height: 18px;
}

.btn-ocultar-productos {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 26px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.btn-ocultar-productos:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.btn-ocultar-productos i,
.btn-ocultar-productos svg {
    width: 18px;
    height: 18px;
}

/* ============================
   SECCIÓN RESULTADOS COMPLETOS
============================ */
.catalog-results-section {
    margin-top: 10px;
}

/* ============================
   TOOLBAR (selector + contador)
============================ */
.catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.catalog-toolbar #searchResult {
    margin: 0 0 0 auto;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
}

/* ============================
   SELECTOR DE CATEGORÍA (compacto)
============================ */
.category-select {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-select label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.category-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.category-select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 8px 34px 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    min-width: 190px;
    max-width: 260px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-select-wrap select:hover {
    border-color: var(--primary-light);
}

.category-select-wrap select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 196, 0.12);
}

.category-select-wrap i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--text-light);
    pointer-events: none;
}

/* ============================
   GRID DE PRODUCTOS (2 columnas horizontal)
============================ */
.catalogo-page .products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

/* ============================
   TARJETA DE PRODUCTO (Horizontal compacta: Imagen 44% | Info 56%)
============================ */
.catalogo-page .product-card {
    position: relative;
    display: grid;
    grid-template-columns: 44% 56%;
    gap: 0;
    min-height: 220px;
    background: #ffffff;
    border: 1px solid #e8ecf2;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px -16px rgba(15, 23, 42, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.catalogo-page .product-card:hover {
    transform: translateY(-4px);
    border-color: #cbd5e1;
    box-shadow: 0 12px 28px -10px rgba(0, 123, 196, 0.16);
}

/* ============================
   BADGES (compactos, top-left)
============================ */
.catalogo-page .product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: calc(44% - 16px);
}

.catalogo-page .product-badges .product-badge {
    position: static;
}

.catalogo-page .product-badge {
    padding: 3px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.60rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

/* ============================
   IMAGEN (44% izquierda, protagonista y sin recorte)
============================ */
.catalogo-page .product-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: radial-gradient(120% 120% at 50% 10%, #ffffff 0%, #f4f6fa 100%);
    border-right: 1px solid #f1f4f8;
    overflow: hidden;
}

.catalogo-page .product-image {
    width: 100%;
    height: 100%;
    max-height: 180px;
    object-fit: contain;
    padding: 0;
    min-height: 0;
    display: block;
    transition: transform 0.3s ease;
}

.catalogo-page .product-card:hover .product-image {
    transform: scale(1.04);
}

/* ============================
   INFO (56% derecha, jerarquía compacta)
============================ */
.catalogo-page .product-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px 16px;
    min-width: 0;
}

.catalogo-page .product-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
    margin: 0 0 4px;
}

.catalogo-page .product-brand-logo {
    height: 16px;
    width: auto;
    max-width: 75px;
    object-fit: contain;
}

.catalogo-page .product-brand-name {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b93a3;
}

.catalogo-page .product-name {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.1px;
    margin: 0 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.catalogo-page .product-desc {
    font-size: 0.76rem;
    line-height: 1.4;
    color: #64748b;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.1em;
}

/* Características ocultas en catálogo */
.catalogo-page .product-features {
    display: none;
}

/* ============================
   PRECIO (jerarquía con MSI protagonista cuando existe)
============================ */
.catalogo-page .product-price {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.catalogo-page .product-price-main {
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.2px;
    line-height: 1.15;
}

.catalogo-page .product-price-secondary {
    display: block;
    font-size: 0.74rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.2;
}

.catalogo-page .product-price-strike {
    font-size: 0.74rem;
    color: #97a0b0;
    text-decoration: line-through;
}

/* ============================
   MSI (píldora institucional compacta)
============================ */
.catalogo-page .product-msi {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 10px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 123, 196, 0.08);
    color: #007BC4;
    border: 1px solid rgba(0, 123, 196, 0.18);
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

/* ============================
   BOTÓN "VER PRODUCTO" INSTITUCIONAL
============================ */
.catalogo-page .product-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #007BC4, #005D96);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 123, 196, 0.18);
    transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: auto;
}

.catalogo-page .product-button:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 196, 0.28);
}

.catalogo-page .product-button svg,
.catalogo-page .product-button [data-lucide] {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.catalogo-page .product-button:hover svg,
.catalogo-page .product-button:hover [data-lucide] {
    transform: translateX(3px);
}

/*==================================================
        RESPONSIVE
==================================================*/

@media (max-width: 1199px) {
    .catalog-hero {
        padding: 20px 0 16px;
    }
}

@media (max-width: 992px) {
    .catalogo-page .product-card {
        grid-template-columns: 42% 58%;
    }

    .catalogo-page .product-media {
        padding: 12px;
    }

    .catalogo-page .product-info {
        padding: 12px 14px;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 14px;
    }

    .category-card {
        padding: 18px 14px 16px;
    }

    .category-card-media {
        height: 110px;
    }

    .category-card-img {
        max-height: 90px;
    }
}

@media (max-width: 768px) {
    .catalog-hero {
        padding: 18px 0 14px;
    }

    .catalog-hero h1 {
        font-size: 1.3rem;
    }

    .catalog-hero p {
        font-size: 0.84rem;
    }

    .catalog-main {
        padding-top: 14px;
        padding-bottom: 50px;
    }
}

/* Móvil (≤ 640px): formato vertical compacto */
@media (max-width: 640px) {
    .catalog-hero {
        padding: 16px 0 12px;
    }

    .catalog-hero h1 {
        font-size: 1.2rem;
    }

    .catalogo-page .search {
        padding: 6px 8px 6px 10px;
    }

    .catalogo-page .search input {
        font-size: 0.85rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .category-card {
        padding: 16px 12px 14px;
        border-radius: 14px;
    }

    .category-card-media {
        width: 100%;
        height: 90px;
        margin-bottom: 10px;
        padding: 8px;
        border-radius: 10px;
    }

    .category-card-img {
        max-height: 74px;
    }

    .category-card-name {
        font-size: 0.88rem;
    }

    .category-card-count {
        font-size: 0.72rem;
        padding: 2px 8px;
    }

    .catalog-section-title {
        font-size: 1.05rem;
    }

    .catalog-all-action {
        margin-bottom: 22px;
        flex-direction: column;
        gap: 10px;
    }

    .btn-ver-todos,
    .btn-ocultar-productos {
        width: 100%;
        justify-content: center;
        padding: 11px 20px;
        font-size: 0.88rem;
    }

    .category-select {
        width: 100%;
    }

    .category-select-wrap {
        flex: 1;
    }

    .category-select-wrap select {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .catalog-toolbar #searchResult {
        margin-left: 0;
    }

    .catalogo-page .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .catalogo-page .product-card {
        grid-template-columns: 1fr;
        min-height: auto;
        border-radius: 14px;
    }

    .catalogo-page .product-badges {
        max-width: calc(100% - 16px);
    }

    .catalogo-page .product-media {
        border-right: none;
        border-bottom: 1px solid #f1f4f8;
        min-height: 170px;
        max-height: 190px;
        padding: 14px;
    }

    .catalogo-page .product-info {
        padding: 12px 14px 14px;
    }

    .catalogo-page .product-name {
        min-height: auto;
    }

    .catalogo-page .product-desc {
        min-height: auto;
    }
}
