/* KOV hotfix: estilos nuevos recientes (inicio + grid) */

/* NAV móvil global: comportamiento estable en todas las páginas */
@media (max-width: 900px) {
    .nav-pill {
        border-radius: 22px !important;
        align-items: flex-start;
    }

    .nav-menu-wrapper {
        display: none !important;
        max-height: 0;
        overflow: hidden;
        transition: none !important;
    }

    .nav-menu-wrapper.active {
        display: block !important;
        max-height: calc(100vh - max(84px, env(safe-area-inset-top, 0px) + 72px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: 10px;
        padding-bottom: 8px;
    }

    .nav-menu > li > a {
        padding: 12px 14px;
    }

    .dropdown-menu {
        position: static !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        min-width: 0 !important;
        width: auto !important;
        padding: 0 !important;
        margin: 6px 0 6px 12px !important;
        border-radius: 12px;
        background: #fafafa !important;
        box-shadow: none !important;
        display: none !important;
        max-height: none !important;
        transition: none !important;
    }

    .nav-menu li.active-dropdown .dropdown-menu {
        display: block !important;
        max-height: none !important;
        padding: 6px 0 !important;
        overflow-y: auto !important;
    }

    /* Neutraliza hover desktop en primer tap móvil */
    .nav-menu li:hover .dropdown-menu {
        position: static !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Evita texto "invisible" en submenú Productos en páginas de catálogo */
    .nav-menu-wrapper .dropdown-menu li {
        display: block !important;
    }

    .nav-menu-wrapper .dropdown-menu a {
        display: block !important;
        padding: 10px 16px !important;
        font-size: 0.95rem !important;
        line-height: 1.35 !important;
        color: #222 !important;
        text-decoration: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        white-space: normal;
        background: transparent !important;
        text-align: left;
    }

    .nav-menu-wrapper .dropdown-menu a:hover,
    .nav-menu-wrapper .dropdown-menu a:focus {
        color: #DDA44D !important;
        background: rgba(0, 0, 0, 0.04) !important;
    }

}

/* Inicio: bloque "Acerca de nosotros" destacado */
.about-section-highlight .about-inner {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(22px, 3vw, 46px);
    align-items: center;
}

.about-section-highlight .about-image {
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    align-self: center;
    width: 100%;
}

.about-section-highlight .about-content {
    max-width: 560px;
}

.about-kicker {
    margin: 0 0 14px;
    font-size: 0.76rem;
    letter-spacing: 0.16em;
    font-weight: 800;
    color: #5a5a5a;
    text-transform: uppercase;
}

.about-title-strong {
    margin: 0 0 18px;
    font-size: clamp(2.45rem, 5.2vw, 3.65rem);
    line-height: 1.02;
    font-weight: 900;
    color: #0a0a0a;
    letter-spacing: -0.03em;
    text-shadow: 0 0 0.65px currentColor, 0 0 0.65px currentColor;
}

.about-section-highlight .about-mission {
    margin: 0 0 26px;
    text-align: justify;
    color: #444;
    line-height: 1.65;
}

.about-cta-wrap {
    margin-top: 4px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.about-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    padding: 14px 28px;
    min-height: 48px;
    border-radius: 999px;
    background: #111;
    color: #fff !important;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.about-cta-btn:visited,
.about-cta-btn:active {
    color: #fff !important;
    text-decoration: none !important;
}

.about-cta-btn:hover {
    background: #2b2b2b;
    transform: translateY(-1px);
}

.about-section-highlight .about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Inicio: título "Nuestras líneas" arriba del grid */
.category-cards .catalog-section-title {
    margin: 0 auto 32px;
    max-width: 1320px;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
}

.category-cards .catalog-section-title span {
    display: inline-block;
    padding-bottom: 10px;
    border-bottom: 3px solid #DDA44D;
}

/* Nosotros: layout editorial completo (por si kov-extra.css no llega actualizado) */
.projects-showcase {
    padding-top: 120px;
    background: #ece8e0;
    background-image:
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(221, 164, 77, 0.18), transparent 55%),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(26, 26, 26, 0.06), transparent 50%);
}

.proj-hero {
    padding: 0 5% 48px;
}

.proj-hero-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 0;
    min-height: min(72vh, 560px);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

.proj-hero-copy {
    background: linear-gradient(165deg, #fdfcfa 0%, #f3efe8 100%);
    padding: clamp(28px, 5vw, 52px) clamp(24px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 5px solid #DDA44D;
    position: relative;
}

.proj-hero-copy::after {
    content: "";
    position: absolute;
    top: 18%;
    right: 12%;
    width: 120px;
    height: 120px;
    border: 1px solid rgba(221, 164, 77, 0.35);
    border-radius: 50%;
    pointer-events: none;
}

.proj-hero-eyebrow {
    margin: 0 0 12px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #7a6a58;
}

.proj-hero-copy h1 {
    margin: 0 0 18px;
    font-size: clamp(2rem, 4.8vw, 3.35rem);
    line-height: 1.05;
    font-weight: 900;
    color: #111;
    letter-spacing: -0.035em;
}

.proj-hero-lead {
    margin: 0 0 28px;
    font-size: clamp(0.95rem, 1.6vw, 1.08rem);
    line-height: 1.65;
    color: #3d3d3d;
    max-width: 38ch;
}

.proj-hero-stats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
}

.proj-hero-stats li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 0;
}

.proj-hero-stats strong {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1a1a1a;
}

.proj-hero-stats span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
}

.proj-hero-visual {
    background-size: cover;
    background-position: center;
    min-height: 280px;
    position: relative;
    clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%);
}

.proj-hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(26, 26, 26, 0.25) 0%, transparent 45%);
    pointer-events: none;
}

.proj-bento-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 5% 100px;
}

.proj-bento-head {
    margin-bottom: 28px;
    max-width: 560px;
}

.proj-bento-head h2 {
    margin: 0 0 10px;
    font-size: clamp(1.25rem, 2.2vw, 1.55rem);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1a1a1a;
}

.proj-bento-head h2::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #DDA44D, #e8c77a);
    margin-top: 14px;
    border-radius: 2px;
}

.proj-bento-head p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #4a4a4a;
}

.proj-bento {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 18px;
    min-height: 520px;
}

.proj-tile {
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.proj-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12);
}

.proj-tile--feature {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.proj-bento .proj-tile:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.proj-bento .proj-tile:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.proj-tile--gold {
    border-color: rgba(221, 164, 77, 0.45);
    box-shadow: 0 12px 36px rgba(221, 164, 77, 0.15);
}

.proj-tile-media {
    flex: 0 0 auto;
    min-height: 160px;
    background-size: cover;
    background-position: center;
    background-color: #e8e8e8;
}

.proj-tile--feature .proj-tile-media {
    min-height: min(42vh, 320px);
}

.proj-tile-body {
    padding: 20px 22px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.proj-tile-num {
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    color: rgba(0, 0, 0, 0.06);
    user-select: none;
}

.proj-tile--gold .proj-tile-num {
    color: rgba(221, 164, 77, 0.35);
}

.proj-tile-tag {
    margin: 0 0 8px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #a67c28;
}

.proj-tile-title {
    margin: 0 0 10px;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    font-weight: 800;
    color: #111;
    line-height: 1.25;
}

.proj-tile-desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #555;
}

@media (max-width: 900px) {
    .nav-pill {
        border-radius: 28px;
    }

    .about-section-highlight .about-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .about-section-highlight .about-content {
        order: 2;
        max-width: 100%;
    }

    .about-section-highlight .about-image {
        order: 1;
    }

    .about-section-highlight .about-mission {
        text-align: left;
    }

    .proj-hero-inner {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .proj-hero-visual {
        clip-path: none;
        min-height: 260px;
        order: -1;
    }

    .proj-bento {
        display: flex;
        flex-direction: column;
        min-height: 0;
        gap: 14px;
    }

    .proj-tile,
    .proj-tile--feature,
    .proj-tile--stack {
        width: 100%;
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .proj-tile-body {
        padding: 18px 18px 20px;
        flex: 0 0 auto;
    }

    .proj-tile-num {
        font-size: 2rem;
        top: 14px;
        right: 14px;
    }

    .proj-tile,
    .proj-tile--feature {
        min-height: 0;
    }
}

@media (max-width: 560px) {
    .projects-showcase {
        padding-top: max(92px, env(safe-area-inset-top, 0px) + 76px);
    }

    .proj-hero {
        padding: 0 4% 30px;
    }

    .proj-hero-copy {
        padding: 24px 18px;
    }

    .proj-hero-copy h1 {
        font-size: clamp(1.85rem, 9vw, 2.4rem);
    }

    .proj-hero-lead {
        max-width: none;
        margin-bottom: 18px;
    }

    .proj-hero-copy::after {
        display: none;
    }

    .proj-hero-stats {
        flex-direction: column;
        gap: 8px;
    }

    .proj-hero-stats li {
        padding: 10px 12px;
    }

    .proj-bento-wrap {
        padding: 0 4% 56px;
    }

    .proj-bento-head {
        margin-bottom: 18px;
    }

    .proj-tile-media,
    .proj-tile--feature .proj-tile-media {
        min-height: 150px;
    }

    /* En móvil mostramos el índice de tarjeta en flujo normal para asegurar visibilidad (01, 02, 03). */
    .proj-tile-num {
        position: static;
        display: inline-block;
        margin: 0 0 8px;
        font-size: 0.95rem;
        line-height: 1;
        font-weight: 900;
        color: #a67c28;
        letter-spacing: 0.08em;
    }

    .proj-tile-desc {
        margin-bottom: 0;
    }
}

/* Catálogo por líneas + tarjetas (generate_catalog.py) */
.kov-line-group {
    margin-bottom: clamp(2rem, 4.5vw, 3rem);
}

.kov-line-group:last-child {
    margin-bottom: 0;
}

.kov-line-group:not(:first-child) {
    margin-top: clamp(2rem, 5vw, 3.25rem);
    padding-top: clamp(1.25rem, 3vw, 2rem);
}

.kov-line-group__title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(0.82rem, 1.9vw, 1rem);
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4a3720;
    margin: 0 0 clamp(1.15rem, 3vw, 1.65rem);
    padding: 0.55rem 0 0.55rem 1rem;
    border-bottom: none;
    border-left: 4px solid #c7933a;
    border-radius: 0 10px 10px 0;
    background: linear-gradient(105deg, rgba(221, 164, 77, 0.14) 0%, rgba(255, 255, 255, 0) min(72%, 420px));
    line-height: 1.45;
}

.kov-catalog-empty {
    text-align: center;
    color: #666;
    padding: 24px 16px;
}

/* Foto legible en tarjeta pequeña (sin recorte agresivo) */
.product-card-kov-slide img {
    object-fit: contain;
    object-position: center;
    background: #ececec;
}

/* Carrusel con 1 sola foto: sin flechas ni puntos (JS pone data-kov-slide-count) */
[data-kov-slider][data-kov-slide-count="1"] .product-card-kov-snav,
[data-kov-slider][data-kov-slide-count="1"] .product-card-kov-dots {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.product-card-kov-snav[hidden],
.product-card-kov-dots[hidden] {
    display: none !important;
}

/* Si el JS aún no corre: una sola slide en el DOM */
.product-card-kov-slider:has(.product-card-kov-slide:only-of-type) .product-card-kov-snav,
.product-card-kov-slider:has(.product-card-kov-slide:only-of-type) .product-card-kov-dots {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Mosaico con una sola línea / una tarjeta (Hogar) */
.catalog-mosaic-wrap .kov-mosaic.kov-mosaic--single {
    grid-template-columns: 1fr;
    max-width: 920px;
    margin: 0 auto;
}

@media (min-width: 900px) {
    .catalog-mosaic-wrap .kov-mosaic.kov-mosaic--single .kov-tile:first-child {
        grid-column: 1 / -1;
        min-height: min(48vh, 440px);
    }
}

/* Tarjetas de subcategorías más uniformes */
@media (min-width: 900px) {
    .catalog-mosaic-wrap .kov-mosaic:not(.kov-mosaic--single) a.kov-tile {
        min-height: 260px;
    }
}

/* Escolar — “Nuestras líneas”: encuadre más bajo para que el producto no quede tan tapado por el degradado */
.catalog-mosaic-wrap--escolar-lines a.kov-tile {
    background-position: center 68%;
}

@media (min-width: 900px) {
    .catalog-mosaic-wrap--escolar-lines .kov-mosaic:not(.kov-mosaic--single) a.kov-tile {
        min-height: 275px;
    }

    .catalog-mosaic-wrap--escolar-lines .kov-mosaic .kov-tile:first-child {
        min-height: 300px;
    }
}
