/* Premium Product Detail Page */
.pd-page {
    --pd-radius: 16px;
    --pd-sticky-h: 72px;
    padding-bottom: calc(var(--bottom-nav-height) + var(--pd-sticky-h) + 16px);
    background: var(--gray-50);
}

.product-main { padding-top: 0; padding-bottom: 0; }

/* Top navigation bar */
.pd-topbar {
    position: sticky;
    top: var(--header-height);
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-100);
}

[data-theme="dark"] .pd-topbar {
    background: rgba(30, 41, 59, 0.95);
    border-color: #334155;
}

.pd-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-800);
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
}

.pd-back:hover { background: var(--primary); color: var(--white); }

.pd-topbar-actions { display: flex; gap: 8px; }

.pd-icon-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.pd-icon-btn:hover, .pd-icon-btn.active {
    background: #fef2f2; color: var(--danger);
}

/* Image gallery */
.pd-gallery {
    background: var(--surface);
    border-bottom: 1px solid var(--gray-100);
}

.pd-gallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-height: min(92vw, 480px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

[data-theme="dark"] .pd-gallery-main { background: #0f172a; }

.pd-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    transition: opacity 0.25s ease;
}

.pd-gallery-thumbs {
    display: flex;
    gap: 10px;
    padding: 12px 16px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.pd-gallery-thumbs::-webkit-scrollbar { display: none; }

.pd-thumb {
    flex: 0 0 64px;
    width: 64px; height: 64px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--gray-200);
    padding: 0;
    cursor: pointer;
    background: var(--surface);
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.pd-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.pd-thumb.active, .pd-thumb:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Body content */
.pd-body {
    padding: 20px 16px 8px;
    max-width: 720px;
    margin: 0 auto;
}

.pd-header { margin-bottom: 20px; }

.pd-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--accent-soft);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.pd-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pd-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--gray-900);
    flex: 1;
}

.pd-wishlist {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    background: var(--surface);
    color: var(--gray-500);
    font-size: 1.15rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.pd-wishlist:hover, .pd-wishlist.active {
    border-color: var(--danger);
    color: var(--danger);
    background: #fef2f2;
}

.pd-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.pd-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
}

.pd-stock-in { background: #d1fae5; color: #065f46; }
.pd-stock-low { background: #fef3c7; color: #92400e; }
.pd-stock-out { background: #fee2e2; color: #991b1b; }

.pd-rating {
    font-size: 0.85rem;
    color: #f59e0b;
    display: flex; align-items: center; gap: 4px;
}

/* Pricing */
.pd-pricing { margin-bottom: 20px; }

.pd-flash-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.pd-pricing-grid {
    display: grid;
    gap: 12px;
}

.pd-pricing-dual { grid-template-columns: 1fr 1fr; }

.pd-price-card {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--pd-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pd-price-wholesale {
    border-color: #c7d2fe;
    background: linear-gradient(135deg, #fafaff, #eef2ff);
}

.pd-price-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pd-price-label small { font-weight: 500; text-transform: none; }

.pd-price-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.pd-price-wholesale .pd-price-value { color: #4338ca; }

.pd-price-active {
    border-width: 2px;
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.pd-price-wholesale.pd-price-active {
    border-color: #6366f1;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}

.pd-price-old {
    font-size: 0.85rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

.pd-price-unit {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.pd-price-locked {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px dashed #c7d2fe;
    border-radius: var(--pd-radius);
    padding: 24px;
    text-align: center;
}

.pd-price-locked-icon {
    width: 52px; height: 52px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    color: var(--primary);
    box-shadow: var(--shadow);
}

.pd-price-locked-text {
    font-size: 0.95rem;
    color: var(--gray-600);
    margin-bottom: 14px;
}

.pd-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.pd-login-btn:hover { background: var(--primary-dark); color: var(--white); }

/* Variant pickers (ڕەنگ / قیاس) */
.pd-variant-pickers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.pd-picker-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    background: var(--surface);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.pd-picker-trigger:active { transform: scale(0.99); }

.pd-picker-trigger.has-value {
    border-color: var(--primary);
    background: var(--soft-bg);
}

.pd-picker-kind {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
}

.pd-picker-kind i {
    color: var(--primary);
    font-size: 0.95rem;
}

.pd-picker-value {
    flex: 1;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-500);
}

.pd-picker-trigger.has-value .pd-picker-value {
    color: var(--primary);
}

.pd-picker-chevron {
    font-size: 0.75rem;
    color: var(--gray-400);
    transition: transform 0.2s ease;
}

.pd-variant-options[hidden] { display: none !important; }

/* Bottom sheet for options */
.pd-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 500;
    opacity: 0;
    transition: opacity 0.28s ease;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.pd-picker-overlay:not([hidden]) {
    display: block;
}

.pd-picker-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.pd-picker-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-nav-height) + var(--pd-sticky-h, 72px));
    z-index: 510;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: env(safe-area-inset-bottom, 0);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.pd-picker-sheet.open { transform: translateY(0); }

.pd-picker-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 1.05rem;
    color: var(--gray-900);
}

.pd-picker-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-picker-sheet-body {
    padding: 16px 20px 24px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.pd-picker-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    padding: 12px 10px;
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    background: var(--surface);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
}

.pd-picker-option small {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gray-500);
}

.pd-picker-option.active,
.pd-picker-option:hover {
    border-color: var(--primary);
    background: var(--accent-soft);
    color: var(--primary);
}

body.pd-picker-open { overflow: hidden; }

/* Order card */
.pd-order-card {
    background: var(--surface);
    border-radius: var(--pd-radius);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    margin-bottom: 24px;
}

.pd-order-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 12px;
    display: block;
}

.pd-order-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.pd-qty {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: 12px;
    padding: 4px;
    flex-shrink: 0;
}

.pd-qty-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--surface);
    color: var(--gray-700);
    font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.pd-qty-btn:hover:not(:disabled) { background: var(--primary); color: var(--white); }
.pd-qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pd-qty-input {
    width: 44px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    -moz-appearance: textfield;
}

.pd-qty-input::-webkit-outer-spin-button,
.pd-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.pd-add-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    min-height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.pd-add-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.pd-add-btn:disabled {
    background: var(--gray-300);
    box-shadow: none;
    cursor: not-allowed;
}

/* Accordion — native details/summary (works without JS) */
.pd-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.pd-details {
    background: var(--surface);
    border-radius: var(--pd-radius);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.pd-details-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    cursor: pointer;
    list-style: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pd-details-head::-webkit-details-marker { display: none; }

.pd-details-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pd-details-head .pd-acc-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.pd-details-chevron {
    color: var(--gray-400);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.pd-details[open] .pd-details-chevron { transform: rotate(180deg); }

.pd-details-body {
    padding: 0 18px 18px;
    font-size: 0.9rem;
    line-height: 1.85;
    color: var(--gray-600);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.pd-details-body p { margin: 0 0 12px; }
.pd-details-body p:last-child { margin-bottom: 0; }

.pd-wholesale-note {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.pd-spec-list { list-style: none; }

.pd-spec-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
}

.pd-spec-list li:last-child { border-bottom: none; }

.pd-spec-list strong { color: var(--gray-800); }

/* Sticky bottom bar */
.pd-sticky-bar {
    position: fixed;
    left: 0; right: 0;
    bottom: var(--bottom-nav-height);
    z-index: 95;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--gray-200);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .pd-sticky-bar {
    background: rgba(30, 41, 59, 0.98);
    border-color: #334155;
}

[data-theme="dark"] .pd-gallery,
[data-theme="dark"] .pd-order-card,
[data-theme="dark"] .pd-details,
[data-theme="dark"] .pd-price-card { background: #1e293b; border-color: #334155; }

[data-theme="dark"] .pd-title,
[data-theme="dark"] .pd-details-head { color: #f1f5f9; }

[data-theme="dark"] .pd-back,
[data-theme="dark"] .pd-icon-btn,
[data-theme="dark"] .pd-wishlist { background: #334155; color: #e2e8f0; }

.pd-sticky-price {
    flex: 1;
    min-width: 0;
}

.pd-sticky-price-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    display: block;
}

.pd-sticky-price-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.pd-sticky-bar .pd-qty { padding: 2px; }
.pd-sticky-bar .pd-qty-btn { width: 36px; height: 36px; }
.pd-sticky-bar .pd-add-btn {
    flex: 1.2;
    min-height: 44px;
    font-size: 0.9rem;
    padding: 0 16px;
}

.pd-sticky-locked {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* Extra sections */
.pd-section {
    margin-bottom: 32px;
}

.pd-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-900);
}

.pd-related { padding-bottom: 16px; }

/* Desktop */
@media (min-width: 992px) {
    .pd-page {
        padding-bottom: 32px;
    }

    .pd-sticky-bar { display: none; }

    .pd-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 40px;
        max-width: 1200px;
        margin: 0 auto;
        padding: 24px 16px 0;
        align-items: start;
    }

    .pd-gallery {
        position: sticky;
        top: calc(var(--header-height) + 56px);
        border-radius: var(--pd-radius);
        overflow: hidden;
        box-shadow: var(--shadow-md);
        border: none;
    }

    .pd-body {
        max-width: none;
        padding: 0;
    }

    .pd-topbar {
        max-width: 1200px;
        margin: 0 auto;
        border-radius: 0 0 var(--pd-radius) var(--pd-radius);
    }
}

@media (max-width: 400px) {
    .pd-pricing-dual { grid-template-columns: 1fr; }
    .pd-order-row { flex-direction: column; }
    .pd-add-btn { min-height: 52px; }
}

@media (max-width: 991px) {
    .pd-body {
        max-width: 760px;
        padding: 18px clamp(16px, 5vw, 24px) 8px;
        background: var(--surface);
    }

    .pd-header {
        margin-bottom: 0;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--gray-100);
    }

    .pd-category {
        margin-bottom: 8px;
        padding: 3px 9px;
        background: var(--soft-bg);
        color: var(--gray-600);
        border-radius: 6px;
    }

    .pd-title-row { align-items: center; }

    .pd-title {
        font-size: clamp(1.15rem, 4.5vw, 1.35rem);
        line-height: 1.5;
    }

    .pd-wishlist {
        width: 40px;
        height: 40px;
        border-width: 1px;
    }

    .pd-meta-row {
        gap: 8px;
        margin-top: 10px;
    }

    .pd-stock {
        padding: 4px 9px;
        font-size: 0.75rem;
    }

    .pd-pricing {
        margin: 14px 0 0;
    }

    .pd-pricing-grid { gap: 8px; }

    .pd-price-card {
        gap: 3px;
        padding: 12px 14px;
        border-color: var(--gray-200);
        border-radius: 12px;
        background: var(--soft-bg);
        box-shadow: none;
    }

    .pd-price-active { border-width: 1px; }

    .pd-price-wholesale,
    .pd-price-wholesale.pd-price-active {
        border-color: #cbd5e1;
        background: var(--soft-bg);
        box-shadow: none;
    }

    .pd-price-value { font-size: 1.3rem; }

    .pd-order-card {
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .pd-order-row--desktop { display: none; }

    .pd-picker-trigger {
        min-height: 48px;
        padding: 10px 12px;
        border: 1px solid var(--gray-200);
        border-radius: 10px;
    }

    .pd-accordion {
        gap: 0;
        margin: 12px 0 24px;
        border-top: 1px solid var(--gray-100);
    }

    .pd-details {
        border: 0;
        border-bottom: 1px solid var(--gray-100);
        border-radius: 0;
        box-shadow: none;
    }

    .pd-details-head { padding: 14px 2px; }

    .pd-details-head .pd-acc-icon {
        width: 30px;
        height: 30px;
        background: var(--soft-bg);
        color: var(--gray-600);
    }

    .pd-details-body { padding: 0 2px 16px; }
}

.pd-order-card--modal .pd-order-row--desktop {
    flex-direction: column;
    align-items: stretch;
}

@media (max-width: 991px) {
    .pd-order-card--modal { display: none; }
}

@media (min-width: 992px) {
    .pd-order-card--modal { display: block; }
    .pd-order-card--modal .pd-add-btn { width: 100%; }
}

/* Variant selection modal */
.pd-vm-overlay {
    position: fixed;
    inset: 0;
    z-index: 520;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.pd-vm-overlay.visible { opacity: 1; pointer-events: auto; }

.pd-vm {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(.96);
    z-index: 530;
    width: min(440px, calc(100vw - 24px));
    max-height: min(88vh, 720px);
    background: var(--soft-bg);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
    overflow: hidden;
}
.pd-vm.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.pd-vm-head {
    background: #1e3a5f;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.pd-vm-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pd-vm-close {
    width: 36px; height: 36px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.pd-vm-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
}

.pd-vm-section { margin-bottom: 18px; }
.pd-vm-section-label {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--gray-700);
}

.pd-vm-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-start;
}
.pd-vm-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    min-width: 72px;
    -webkit-tap-highlight-color: transparent;
}
.pd-vm-swatch-ring {
    width: 56px; height: 56px;
    border-radius: 50%;
    padding: 3px;
    border: 2px solid transparent;
    transition: border-color .2s, box-shadow .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.pd-vm-swatch-ring img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.pd-vm-swatch.active .pd-vm-swatch-ring {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.25);
}
.pd-vm-swatch-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--gray-700);
    text-align: center;
    max-width: 80px;
    line-height: 1.2;
}

#pdVmColorSection .pd-vm-swatches {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.pd-vm-color-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--surface);
}

.pd-vm-color-row.selected {
    border-color: var(--primary);
    background: var(--soft-bg);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .1);
}

.pd-vm-color-row .pd-vm-swatch {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0;
}

.pd-vm-color-row .pd-vm-swatch-ring {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
}

.pd-vm-color-row .pd-vm-swatch-label {
    max-width: none;
    text-align: start;
    line-height: 1.4;
}

.pd-vm-color-qty {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border-radius: 9px;
    background: var(--gray-100);
}

.pd-vm-color-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 7px;
    background: var(--surface);
    color: var(--gray-700);
    cursor: pointer;
}

.pd-vm-color-qty-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pd-vm-color-qty-input {
    width: 38px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--gray-900);
    font: inherit;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
}

.pd-vm-color-qty-input::-webkit-inner-spin-button,
.pd-vm-color-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

@media (max-width: 480px) {
    .pd-vm-body { padding: 12px; }

    .pd-vm-color-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
        border-radius: 14px;
    }

    .pd-vm-color-row .pd-vm-swatch {
        width: 100%;
        min-height: 44px;
        gap: 12px;
        justify-content: flex-start;
    }

    .pd-vm-color-row .pd-vm-swatch-ring {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
    }

    .pd-vm-color-row .pd-vm-swatch-label {
        font-size: .9rem;
        font-weight: 700;
    }

    .pd-vm-color-qty {
        width: 100%;
        justify-content: space-between;
        padding: 4px;
        border-radius: 10px;
    }

    .pd-vm-color-qty-btn {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    .pd-vm-color-qty-input {
        flex: 1;
        width: auto;
        height: 40px;
        font-size: 1rem;
    }
}

.pd-vm-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.pd-vm-size-btn {
    min-width: 48px;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    background: var(--surface);
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    transition: all .2s;
    -webkit-tap-highlight-color: transparent;
}
.pd-vm-size-btn.active {
    border-color: var(--primary);
    background: var(--accent-soft);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.pd-vm-qty {
    display: inline-flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: 12px;
    overflow: hidden;
}
.pd-vm-qty-main { width: 100%; justify-content: center; }
.pd-vm-qty button {
    width: 44px; height: 44px;
    border: none;
    background: transparent;
    font-size: .9rem;
    cursor: pointer;
    color: var(--gray-700);
}
.pd-vm-qty input {
    width: 56px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 1rem;
}

.pd-vm-summary {
    margin: 0;
    padding: 12px 14px;
    background: var(--accent-soft);
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 600;
    color: #4338ca;
    text-align: center;
}

.pd-vm-foot {
    display: flex;
    gap: 10px;
    padding: 12px 16px 16px;
    background: var(--soft-bg);
    border-top: 1px solid var(--gray-100);
}
.pd-vm-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pd-vm-btn-ghost {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
}
.pd-vm-btn-cart {
    background: var(--primary);
    color: #fff;
}
.pd-vm-btn-cart:disabled {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

body.pd-vm-open { overflow: hidden; }

[data-theme="dark"] .pd-stock-low { background: #78350f; color: #fde68a; }
[data-theme="dark"] .pd-stock-out { background: #7f1d1d; color: #fecaca; }

/* Share button (mobile only, copies the link) */
.pd-share { display: none; }
.pd-toast { display: none; }

@media (max-width: 767px) {
    .pd-share {
        display: inline-flex; align-items: center; gap: .5rem;
        padding: .5rem 1rem;
        border-radius: 999px;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: #fff;
        font-size: .875rem; font-weight: 700;
        box-shadow: 0 .3rem .9rem rgba(99, 102, 241, .35);
        transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .pd-share i { font-size: .95rem; }
    .pd-share:active { transform: scale(.94); box-shadow: 0 .15rem .5rem rgba(99, 102, 241, .3); }
    .pd-share.is-copied { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 .3rem .9rem rgba(16, 185, 129, .35); }

    .pd-toast {
        display: block;
        position: fixed; left: 50%; bottom: calc(var(--bottom-nav-height, 4rem) + 5.5rem);
        transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
        max-width: 90vw; padding: .65rem 1.25rem; border-radius: 999px;
        background: var(--toast-bg, #111827); color: #fff; font-size: .9rem; font-weight: 600;
        box-shadow: var(--shadow-lg); z-index: 300;
        transition: opacity .2s ease, transform .2s ease;
    }
    .pd-toast.show { opacity: 1; transform: translate(-50%, 0); }
}
