/* ============================================================================
 * Product Detail Page — public store
 * Standalone stylesheet. Load once on the product page.
 * All selectors are namespaced under `.pdp` to avoid bleed.
 * ========================================================================== */

/* ────────────────────────────────────────────────────────────────────────────
 * 1) Design tokens (light + dark)
 * ────────────────────────────────────────────────────────────────────────── */
.pdp {
    --pdp-bg:           #ffffff;
    --pdp-surface:      #f8fafc;
    --pdp-surface-2:    #f1f5f9;
    --pdp-border:       rgba(15, 23, 42, 0.08);
    --pdp-border-2:     rgba(15, 23, 42, 0.16);
    --pdp-text:         #0f172a;
    --pdp-text-muted:   #64748b;
    --pdp-text-light:   #94a3b8;
    --pdp-accent:       #16a34a;
    --pdp-danger:       #dc2626;
    --pdp-warning:      #ea580c;
    --pdp-info:         #2563eb;

    --pdp-r-sm: 8px;
    --pdp-r:    12px;
    --pdp-r-lg: 16px;

    --pdp-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 12px rgba(15,23,42,0.04);

    color: var(--pdp-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--pdp-bg);
    padding: 32px 0 64px;
}

/* Dark mode (Bootstrap, OS, custom .dark-theme) */
@media (prefers-color-scheme: dark) {
    .pdp:not(.pdp-light) {
        --pdp-bg:        #0f172a;
        --pdp-surface:   #1e293b;
        --pdp-surface-2: #334155;
        --pdp-border:    rgba(255,255,255,0.08);
        --pdp-border-2:  rgba(255,255,255,0.16);
        --pdp-text:      #f1f5f9;
        --pdp-text-muted:#94a3b8;
        --pdp-text-light:#64748b;
    }
}
html.dark-theme .pdp,
body.dark-theme .pdp,
[data-bs-theme="dark"] .pdp {
    --pdp-bg:        #0f172a;
    --pdp-surface:   #1e293b;
    --pdp-surface-2: #334155;
    --pdp-border:    rgba(255,255,255,0.08);
    --pdp-border-2:  rgba(255,255,255,0.16);
    --pdp-text:      #f1f5f9;
    --pdp-text-muted:#94a3b8;
    --pdp-text-light:#64748b;
}

/* ────────────────────────────────────────────────────────────────────────────
 * 2) Layout
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

.pdp__breadcrumb {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 13px; color: var(--pdp-text-muted);
    margin-bottom: 24px;
}
.pdp__breadcrumb a { color: var(--pdp-text-muted); text-decoration: none; }
.pdp__breadcrumb a:hover { color: var(--pdp-text); }
.pdp__breadcrumb-sep { opacity: 0.4; }
.pdp__breadcrumb-current { color: var(--pdp-text); font-weight: 500; }

.pdp__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}
@media (max-width: 991px) {
    .pdp__grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ────────────────────────────────────────────────────────────────────────────
 * 3) Gallery
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__gallery { position: sticky; top: 24px; }
@media (max-width: 991px) { .pdp__gallery { position: static; } }

.pdp__gallery-main {
    aspect-ratio: 1;
    background: var(--pdp-surface);
    border-radius: var(--pdp-r-lg);
    overflow: hidden; position: relative;
    cursor: zoom-in;
    border: 1px solid var(--pdp-border);
}
.pdp__gallery-main img {
    width: 100%; height: 100%; object-fit: contain;
    transition: transform 0.4s ease;
}
.pdp__gallery-main:hover img { transform: scale(1.04); }

.pdp__gallery-zoom {
    position: absolute; top: 14px; right: 14px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.92); color: var(--pdp-text);
    display: grid; place-items: center;
    box-shadow: var(--pdp-shadow);
    opacity: 0; transition: opacity 0.2s;
    border: none; cursor: pointer;
    backdrop-filter: blur(8px);
}
.pdp__gallery-main:hover .pdp__gallery-zoom { opacity: 1; }

.pdp__thumbs {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 10px; margin-top: 12px;
}
.pdp__thumb {
    aspect-ratio: 1;
    background: var(--pdp-surface);
    border-radius: var(--pdp-r-sm);
    border: 2px solid transparent;
    overflow: hidden; cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}
.pdp__thumb:hover { transform: translateY(-2px); }
.pdp__thumb.is-active { border-color: var(--pdp-text); }
.pdp__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ────────────────────────────────────────────────────────────────────────────
 * 4) Info column
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__info { display: flex; flex-direction: column; gap: 24px; }

.pdp__type-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    width: fit-content;
}
.pdp__type-pill--digital      { background: rgba(37,99,235,0.10);  color: var(--pdp-info); }
.pdp__type-pill--dropshipping { background: rgba(234,88,12,0.10);  color: var(--pdp-warning); }
.pdp__type-pill--physical     { background: rgba(22,163,74,0.10);  color: var(--pdp-accent); }

.pdp__title {
    font-size: 28px; font-weight: 700; line-height: 1.2;
    color: var(--pdp-text); margin: 0;
}
@media (min-width: 768px) { .pdp__title { font-size: 32px; } }

.pdp__short-desc {
    color: var(--pdp-text-muted); font-size: 15px; line-height: 1.6; margin: 0;
}

/* Price */
.pdp__price-row {
    display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
    padding: 20px 0;
    border-top: 1px solid var(--pdp-border);
    border-bottom: 1px solid var(--pdp-border);
}
.pdp__price         { font-size: 32px; font-weight: 700; color: var(--pdp-text); line-height: 1; }
.pdp__price-compare { font-size: 18px; color: var(--pdp-text-light); text-decoration: line-through; }
.pdp__price-discount {
    background: var(--pdp-danger); color: #fff;
    padding: 4px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 700;
}

/* Availability */
.pdp__availability {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 500;
}
.pdp__availability-dot { width: 8px; height: 8px; border-radius: 50%; }
.pdp__availability--in {
    color: var(--pdp-accent);
}
.pdp__availability--in .pdp__availability-dot {
    background: var(--pdp-accent);
    box-shadow: 0 0 0 4px rgba(22,163,74,0.15);
}
.pdp__availability--low {
    color: var(--pdp-warning);
}
.pdp__availability--low .pdp__availability-dot {
    background: var(--pdp-warning);
    box-shadow: 0 0 0 4px rgba(234,88,12,0.15);
}
.pdp__availability--out {
    color: var(--pdp-danger);
}
.pdp__availability--out .pdp__availability-dot {
    background: var(--pdp-danger);
    box-shadow: 0 0 0 4px rgba(220,38,38,0.15);
}
.pdp__availability-meta {
    color: var(--pdp-text-muted); font-weight: 400; font-size: 13px;
}

/* ────────────────────────────────────────────────────────────────────────────
 * 5) Variants — chips & swatches
 *
 * The native radio is HIDDEN BUT FUNCTIONAL via:
 *   - appearance: none (kills the OS dot/circle)
 *   - position: absolute, w/h: 1px, opacity: 0
 *   - pointer-events: none + the <label> proxies clicks
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__variant { display: flex; flex-direction: column; gap: 10px; }
.pdp__variant-label {
    display: flex; align-items: baseline; gap: 8px;
    font-size: 13px; font-weight: 600; color: var(--pdp-text);
}
.pdp__variant-label-value {
    color: var(--pdp-text-muted); font-weight: 400;
}
.pdp__variant-options { display: flex; flex-wrap: wrap; gap: 8px; }

/* Hide native radio everywhere inside a pdp variant */
.pdp__chip input[type="radio"],
.pdp__swatch input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
    margin: 0; padding: 0; border: 0;
    /* Keep it focusable for keyboard nav, but invisible */
    clip: rect(0 0 0 0);
    overflow: hidden;
}

/* Chip (size, generic option) */
.pdp__chip {
    position: relative;
    display: inline-block;
}
.pdp__chip-label {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; padding: 6px 12px;
    border: 1.5px solid var(--pdp-border-2);
    border-radius: var(--pdp-r-sm);
    background: var(--pdp-bg);
    color: var(--pdp-text);
    font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
    margin: 0;
}
.pdp__chip:hover .pdp__chip-label { border-color: var(--pdp-text); }
.pdp__chip input[type="radio"]:checked ~ .pdp__chip-label {
    border-color: var(--pdp-text);
    background: var(--pdp-text);
    color: var(--pdp-bg);
}
.pdp__chip input[type="radio"]:disabled ~ .pdp__chip-label {
    opacity: 0.4; cursor: not-allowed; text-decoration: line-through;
}
.pdp__chip input[type="radio"]:focus-visible ~ .pdp__chip-label {
    box-shadow: 0 0 0 3px rgba(37,99,235,0.35);
}

/* Color swatch */
.pdp__swatch {
    position: relative;
    display: inline-block;
}
.pdp__swatch-label {
    display: block;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--pdp-bg);
    outline: 1.5px solid var(--pdp-border-2);
    cursor: pointer;
    transition: outline-color 0.15s, transform 0.15s;
    margin: 2px;
}
.pdp__swatch:hover .pdp__swatch-label { transform: scale(1.1); }
.pdp__swatch input[type="radio"]:checked ~ .pdp__swatch-label {
    outline-color: var(--pdp-text);
    outline-width: 2px;
}
.pdp__swatch input[type="radio"]:disabled ~ .pdp__swatch-label {
    opacity: 0.35; cursor: not-allowed;
}
.pdp__swatch input[type="radio"]:focus-visible ~ .pdp__swatch-label {
    outline: 3px solid rgba(37,99,235,0.55);
    outline-offset: 1px;
}

/* ────────────────────────────────────────────────────────────────────────────
 * 6) Action row — qty + cart button
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__action { display: flex; gap: 12px; align-items: stretch; }
.pdp__action--disabled .pdp__qty { opacity: 0.5; pointer-events: none; }

.pdp__qty {
    display: flex; align-items: center;
    border: 1.5px solid var(--pdp-border-2);
    border-radius: var(--pdp-r-sm);
    overflow: hidden; background: var(--pdp-bg);
}
.pdp__qty-btn {
    width: 38px; height: 44px;
    border: none; background: transparent;
    color: var(--pdp-text);
    font-size: 18px; font-weight: 500;
    cursor: pointer; transition: background 0.15s;
    display: grid; place-items: center;
    flex-shrink: 0;
    user-select: none;
    /* ZID HADI: */
    position: relative;
    z-index: 2;
}
.pdp__qty-btn:hover:not(:disabled) { background: var(--pdp-surface); }

/* Force width — Symfony's form widget inherits width from baseStore CSS otherwise */
.pdp__qty input,
.pdp__qty input[type="number"],
.pdp__qty input[data-pdp-qty] {
    width: 50px !important; height: 44px !important;
    border: none !important; background: transparent !important;
    text-align: center !important;
    font-size: 16px !important; font-weight: 600 !important;
    color: var(--pdp-text) !important; outline: none !important;
    box-shadow: none !important;
    padding: 0 !important; margin: 0 !important;
    -moz-appearance: textfield;
    flex-shrink: 0;
}
.pdp__qty input::-webkit-outer-spin-button,
.pdp__qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pdp__min-qty-hint {
    font-size: 11px;
    color: var(--pdp-text-muted);
    margin-top: 4px;
    align-self: center;
}

.pdp__cta {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0 24px; height: 44px;
    background: var(--pdp-text); color: var(--pdp-bg);
    border: none; border-radius: var(--pdp-r-sm);
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: transform 0.15s, opacity 0.15s;
    text-decoration: none;
}
.pdp__cta:hover:not(:disabled) { transform: translateY(-1px); opacity: 0.92; color: var(--pdp-bg); }
.pdp__cta:disabled {
    opacity: 0.4; cursor: not-allowed;
    background: var(--pdp-text-muted);
}
.pdp__cta--inline {
    flex: none; padding: 0 24px;
}

/* ────────────────────────────────────────────────────────────────────────────
 * 7) Trust badges
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__trust {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    padding: 20px; background: var(--pdp-surface);
    border-radius: var(--pdp-r); border: 1px solid var(--pdp-border);
}
@media (max-width: 575px) { .pdp__trust { grid-template-columns: 1fr; } }
.pdp__trust-item { display: flex; gap: 12px; align-items: flex-start; }
.pdp__trust-item i {
    font-size: 22px; color: var(--pdp-text);
    flex-shrink: 0; margin-top: 2px;
}
.pdp__trust-title  { font-size: 13px; font-weight: 600; color: var(--pdp-text); margin-bottom: 2px; }
.pdp__trust-sub    { font-size: 12px; color: var(--pdp-text-muted); line-height: 1.4; }

/* ────────────────────────────────────────────────────────────────────────────
 * 8) Tech sheet button
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__tech {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: var(--pdp-surface);
    border: 1px solid var(--pdp-border);
    border-radius: var(--pdp-r-sm);
    color: var(--pdp-text); text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: border-color 0.15s, transform 0.15s;
    width: fit-content;
}
.pdp__tech:hover {
    border-color: var(--pdp-text); transform: translateY(-1px);
    color: var(--pdp-text); text-decoration: none;
}
.pdp__tech i { font-size: 20px; color: var(--pdp-danger); }

/* ────────────────────────────────────────────────────────────────────────────
 * 9) Tags
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__tags {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    font-size: 13px; color: var(--pdp-text-muted);
}
.pdp__tags-label { font-weight: 500; margin-right: 4px; }
.pdp__tag {
    display: inline-block; padding: 3px 10px;
    border-radius: 999px; background: var(--pdp-surface);
    color: var(--pdp-text-muted); text-decoration: none;
    font-size: 12px; transition: background 0.15s, color 0.15s;
}
.pdp__tag:hover { background: var(--pdp-text); color: var(--pdp-bg); text-decoration: none; }

/* ────────────────────────────────────────────────────────────────────────────
 * 10) Tabs (Description / Video)
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__tabs {
    margin-top: 64px;
    border-top: 1px solid var(--pdp-border);
    padding-top: 32px;
}
.pdp__tabs-nav {
    display: flex; gap: 4px;
    border-bottom: 1px solid var(--pdp-border);
    margin-bottom: 24px; flex-wrap: wrap;
}
.pdp__tabs-btn {
    background: transparent; border: none;
    padding: 12px 20px;
    font-size: 14px; font-weight: 500; color: var(--pdp-text-muted);
    cursor: pointer; transition: color 0.15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: inline-flex; align-items: center; gap: 6px;
}
.pdp__tabs-btn:hover { color: var(--pdp-text); }
.pdp__tabs-btn.is-active {
    color: var(--pdp-text);
    border-bottom-color: var(--pdp-text);
}
.pdp__tab-panel { display: none; line-height: 1.7; color: var(--pdp-text-muted); }
.pdp__tab-panel.is-active { display: block; }
.pdp__tab-panel h1, .pdp__tab-panel h2, .pdp__tab-panel h3 { color: var(--pdp-text); }
.pdp__tab-panel a { color: var(--pdp-info); }

/* ────────────────────────────────────────────────────────────────────────────
 * 11) Video embed
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__video {
    max-width: 720px; margin: 0 auto;
    position: relative; padding-top: 56.25%;
    background: #000; border-radius: var(--pdp-r);
    overflow: hidden;
}
.pdp__video iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%; border: 0;
}
.pdp__video-fallback {
    text-align: center; padding: 24px;
}

/* ────────────────────────────────────────────────────────────────────────────
 * 12) Lightbox
 * ────────────────────────────────────────────────────────────────────────── */
.pdp__lightbox {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(15,23,42,0.92);
    display: none; align-items: center; justify-content: center;
    padding: 40px; cursor: zoom-out;
}
.pdp__lightbox.is-open { display: flex; }
.pdp__lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pdp__lightbox-close {
    position: absolute; top: 20px; right: 20px;
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.1); color: #fff;
    border: none; border-radius: 50%;
    font-size: 20px; cursor: pointer;
    display: grid; place-items: center;
}