/* Product detail page - built on base.css + home-v2.css */

/* Nav always visible on product page */
.nav-v2 {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.07);
    padding: 14px 0;
}
.nav-v2 .nav-logo { color: var(--color-primary); }
.nav-v2 .nav-links a { color: #374151; }
.nav-v2 .nav-links a:hover { color: var(--color-primary); }
.nav-v2 .nav-social-btn { border-color: #e5e7eb; color: #374151; }
.nav-v2 .nav-wa-btn {
    background: rgba(37,211,102,0.1);
    border-color: rgba(37,211,102,0.35);
    color: #1a8a3c;
}
.nav-v2 .nav-cart-btn {
    background: #fff;
    border-color: #e5e7eb;
    color: #374151;
}
.nav-v2 .nav-hamburger span { background: var(--color-dark); }

.product-hero {
    position: relative;
    padding: 128px 0 62px;
    overflow: hidden;
}

.product-hero__bg {
    position: absolute;
    inset: 0;
    background-image: url('https://images.pexels.com/photos/8082565/pexels-photo-8082565.jpeg?auto=compress&cs=tinysrgb&w=1920&h=700&fit=crop');
    background-size: cover;
    background-position: center 42%;
    background-color: #0B3C5D;
}

.product-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(5,18,30,0.92) 0%, rgba(11,60,93,0.76) 56%, rgba(5,18,30,0.46) 100%);
}

.product-hero .container {
    position: relative;
    z-index: 1;
    max-width: 1180px;
}

.product-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.62);
}

.product-breadcrumb a {
    color: rgba(255,255,255,0.62);
    text-decoration: none;
    transition: color 0.2s;
}

.product-breadcrumb a:hover {
    color: #fff;
}

.product-hero h1 {
    max-width: 850px;
    margin: 0 0 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(2.05rem, 5vw, 3.7rem);
    font-weight: 800;
    line-height: 1.06;
    color: #fff;
}

.product-hero p {
    max-width: 560px;
    margin: 0;
    color: rgba(255,255,255,0.74);
    font-size: 1rem;
    line-height: 1.65;
}

.product-page {
    padding: 115px 0 86px;
    background:
        radial-gradient(ellipse 75% 65% at 0% 0%, rgba(11,60,93,0.28) 0%, transparent 100%),
        radial-gradient(ellipse 70% 60% at 100% 100%, rgba(243,112,33,0.24) 0%, transparent 100%),
        #eef1f5;
}

.product-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
    gap: 30px;
    align-items: start;
    padding: 30px;
}

.product-media-card,
.product-info-card,
.product-detail-card,
.product-status {
    min-width: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
}

.product-media-card {
    position: sticky;
    top: 96px;
    padding: 18px;
    overflow: hidden;
}

.product-media-frame {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 430px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    padding: 34px;
}

.product-media-frame img {
    width: 100%;
    max-width: 520px;
    max-height: 430px;
    object-fit: contain;
    display: block;
    opacity: 1;
    transition: opacity 0.18s ease;
}

.product-media-frame.is-loading img,
.product-media-frame.is-empty img {
    opacity: 0;
}

.product-media-loader {
    position: absolute;
    width: 44px;
    height: 44px;
    border: 4px solid #dbe4ec;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    animation: productSpin 0.8s linear infinite;
    pointer-events: none;
}

.product-media-frame.is-loading .product-media-loader {
    opacity: 1;
}

.product-media-frame.is-empty::after {
    content: "Imagen no disponible";
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
}

@keyframes productSpin {
    to { transform: rotate(360deg); }
}

.product-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.product-gallery-thumb {
    border: 1px solid #d7dee6;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.product-gallery-thumb:hover {
    transform: translateY(-1px);
    border-color: var(--color-primary);
}

.product-gallery-thumb.is-active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(11, 60, 93, 0.12);
}

.product-gallery-thumb img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    display: block;
}

#producto-chips {
    margin-top: 16px;
}

.product-note {
    margin: 18px 2px 0;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    color: var(--color-gray);
    font-size: 0.9rem;
    line-height: 1.55;
}

.product-info-card {
    display: grid;
    gap: 20px;
    padding: 28px;
}

.product-info-card h1,
.product-info-card h2 {
    margin: 6px 0 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    line-height: 1.16;
    color: var(--color-dark);
    overflow-wrap: anywhere;
}

.product-info-card > div > p,
.product-install-card p,
.product-section__head p,
.product-status p {
    margin: 0;
    color: var(--color-gray);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.product-info-card .product-brand {
    margin: 12px 0 0;
    color: #8a94a3;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
}

.product-detail-card {
    padding: 20px;
    box-shadow: none;
}

.product-section .product-detail-card + .product-detail-card {
    margin-top: 14px;
}

.product-detail-card h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--color-dark);
}

.product-main-data-card {
    padding: 18px 20px 20px;
}

.product-price-box {
    display: grid;
    gap: 4px;
}

.product-price-box__label {
    color: #6b7280;
    font-size: 0.86rem;
    font-weight: 600;
}

.product-price-box__amount {
    color: #171717;
    font-size: clamp(2rem, 5vw, 2.85rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.product-price-box__amount sup {
    position: relative;
    top: -0.4em;
    margin-left: 2px;
    font-size: 0.42em;
    line-height: 0;
}

.product-price-box--consult .product-price-box__amount {
    color: var(--color-primary);
    font-size: clamp(1.08rem, 2vw, 1.45rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

#producto-tabla-datos,
.spec-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.product-data-row,
.spec-table__row {
    display: grid;
    align-content: start;
    gap: 5px;
    min-height: 76px;
    padding: 14px;
    border: 1px solid #e7ebf0;
    border-radius: 10px;
    background: #f8fafc;
}

.product-data-row strong,
.spec-table__row strong {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
}

.product-data-row span,
.spec-table__row span {
    color: #111827;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.product-cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.product-pdf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.product-pdf-button {
    justify-content: center;
}

.product-section {
    margin-top: 42px;
}

.product-section__head {
    margin-bottom: 18px;
}

.product-section__head h2 {
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.product-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.variantes-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.variantes-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-gray, #6b7280);
    margin: 0 0 10px;
}

.variantes-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.variante-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    max-width: 96px;
    text-align: center;
}

.variante-thumb:hover {
    border-color: var(--color-accent, #0ea5e9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.variante-thumb img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.variante-thumb span {
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.05);
}

.product-card__img,
.product-card__img-link {
    display: grid;
    place-items: center;
    min-height: 210px;
    padding: 24px;
    background: #eef4f8;
}

.product-card__img img {
    width: 100%;
    max-height: 170px;
    object-fit: contain;
}

.product-card__body {
    padding: 18px;
}

.product-card__title {
    margin-bottom: 12px;
    font-weight: 800;
    color: var(--color-dark);
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.product-actions {
    display: flex;
}

.product-actions a {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.product-status {
    padding: 28px;
}

.product-status h3 {
    margin: 0 0 10px;
}

.spec-list {
    margin: 0;
    padding-left: 18px;
    color: var(--color-gray);
    line-height: 1.7;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #eef6fb;
    border: 1px solid #dbeaf2;
    border-radius: 999px;
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 700;
}

.muted {
    color: var(--color-gray);
}

@media (max-width: 1080px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 24px;
    }

    .product-media-card {
        position: static;
    }

    .product-media-frame {
        min-height: 360px;
    }

    .product-info-card {
        gap: 18px;
    }

    .product-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .product-hero {
        padding: 102px 0 46px;
    }

    .product-page {
        padding: 115px 0 64px;
    }

    .product-info-card {
        padding: 20px;
    }

    .product-layout {
        padding: 16px;
    }

    .product-info-card h1,
    .product-info-card h2 {
        font-size: clamp(1.35rem, 7vw, 1.85rem);
    }

    .product-main-data-card {
        padding: 16px;
    }

    .product-price-box--consult .product-price-box__amount {
        font-size: clamp(1rem, 5vw, 1.25rem);
    }

    .product-media-card {
        padding: 12px;
    }

    .product-media-frame {
        min-height: 280px;
        padding: 20px;
    }

    .product-gallery-thumbs {
        grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    }

    .product-cta-row .btn-primary,
    .product-cta-row .btn-secondary {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    #producto-tabla-datos,
    .spec-table {
        grid-template-columns: 1fr;
    }

    .product-related-grid {
        grid-template-columns: 1fr;
    }
}
