/* ============================================
   ESPACIO CONSCIENTE — Product Detail Styles
   product.css
   Depends on: base.css (variables, resets, shared)
   ============================================ */

/* ============================================
   PRODUCT DETAIL LAYOUT
   ============================================ */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding-bottom: 60px;
}

/* ============================================
   GALLERY
   ============================================ */
.gallery {
    position: sticky;
    top: 100px;
    align-self: start;
}

.gallery-main {
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--crema-dark), var(--gris-suave));
    border-radius: var(--radio-medio);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-deliberate);
}

.gallery-main:hover img {
    transform: scale(1.06);
    filter: brightness(1.05);
}

.gallery-main svg {
    width: 64px;
    height: 64px;
    color: var(--marron);
    opacity: 0.25;
}

.gallery-main-label {
    font-family: var(--font-acento);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--marron-light);
    margin-top: 12px;
}

/* Gallery badge — glass pill */
.gallery-badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    background: rgba(139, 158, 126, 0.9);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: var(--blanco);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: var(--radius-xl);
    letter-spacing: 0.5px;
    z-index: 2;
}
.gallery-badge.sale { background: rgba(196, 149, 106, 0.92); }

/* Thumbnail grid (4 cols) */
.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.gallery-thumb {
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--crema-dark), var(--gris-suave));
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--t-standard);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-thumb.active {
    border-color: var(--celeste);
}

.gallery-thumb:hover {
    border-color: var(--celeste-light);
}

.gallery-thumb svg {
    width: 20px;
    height: 20px;
    color: var(--marron);
    opacity: 0.25;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-deliberate);
}

.gallery-thumb:hover img {
    transform: scale(1.1);
}

/* ============================================
   LIGHTBOX OVERLAY
   ============================================ */
/* Lightbox — glass backdrop with fade-in */
.lightbox {
    position: fixed;
    inset: 0;
    background: var(--overlay-dark);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity var(--t-standard);
}

.lightbox.is-open {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-floating);
}

.lightbox-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: none;
    color: var(--blanco);
    font-size: 1.5rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-micro);
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ============================================
   PRODUCT INFO
   ============================================ */

/* Category tag */
.product-category-tag {
    display: inline-block;
    font-family: var(--font-acento);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--verde-salvia);
    margin-bottom: 8px;
}

/* Large title (Fraunces 2.4rem) */
.product-title {
    font-family: var(--font-titulo);
    font-size: 2.4rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 12px;
}

/* Star rating (arena fill) */
.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.stars {
    display: flex;
    gap: 2px;
    color: var(--arena);
}

.stars svg {
    width: 18px;
    height: 18px;
    fill: var(--arena);
}

.rating-text {
    font-size: 0.85rem;
    color: var(--marron-light);
}

/* Price (terracota, Fraunces 2.4rem) */
.product-price-detail {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}

.price-current {
    font-family: var(--font-titulo);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--terracota);
}

.price-original {
    font-family: var(--font-acento);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--marron-light);
    text-decoration: line-through;
}

.price-discount {
    background: var(--arena);
    color: var(--marron);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--radio-grande);
}

/* Installments text */
.installments {
    font-size: 0.88rem;
    color: var(--verde-salvia-dark);
    margin-bottom: 20px;
}

.installments strong {
    color: var(--verde-salvia);
}

/* Short description (Cormorant italic) */
.product-short-desc {
    font-family: var(--font-acento);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--marron-light);
    line-height: 1.8;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gris-suave);
}

/* ============================================
   VARIANT SELECTOR PILLS (ARIA radiogroup)
   ============================================ */
.variant-group {
    margin-bottom: 20px;
}

.variant-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.variant-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.variant-option {
    padding: 8px 20px;
    border: 2px solid var(--gris-suave);
    border-radius: var(--radio-grande);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-option:hover {
    border-color: var(--celeste);
    background: rgba(139,172,196,0.05);
}

.variant-option.selected {
    border-color: var(--celeste);
    background: rgba(139,172,196,0.1);
    color: var(--marron);
    font-weight: 700;
}

/* ============================================
   QUANTITY SELECTOR (+/- buttons)
   ============================================ */
.quantity-group {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.quantity-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--gris-suave);
    border-radius: var(--radio-suave);
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    background: var(--crema);
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--t-standard);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--marron);
}

.qty-btn:hover {
    background: var(--celeste-light);
    color: var(--marron);
}

.qty-value {
    width: 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-left: 1px solid var(--gris-suave);
    border-right: 1px solid var(--gris-suave);
    transition: transform 0.15s ease;
}

.qty-value.bump {
    transform: scale(1.2);
}

/* ============================================
   ADD TO CART + BUY NOW BUTTONS
   ============================================ */
.add-to-cart-group {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

/* Add to cart — primary, full-width, terracota with glow */
.btn-add-cart {
    flex: 2;
    padding: 16px 24px;
    background: var(--terracota);
    color: var(--blanco);
    border: 2px solid var(--terracota);
    border-radius: var(--radius-xl);
    font-family: var(--font-cuerpo);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    min-height: 52px;
    transition: transform var(--t-quick) var(--ease-out-expo),
                box-shadow var(--t-standard),
                background var(--t-quick);
}

.btn-add-cart:hover {
    background: var(--terracota-dark);
    border-color: var(--terracota-dark);
    transform: translateY(-2px);
    box-shadow: var(--glow-terracota), var(--shadow-elevated);
}
.btn-add-cart:active { transform: scale(0.97); }

/* Buy now — ghost/outline style */
.btn-buy-now {
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    color: var(--marron);
    border: 2px solid var(--marron);
    border-radius: var(--radius-xl);
    font-family: var(--font-cuerpo);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    min-height: 52px;
    transition: transform var(--t-quick) var(--ease-out-expo),
                background var(--t-standard),
                color var(--t-standard);
}

.btn-buy-now:hover {
    background: var(--marron);
    color: var(--crema);
    transform: translateY(-2px);
}
.btn-buy-now:active { transform: scale(0.97); }

/* ============================================
   TRUST FEATURE BADGES (4 colored)
   ============================================ */
.product-trust {
    display: flex;
    gap: 12px;
    background: var(--blanco);
    border-radius: var(--radio-medio);
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: var(--sombra-suave);
    overflow: hidden;
}

.trust-feature {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    text-align: center;
    border-right: 1px solid var(--gris-suave);
}

.trust-feature:last-child {
    border-right: none;
}

.trust-feature svg {
    width: 28px;
    height: 28px;
}

/* Colored backgrounds: celeste, verde-salvia, arena, terracota */
.trust-feature:nth-child(1) { background: rgba(139,172,196,0.08); }
.trust-feature:nth-child(1) svg { color: var(--celeste); }

.trust-feature:nth-child(2) { background: rgba(139,158,126,0.08); }
.trust-feature:nth-child(2) svg { color: var(--verde-salvia); }

.trust-feature:nth-child(3) { background: rgba(212,165,116,0.08); }
.trust-feature:nth-child(3) svg { color: var(--arena); }

.trust-feature:nth-child(4) { background: rgba(196,149,106,0.08); }
.trust-feature:nth-child(4) svg { color: var(--terracota); }

.trust-feature span {
    font-size: 0.82rem;
    color: var(--marron-light);
}

/* ============================================
   PRODUCT TABS (ARIA tabpanel)
   ============================================ */
/* Tabs — pill style (not underline) */
.product-tabs {
    padding: var(--space-section) 0;
    border-top: 1px solid var(--gris-suave);
}

.tabs-nav {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 22px;
    font-family: var(--font-titulo);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--marron-light);
    background: var(--crema-dark);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: background var(--t-quick), color var(--t-quick), transform var(--t-quick) var(--ease-out-expo);
}

.tab-btn:hover {
    background: rgba(139, 172, 196, 0.15);
    color: var(--celeste-dark);
}

.tab-btn.active {
    background: var(--celeste);
    color: var(--blanco);
    font-weight: 600;
}
.tab-btn:active { transform: scale(0.97); }

.tab-content {
    max-width: 800px;
}

.tab-panel {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
}

.tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* fadeUp keyframes for animated tab content */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-panel.active > * {
    animation: fadeUp 0.4s ease both;
}
.tab-panel.active > *:nth-child(1) { animation-delay: 0s; }
.tab-panel.active > *:nth-child(2) { animation-delay: 0.1s; }
.tab-panel.active > *:nth-child(3) { animation-delay: 0.2s; }
.tab-panel.active > *:nth-child(4) { animation-delay: 0.3s; }
.tab-panel.active > *:nth-child(5) { animation-delay: 0.4s; }

.tab-panel h3 {
    font-family: var(--font-titulo);
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.tab-panel p {
    color: var(--marron-light);
    line-height: 1.8;
    margin-bottom: 16px;
}

/* Ingredients grid */
.ingredients-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.ingredient-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--marron-light);
    padding: 6px 0;
}

.ingredient-dot {
    width: 6px;
    height: 6px;
    background: var(--verde-salvia);
    border-radius: 50%;
    flex-shrink: 0;
}

/* How-to-use ordered list */
.how-to-use ol {
    padding-left: 20px;
    list-style: decimal;
}

.how-to-use li {
    font-size: 0.9rem;
    color: var(--marron-light);
    line-height: 1.8;
    margin-bottom: 8px;
}

/* ============================================
   RELATED PRODUCTS (Swiper carousel, arena tint bg)
   ============================================ */
/* Related products — uses new tokens */
.related-products {
    padding: var(--space-section) 0;
    background: var(--tint-energia);
}

.related-card {
    background: var(--blanco);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    display: block;
    transition: transform var(--t-standard) var(--ease-out-expo), box-shadow var(--t-standard);
}

.related-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-elevated);
}

.related-img {
    aspect-ratio: 3 / 4;
    background: var(--grad-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.related-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-deliberate) var(--ease-out-expo);
}

.related-card:hover .related-img img {
    transform: scale(1.05);
}

.related-img svg {
    width: 32px;
    height: 32px;
    color: var(--marron);
    opacity: 0.25;
}

.related-info {
    padding: 14px;
}

.related-info h3 {
    font-family: var(--font-titulo);
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 6px;
    line-height: 1.3;
}

.related-info .price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--terracota);
}

/* ============================================
   RESPONSIVE -- Product Detail
   ============================================ */
@media (max-width: 992px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .gallery {
        position: static;
    }
}

@media (max-width: 768px) {
    .product-title {
        font-size: 1.8rem;
    }
    .price-current {
        font-size: 1.8rem;
    }
    .add-to-cart-group {
        flex-direction: column;
    }
    /* Stacked trust badges */
    .product-trust {
        flex-direction: column;
    }
    .trust-feature {
        border-right: none;
        border-bottom: 1px solid var(--gris-suave);
    }
    .trust-feature:last-child {
        border-bottom: none;
    }
    .ingredients-list {
        grid-template-columns: 1fr;
    }
    .tabs-nav {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 1.6rem;
    }
    .price-current {
        font-size: 1.6rem;
    }
    .product-trust {
        flex-direction: column;
    }
    .trust-feature {
        border-right: none;
        border-bottom: 1px solid var(--gris-suave);
    }
    .trust-feature:last-child {
        border-bottom: none;
    }
}

@media (min-width: 1400px) {
    .product-detail {
        gap: 60px;
    }
}
