/*
 * PJ3D Theme v100 — PRODUCT (Single Product Page Styles)
 * =====================================================
 * Extracted from single-product.php inline <style> block.
 * Loaded conditionally on single-product pages only.
 */

body.single-product {
    --bg-color: #f7f3ec;
    --text-color: #24211d;
    --accent: #9a6a43;
    --accent-hover: #775032;
    --pj-bg: #f7f3ec;
    --pj-text: #24211d;
    --pj-accent: #9a6a43;
    --pj-brand: #4f5f43;
    --pj-line: rgba(61, 53, 45, 0.16);
    --pj-surface: #fffdf8;
    --pj-surface-alt: #efe7dc;
    --pj-text-muted: #6f665d;
    background: var(--pj-bg);
    color: var(--pj-text);
}

body.single-product .nav-bar {
    background: rgba(255, 253, 248, 0.96) !important;
    border-bottom-color: var(--pj-line) !important;
    color: var(--pj-text) !important;
}

body.single-product .pdp-container,
body.single-product .product-main-grid,
body.single-product .editorial-content-section,
body.single-product .related,
body.single-product .upsells {
    background: var(--pj-bg) !important;
    color: var(--pj-text) !important;
}

body.single-product .ep-block h2,
body.single-product .ep-accordion summary,
body.single-product .pj-fit .ep-split-grid strong {
    text-transform: none;
    letter-spacing: 0;
}

body.single-product .ep-buybox,
body.single-product .ep-accordion,
body.single-product .pj-affiliate-disclosure {
    background: var(--pj-surface) !important;
    border-color: var(--pj-line) !important;
    color: var(--pj-text) !important;
}

body.single-product .pj-trust,
body.single-product .pj-spec {
    border-color: var(--pj-line) !important;
}

body.single-product .woocommerce ul.products,
body.single-product ul.products,
body.single-product .wc-block-grid__products {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
    gap: clamp(1rem, 2vw, 1.4rem) !important;
    width: 100% !important;
}

body.single-product .woocommerce ul.products li.product,
body.single-product ul.products li.product,
body.single-product .wc-block-grid__product {
    min-width: min(100%, 220px) !important;
    background: var(--pj-surface) !important;
    color: var(--pj-text) !important;
    border: 1px solid var(--pj-line) !important;
    border-radius: 8px !important;
    padding: 0.9rem !important;
}

body.single-product .woocommerce-loop-product__title,
body.single-product .wc-block-grid__product-title,
body.single-product .wp-block-getwid-template-post-title,
body.single-product .wp-block-getwid-template-post-title a,
body.single-product [data-block-name="woocommerce/product-category"] h2,
body.single-product [data-block-name="woocommerce/product-category"] a {
    color: var(--pj-text) !important;
    background-color: var(--pj-surface) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.35 !important;
}

body.single-product img[loading="lazy"] {
    background: #f1eadf;
}

/* --- CUSTOMIZER RULES (v100: Migrated from Apariencia → CSS adicional) --- */
/* These were in the WP Customizer for v99 and don't carry over on theme switch */

/* Hide redundant "¿Encaja contigo?" duplicate text block */
#editorial-buybox > div:nth-child(3) {
    display: none !important;
}

/* --- Editorial Product Blocks --- */
.ep-block {
    margin-bottom: 3.5rem;
}

.ep-block h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    border-bottom: 1px solid var(--pj-line);
    padding-bottom: 0.75rem;
    text-transform: uppercase;
}

.ep-text {
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: 0.9;
}

.ep-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ep-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    opacity: 0.9;
    line-height: 1.5;
}

.ep-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--pj-brand);
    font-weight: bold;
}

.ep-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .ep-split-grid {
        grid-template-columns: 1fr;
    }
}

.ep-list.check-list li::before {
    content: '✓';
    color: #4ade80;
}

.ep-list.cross-list li::before {
    content: '✕';
    color: #f87171;
}

/* --- Accordion --- */
.ep-accordion {
    border: 1px solid var(--pj-line);
    border-radius: 8px;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
}

.ep-accordion summary {
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    list-style: none;
    text-transform: uppercase;
}

.ep-accordion summary::-webkit-details-marker {
    display: none;
}

/* --- Buybox --- */
.ep-buybox {
    border: 1px solid var(--pj-line);
    border-radius: 12px;
    padding: 2.5rem;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 4rem;
    text-align: center;
}

.ep-buybox.internal-buybox {
    text-align: left;
    background: transparent;
    border: none;
    padding: 0;
    border-top: 1px solid var(--pj-line);
    padding-top: 2.5rem;
    border-radius: 0;
}

.ep-buybox .price {
    font-size: 2rem !important;
    margin-bottom: 1.5rem !important;
    color: var(--pj-brand);
}

.ep-buybox .button.single_add_to_cart_button {
    padding: 16px 32px !important;
    font-size: 1.1rem;
    border-radius: 8px;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Hero Info Column --- */
.pj-breadcrumbs {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

.pj-kicker {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.pj-title.long-title {
    margin-bottom: 0.5rem;
    font-size: clamp(1.8rem, 2.5vw, 2.5rem);
    line-height: 1.2;
}

body.single-product .pj-title,
body.single-product .pj-title.long-title {
    color: var(--pj-text) !important;
    text-shadow: none !important;
}

.pj-microline {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.pj-offer__price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--pj-brand);
    margin-bottom: 1.5rem;
}

.pj-price-note {
    font-size: 0.8rem;
    opacity: 0.6;
    font-weight: 400;
    margin-top: 0.25rem;
}

.pj-btn--primary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--pj-text);
    color: var(--pj-bg);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
}

.pj-btn--primary:hover {
    background: var(--accent);
    color: #fff;
}

.pj-subnote {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.pj-trust {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pj-trust__list {
    opacity: 0.85;
    font-size: 0.9rem;
}

/* --- Ideal/Not-For Labels --- */
.pj-fit .ep-split-grid strong {
    display: block;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- Specs --- */
.pj-specs__grid {
    margin-top: 1.5rem;
}

.pj-spec {
    list-style: none;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

/* --- Final CTA Buybox --- */
.ep-buybox h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.ep-buybox .pj-btn--primary[data-cta="final"] {
    padding: 16px 32px;
    font-size: 1.1rem;
    width: 100%;
    max-width: 400px;
    text-transform: uppercase;
}

/* --- Popularity & Urgency Micro-signals --- */
.pj-popularity-signal {
    font-size: 0.85rem;
    color: #f59e0b;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pj-urgency-signal {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2rem;
}

/* --- ZONE 3 Section --- */
.detail-gallery-section {
    background: var(--pj-bg-alt, #0a0a0a);
    margin-top: 2rem;
}

.detail-gallery-section .container {
    max-width: 900px;
    margin: 0 auto;
}

/* --- Compare Block --- */
.ep-compare-block {
    margin-top: 5rem;
}

.ep-compare-block h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--pj-line);
    padding-bottom: 0.75rem;
}

/* --- Sticky Title Wrapper --- */
.sticky-title-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sticky-title-wrapper .sticky-title {
    line-height: 1.1;
    margin-bottom: 2px;
    font-size: 0.85rem;
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
}

.sticky-title-wrapper .sticky-price {
    font-weight: 700;
    color: var(--pj-brand);
    font-size: 1rem;
    line-height: 1;
}

/* PJD-16940: align product pages with the lighter commerce system and preserve readable CTAs. */
body.single-product .pdp-hero,
body.single-product .editorial-hero,
body.single-product .hero-grid,
body.single-product .editorial-content-section {
    background: var(--pj-bg) !important;
    color: var(--pj-text) !important;
}

body.single-product .hero-backdrop {
    opacity: 0.12 !important;
}

body.single-product .hero-info-col,
body.single-product .editorial-info {
    background: var(--pj-surface) !important;
    border: 1px solid var(--pj-line) !important;
    border-radius: 8px !important;
    color: var(--pj-text) !important;
    padding: clamp(1.25rem, 3vw, 2rem) !important;
}

body.single-product .pj-offer__actions .pj-affiliate-disclosure {
    margin-bottom: 1rem !important;
    box-shadow: none !important;
}

body.single-product .pj-offer__actions .pj-btn,
body.single-product .ep-buybox .pj-btn,
body.single-product .sticky-btn,
body.single-product a[href*="amazon."],
body.single-product a[href*="amzn.to"] {
    min-height: 44px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    line-height: 1.25 !important;
    text-align: center !important;
    white-space: normal !important;
}

body.single-product .pdp-hero {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: clamp(2rem, 5vw, 4rem) 4vw !important;
}

body.single-product .hero-grid.commercial-layout {
    width: min(100%, 1280px) !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr) !important;
    gap: clamp(1.5rem, 4vw, 4rem) !important;
}

@media (max-width: 782px) {
    body.single-product .hero-grid,
    body.single-product .hero-grid.commercial-layout,
    body.single-product .commercial-layout,
    body.single-product .editorial-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
    }

    body.single-product .hero-info-col,
    body.single-product .editorial-info,
    body.single-product .hero-image-col {
        min-width: 0 !important;
        width: 100% !important;
    }
}
