/* ============================================
   PRODUCT DETAIL PAGE - SHARED STYLES
   File: public_html/assets/css/product-detail.css
   
   Used by:
   - Main site: includes/pages/description-content.php
   - Clientes: clientes/router.php
   
   Single source of truth for product detail page design.
   ============================================ */

/* ---- Page Section ---- */

.content-section {
    padding-top: 20px !important;
    padding-bottom: 40px;
    background: #000;
    color: #fff;
}

/* ---- Container ---- */

.product-description-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ---- Product Header (Image + Info Grid) ---- */

.product-header-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: start;
}

/* ---- Image ---- */

.product-image-section {
    position: sticky;
    top: 100px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.main-product-image {
    width: 100%;
    max-width: 450px;
    max-height: 400px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    object-fit: contain;
}

.main-product-image:hover {
    transform: scale(1.02);
}

@media (max-width: 1200px) {
    .main-product-image {
        max-width: 300px;
        max-height: 300px;
    }
}

@media (max-width: 992px) {
    .main-product-image {
        max-width: 280px;
        max-height: 280px;
    }
}

/* ---- Info Section ---- */

.product-info-section {
    padding: 1rem 0;
}

.product-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.product-short-description {
    font-size: 1.2rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: #D4AF37;
    margin-bottom: 1rem;
}

.product-manufacturer {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 2rem;
}

/* ---- Variant Swatches (Detail Page) ---- 
   Scoped to .product-description-container to avoid
   conflicting with tienda card swatches in 9tienda.css */

.product-description-container .product-variants {
    margin: 16px 0;
}

.product-description-container .variant-label {
    display: block;
    font-size: 14px;
    color: #999;
    margin-bottom: 8px;
}

.product-description-container .variant-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.product-description-container .variant-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: inline-block;
    text-decoration: none;
}

.product-description-container .variant-swatch:hover {
    transform: scale(1.1);
}

.product-description-container .variant-swatch.active {
    border-color: #D4AF37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
}

.product-description-container .variant-selected-name {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #ccc;
}

.product-description-container .variant-tagline {
    margin-top: 8px;
    font-size: 15px;
    color: #aaa;
    line-height: 1.4;
    transition: opacity 0.2s ease;
}

/* ---- Action Buttons ---- */

.product-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Comprar Button (Gold) - scoped to detail page */
.product-description-container .buy-button {
    flex: 1.5;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #D4AF37;
    color: #000;
    padding: 1.2rem 4rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
    border: none;
    cursor: pointer;
    min-width: auto;
    justify-content: center;
}

.product-description-container .buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
    background: #b8941f;
    color: #000;
}

/* Saber Más Button (Outline) */
.learn-more-button {
     flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    color: #D4AF37;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid #D4AF37;
    cursor: pointer;
}

.learn-more-button:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
    color: #D4AF37;
}

.learn-more-button.active {
    background: rgba(212, 175, 55, 0.2);
}

.learn-more-arrow {
    transition: transform 0.3s ease;
}

.learn-more-button.active .learn-more-arrow {
    transform: rotate(180deg);
}

/* ---- Collapsible Content Section ---- */

.product-content-section {
    margin-bottom: 3rem;
    max-height: 0 !important;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.3s ease, margin-top 0.3s ease;
    visibility: hidden;
}

.product-content-section.expanded {
    max-height: 10000px !important;
    opacity: 1;
    margin-top: 2rem;
    visibility: visible;
}

.product-description-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.product-description-content h2 {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 2.5rem 0 1.5rem 0;
    border-bottom: 2px solid #D4AF37;
    padding-bottom: 0.5rem;
}

.product-description-content h3 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
}

.product-description-content p {
    color: #fff;
    margin: 1.5rem 0;
}

.product-description-content strong {
    color: #D4AF37;
    font-weight: 700;
}

.product-description-content a {
    color: #D4AF37;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.product-description-content a:hover {
    color: #f5d76e;
}

/* ---- Features List ---- */

.product-features-list {
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
}

.product-features-list li {
    color: #fff;
    margin: 1rem 0;
    padding-left: 2rem;
    position: relative;
    line-height: 1.6;
}

.product-features-list li::before {
    content: "✓";
    color: #D4AF37;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

/* ---- Description Images ---- */

.product-description-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ---- Specifications ---- */

.product-specifications-section {
    background: #111;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 3rem;
}

.product-specifications-section h2 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #D4AF37;
    padding-bottom: 0.5rem;
}

.specifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.spec-item {
    background: #222;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #D4AF37;
}

.spec-label {
    color: #D4AF37;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.spec-value {
    color: #fff;
    font-size: 1rem;
}

/* ---- Error State ---- */

.product-description-error {
    background: #dc3545;
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin: 20px;
    text-align: center;
    font-weight: 600;
}

/* ---- Breadcrumb ---- */

.product-breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.product-breadcrumb a {
    color: #D4AF37;
    text-decoration: none;
}

.product-breadcrumb a:hover {
    text-decoration: underline;
}

.product-breadcrumb span {
    color: #666;
    margin: 0 0.5rem;
}

/* ---- Floating WhatsApp ---- */

.floating-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
}

.floating-whatsapp .whatsapp-cta-button {
    border-radius: 50px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
}

/* ============================================
   CLIENTES-SPECIFIC: Detail page header & layout
   Only rendered by clientes/router.php
   ============================================ */

.detail-header {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.detail-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header .brand {
    color: #d4af37;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.detail-header .back-link {
    color: #d4af37;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-header .back-link:hover {
    text-decoration: underline;
}

.product-page-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 160px; /* Space for floating cart */
}

/* Match main domain head.php heading defaults */
.product-page-main h1,
.product-page-main h2,
.product-page-main h3 {
    font-weight: 600;
    line-height: 1.2;
}

/* Clientes: sticky image lower (no main site header pushing it down) */
.product-page-main .product-image-section {
    top: 80px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .content-section {
        padding-top: 10px !important;
    }

    .product-description-container {
        padding: 1rem;
    }

    .product-header-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-image-section {
        position: static;
        order: 1;
    }

    .main-product-image {
        max-width: 280px;
        max-height: 280px;
        margin: 0 auto;
    }

    .product-info-section {
        order: 2;
        padding: 0;
    }

    .product-title {
        font-size: 2rem;
    }

    .product-short-description {
        font-size: 1.1rem;
    }

    .product-price {
        font-size: 1.8rem;
    }

    .product-actions {
        flex-direction: column;
    }

    .product-description-container .buy-button,
    .learn-more-button {
        width: 100%;
        justify-content: center;
        padding: 1.25rem 2rem;
        min-width: unset;
    }

    .specifications-grid {
        grid-template-columns: 1fr;
    }

    .product-specifications-section {
        padding: 1.5rem;
    }

    .floating-whatsapp {
        bottom: 80px;
    }
}

@media (max-width: 480px) {
    .product-description-container {
        padding: 0.5rem;
    }

    .main-product-image {
        max-width: 240px;
    }

    .product-title {
        font-size: 1.8rem;
    }

    .product-short-description {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.6rem;
    }

    .product-description-content {
        font-size: 1rem;
    }

    .product-description-container .buy-button,
    .learn-more-button {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }

    .product-description-image {
        max-width: 100%;
        border-radius: 8px;
        margin: 1.5rem 0;
    }
}