/* ═══════════════════════════════════════════════════════════
   Product Detail Page (PDP) — 3-column Baseus-style layout
═══════════════════════════════════════════════════════════ */

/* ── Page wrapper ─────────────────────────────────────── */
.pdp-page {
    background: #f2f3f5;
    padding: 24px 0 60px;
    min-height: 60vh;
}

.pdp-page .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Breadcrumb ───────────────────────────────────────── */
.pdp-breadcrumb {
    font-size: .78rem;
    color: #888;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.pdp-breadcrumb a {
    color: #666;
    text-decoration: none;
}

.pdp-breadcrumb a:hover { color: var(--primary-color, #0056b3); }
.pdp-breadcrumb .sep { color: #ccc; }
.pdp-breadcrumb .cur { color: #333; font-weight: 500; }

/* ── 3-column grid ────────────────────────────────────── */
.pdp-grid {
    display: grid;
    grid-template-columns: 400px 1fr 288px;
    gap: 20px;
    align-items: stretch;   /* all columns stretch to tallest */
}

/* 2-column variant: when right buy panel is hidden */
.pdp-grid--no-buy {
    grid-template-columns: 400px 1fr;
}

/* ════════════════════════════════════════════════════════
   LEFT — Gallery
════════════════════════════════════════════════════════ */

/* Column IS the card — stretches to grid row height */
.pdp-col-gallery {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eaebec;
    display: flex;
    flex-direction: column;
}

/* Inner content sticks within the tall column */
.pdp-gallery-box {
    position: sticky;
    top: 88px;
    padding: 16px;
    height: fit-content;
}

/* Main image wrapper */
.pdp-main-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
}

.pdp-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform .35s ease;
}

.pdp-main-wrap:hover .pdp-main-img {
    transform: scale(1.04);
}

/* Prev / next arrows */
.pdp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    font-size: 1rem;
    z-index: 2;
    transition: background .15s, color .15s;
    user-select: none;
    line-height: 1;
}

.pdp-arrow:hover { background: #fff; color: #111; }
.pdp-arrow-prev { left: 8px; }
.pdp-arrow-next { right: 8px; }

/* Wishlist inside gallery */
.pdp-gal-wish {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    transition: color .15s, transform .15s;
    padding: 0;
}

.pdp-gal-wish:hover  { color: #ef4444; transform: scale(1.1); }
.pdp-gal-wish.wished { color: #ef4444; }
.pdp-gal-wish.wished svg { fill: #ef4444; }

/* Badge on gallery image */
.pdp-gal-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
    background: #16a34a;
    z-index: 3;
}

/* Thumbnail strip */
.pdp-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.pdp-thumb-btn {
    width: 60px;
    height: 60px;
    border-radius: 7px;
    border: 2px solid #e5e7eb;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: #f8f9fa;
    transition: border-color .15s;
    flex-shrink: 0;
}

.pdp-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pdp-thumb-btn.active,
.pdp-thumb-btn:hover {
    border-color: #111;
}

/* ════════════════════════════════════════════════════════
   CENTER — Product detail
════════════════════════════════════════════════════════ */
.pdp-col-detail {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eaebec;
    padding: 24px 28px 28px;
}

.pdp-col-detail .pdp-cat-tag {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary-color, #0056b3);
    background: #e8f0ff;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.pdp-col-detail h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111;
    line-height: 1.4;
    margin: 0 0 8px;
}

.pdp-subtitle {
    font-size: .85rem;
    color: #6b7280;
    margin: 0 0 14px;
    font-style: italic;
}

/* SKU / Barcode meta */
.pdp-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    font-size: .78rem;
    color: #666;
    padding: 10px 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 16px;
}

.pdp-meta-row strong { color: #333; }

/* Short description / features */
.pdp-features {
    font-size: .875rem;
    color: #374151;
    line-height: 1.7;
    margin: 0 0 20px;
}

.pdp-features ul {
    padding-left: 0;
    list-style: none;
    margin: 0;
}

.pdp-features ul li {
    padding: 2px 0 2px 18px;
    position: relative;
}

.pdp-features ul li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: var(--primary-color, #0056b3);
    font-weight: 700;
}

/* Variants section (keep existing .variant-* classes, just add context) */
.pdp-col-detail .product-variants-section {
    margin: 0 0 20px;
}

/* Share row */
.pdp-share-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.pdp-share-row span {
    font-size: .78rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pdp-share-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    font-size: .85rem;
    transition: opacity .15s, transform .15s;
    flex-shrink: 0;
}

.pdp-share-btn:hover { opacity: .85; transform: scale(1.08); }
.pdp-share-wa  { background: #25d366; }
.pdp-share-tw  { background: #1da1f2; }
.pdp-share-fb  { background: #1877f2; }
.pdp-share-cp  { background: #6b7280; }

/* ════════════════════════════════════════════════════════
   RIGHT — Buy box
════════════════════════════════════════════════════════ */

/* Column IS the card — stretches to grid row height */
.pdp-col-buy {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eaebec;
    display: flex;
    flex-direction: column;
}

/* Inner content sticks within the tall column */
.pdp-buy-box {
    position: sticky;
    top: 88px;
    padding: 20px;
    height: fit-content;
}

/* Price section */
.pdp-buy-price {
    margin-bottom: 14px;
}

.pdp-buy-price-main {
    font-size: 2rem;
    font-weight: 800;
    color: #111;
    letter-spacing: -.03em;
    line-height: 1;
    display: block;
    margin-bottom: 6px;
}

.pdp-buy-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pdp-buy-price-orig {
    font-size: .9rem;
    color: #adb5bd;
    text-decoration: line-through;
}

.pdp-buy-off-badge {
    background: #dc2626;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: .02em;
}

/* Info boxes (shipping / discount) */
.pdp-info-box {
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdp-info-box-ship {
    background: #fff9ed;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.pdp-info-box-card {
    background: #f0fdf4;
    border: 1px dashed #86efac;
    color: #166534;
}

/* Qty + Add to Cart */
.pdp-buy-qty-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.pdp-buy-qty {
    display: flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.pdp-buy-qty-btn {
    width: 36px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    color: #374151;
    transition: background .12s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pdp-buy-qty-btn:hover { background: #f3f4f6; }

.pdp-buy-qty-num {
    width: 42px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: .95rem;
    font-weight: 600;
    color: #111;
    pointer-events: none;
}

/* Add to cart CTA */
.pdp-buy-atc {
    flex: 1;
    padding: 11px 16px;
    background: var(--cart-btn-bg, #f97316);
    color: #111;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: .01em;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}

.pdp-buy-atc:hover  { background: var(--cart-btn-bg-hover, #ea6c0e); }
.pdp-buy-atc:active { transform: scale(.98); }
.pdp-buy-atc:disabled { opacity: .6; cursor: not-allowed; }

/* Quote CTA (no price) */
.pdp-buy-quote {
    width: 100%;
    padding: 12px 16px;
    background: var(--primary-color, #0056b3);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    transition: opacity .15s;
}

.pdp-buy-quote:hover { opacity: .88; }

/* Out of stock state */
.pdp-buy-oos {
    width: 100%;
    padding: 12px;
    background: #f3f4f6;
    color: #9ca3af;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
    cursor: not-allowed;
}

/* Stock indicator */
.pdp-stock-line {
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.pdp-stock-ok  { color: #16a34a; }
.pdp-stock-low { color: #ea580c; }
.pdp-stock-out { color: #9ca3af; }

/* Trust badges */
.pdp-trust-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #f3f4f6;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.pdp-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .76rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.pdp-trust-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
}

/* Unique color per badge */
.pdp-trust-item:nth-child(1) .pdp-trust-icon { background: #dbeafe; }
.pdp-trust-item:nth-child(2) .pdp-trust-icon { background: #d1fae5; }
.pdp-trust-item:nth-child(3) .pdp-trust-icon { background: #fef9c3; }
.pdp-trust-item:nth-child(4) .pdp-trust-icon { background: #ede9fe; }
.pdp-trust-item:nth-child(5) .pdp-trust-icon { background: #fee2e2; }

/* ── Description + specs below the grid ──────────────── */
.pdp-lower {
    margin-top: 20px;
}

.pdp-lower-box {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eaebec;
    padding: 28px 32px;
    margin-bottom: 20px;
}

.pdp-lower-box h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
}

/* Specs table */
.pdp-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.pdp-specs-table tr:nth-child(even) td { background: #fafafa; }

.pdp-specs-table td {
    padding: 9px 12px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.pdp-specs-table td:first-child {
    font-weight: 600;
    color: #111;
    width: 35%;
    white-space: nowrap;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
    .pdp-grid {
        grid-template-columns: 320px 1fr;
        grid-template-rows: auto auto;
        align-items: start;         /* reset stretch for stacked layout */
    }

    /* no-buy stays 2-col, just narrower */
    .pdp-grid--no-buy {
        grid-template-columns: 300px 1fr;
    }

    .pdp-col-buy {
        grid-column: 1 / -1;
        border-radius: 12px;
    }

    .pdp-buy-box {
        position: static;           /* no more sticky on tablet */
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        height: auto;
    }

    .pdp-buy-price,
    .pdp-trust-list { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .pdp-grid,
    .pdp-grid--no-buy {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .pdp-gallery-box { position: static; padding: 12px; height: auto; }
    .pdp-buy-box     { position: static; display: block; height: auto; }
    .pdp-col-detail  { padding: 18px; }
    .pdp-lower-box   { padding: 18px; }
    .pdp-buy-price-main { font-size: 1.6rem; }
    .pdp-col-detail h1  { font-size: 1.15rem; }
}

/* ── Dark mode ────────────────────────────────────────── */
[data-theme="dark"] .pdp-page           { background: var(--bg-secondary, #1a1a1a); }
[data-theme="dark"] .pdp-col-gallery,
[data-theme="dark"] .pdp-col-detail,
[data-theme="dark"] .pdp-col-buy,
[data-theme="dark"] .pdp-lower-box      { background: var(--bg-primary, #2d2d2d); border-color: var(--border-color, #404040); }
[data-theme="dark"] .pdp-col-detail h1,
[data-theme="dark"] .pdp-buy-price-main { color: var(--text-primary, #fff); }
[data-theme="dark"] .pdp-trust-item     { color: var(--text-secondary, #e0e0e0); }
[data-theme="dark"] .pdp-trust-item .pdp-trust-icon { background: var(--bg-tertiary, #404040) !important; }
[data-theme="dark"] .pdp-main-wrap      { background: #fff; }

/* ── Dark mode: text elements ─────────────────────────── */
[data-theme="dark"] .pdp-breadcrumb a   { color: var(--text-secondary, #9ca3af); }
[data-theme="dark"] .pdp-breadcrumb .cur { color: var(--text-primary, #e2e8f0); }
[data-theme="dark"] .pdp-breadcrumb .sep { color: var(--border-color, #555); }

[data-theme="dark"] .pdp-cat-tag {
    background: rgba(59, 130, 246, .18);
    color: #93c5fd;
}

[data-theme="dark"] .pdp-subtitle { color: var(--text-secondary, #9ca3af); }

[data-theme="dark"] .pdp-meta-row {
    color: var(--text-secondary, #9ca3af);
    border-color: var(--border-color, #404040);
}
[data-theme="dark"] .pdp-meta-row strong { color: var(--text-primary, #e2e8f0); }

[data-theme="dark"] .pdp-features,
[data-theme="dark"] .pdp-features p,
[data-theme="dark"] .pdp-features li { color: var(--text-secondary, #cbd5e1); }

[data-theme="dark"] .pdp-share-row     { border-color: var(--border-color, #404040); }
[data-theme="dark"] .pdp-share-row span { color: var(--text-secondary, #6b7280); }

/* ── Dark mode: buy box ───────────────────────────────── */
[data-theme="dark"] .pdp-buy-price-orig { color: #6b7280; }

[data-theme="dark"] .pdp-info-box-ship {
    background: rgba(251, 191, 36, .1);
    border-color: rgba(251, 191, 36, .25);
    color: #fbbf24;
}

[data-theme="dark"] .pdp-buy-qty {
    border-color: var(--border-color, #404040);
    background: var(--bg-secondary, #1e293b);
}
[data-theme="dark"] .pdp-buy-qty-btn { color: var(--text-primary, #e2e8f0); }
[data-theme="dark"] .pdp-buy-qty-btn:hover { background: var(--bg-tertiary, #374151); }
[data-theme="dark"] .pdp-buy-qty-num  { color: var(--text-primary, #e2e8f0); background: transparent; }

[data-theme="dark"] .pdp-buy-oos {
    background: var(--bg-tertiary, #374151);
    border-color: var(--border-color, #404040);
    color: var(--text-secondary, #6b7280);
}

/* ── Dark mode: lower description / specs ─────────────── */
[data-theme="dark"] .pdp-lower-box h2  { color: var(--text-primary, #fff); border-color: var(--border-color, #404040); }
[data-theme="dark"] .pdp-lower-box p,
[data-theme="dark"] .pdp-lower-box li  { color: var(--text-secondary, #cbd5e1); }
[data-theme="dark"] .pdp-specs-table td { color: var(--text-secondary, #cbd5e1); border-color: var(--border-color, #404040); }
[data-theme="dark"] .pdp-specs-table td:first-child { color: var(--text-primary, #e2e8f0); }
[data-theme="dark"] .pdp-specs-table tr:nth-child(even) td { background: var(--bg-secondary, #263040); }

/* ── Description / TinyMCE Content Image Constraint ──────── */
.pdp-lower-box img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 8px;
}

.pdp-lower-box p {
    max-width: 100%;
    overflow: hidden;
}

.pdp-lower-box figure {
    max-width: 100%;
    margin: 1rem 0;
    overflow: hidden;
}

.pdp-lower-box figure img {
    max-width: 100% !important;
    height: auto !important;
    width: 100% !important;
    border-radius: 8px;
}

.pdp-lower-box table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.pdp-lower-box iframe {
    max-width: 100%;
}
