/* Hafi Max product detail — mirrors resources/views/livewire/site/product-detail.blade.php.
   Uses the exact Laravel `.section-pad` + `.content-shell` math so the inner
   page width matches the storefront on every breakpoint:
     default     → width: min(80vw, 1600px)
     ≤1199.98px  → width: 92%
     ≤767.98px   → width: calc(100% - 24px)
   No horizontal padding on the wrapper itself. */
.pd-shell { width: 100%; padding: 56px 0 64px; }
.pd-shell > .pd-wrap,
.pd-shell > .pd-section {
    width: min(80vw, 1600px);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
}
@media (max-width: 1199.98px) {
    .pd-shell > .pd-wrap,
    .pd-shell > .pd-section { width: 92%; }
}
@media (max-width: 767.98px) {
    .pd-shell { padding: 36px 0 48px; }
    .pd-shell > .pd-wrap,
    .pd-shell > .pd-section { width: calc(100% - 24px); }
}

.pd-wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 36px; align-items: start; }
@media (max-width: 991.98px) { .pd-wrap { grid-template-columns: 1fr; gap: 24px; } }

.pd-gallery { display: flex; gap: 14px; }
.pd-thumbs { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.pd-thumbs::-webkit-scrollbar { width: 4px; }
.pd-thumbs::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 4px; }
.pd-thumb {
    width: 76px; height: 76px; border-radius: 10px; overflow: hidden;
    border: 2px solid transparent; cursor: pointer; flex-shrink: 0;
    background: #f6f3ee; padding: 0; transition: border-color .18s, transform .18s;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-thumb:hover { border-color: #0f7cc7; transform: translateY(-2px); }
.pd-thumb.active { border-color: #111; }

.pd-main {
    flex: 1; position: relative;
    border-radius: 14px; overflow: hidden;
    background: #f6f3ee;
    aspect-ratio: 1 / 1; max-height: 520px;
    box-shadow: 0 4px 22px rgba(0,0,0,.06);
    cursor: zoom-in;
}
.pd-main img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.pd-main.zooming { cursor: zoom-out; }
.pd-main.zooming img { transform: scale(2); transform-origin: var(--zx, 50%) var(--zy, 50%); }

.pd-card { background: #fff; border-radius: 14px; padding: 26px; box-shadow: 0 4px 22px rgba(0,0,0,.05); border: 1px solid #f0f0f0; }
.pd-card h1 { font-size: 28px; font-weight: 700; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; color: #111; }
.pd-cat { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: #888; margin-bottom: 6px; font-weight: 500; }

.pd-rating-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pd-rating-row .pd-stars { color: #f5b301; letter-spacing: 1px; font-size: 14px; }
.pd-rating-row .pd-stars .muted-star { color: #d8d3cc; }
.pd-rating-row .pd-rating-count { font-size: 12px; color: #888; }

.pd-price-row { display:flex; align-items:baseline; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.pd-price, .pd-price .amount, .pd-price ins .amount, .pd-price ins, .pd-price-row .price { font-size: 26px !important; font-weight: 700 !important; color: #111 !important; text-decoration: none !important; line-height: 1.1; }
.pd-price del, .pd-price del .amount, .pd-price-row del { font-size: 16px !important; text-decoration: line-through !important; color: #aaa !important; font-weight: 400 !important; }
.pd-price-row .price { display: flex; align-items: baseline; gap: 12px; margin: 0; }
.pd-short { color: #555; line-height: 1.55; margin-bottom: 18px; font-size: 14px; }

.pd-attr-group { margin-bottom: 14px; }
.pd-attr-group .pd-attr-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #777; margin-bottom: 8px; }
.pd-attr-options { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.pd-stock-line { font-size: 13px; margin: 6px 0 14px; display: flex; align-items: center; gap: 6px; }
.pd-stock-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pd-stock-dot.in { background: #15803d; }
.pd-stock-dot.out { background: #b91c1c; }
.pd-stock-line.in { color: #15803d; }
.pd-stock-line.out { color: #b91c1c; }

.pd-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.pd-qty { display: inline-flex; align-items: stretch; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; height: 40px; background: #fff; }
/* Flatten WC's <div class="quantity"> wrapper so the input sits flush in the flex row. */
.pd-qty .quantity { display: contents; margin: 0; padding: 0; }
.pd-qty button { width: 36px; height: 100%; background: #fff; border: 0; font-size: 16px; color: #333; transition: background .15s; cursor: pointer; padding: 0; }
.pd-qty button:hover { background: #f5f5f5; }
.pd-qty input { width: 50px; height: 100%; border: 0; text-align: center; font-weight: 600; font-size: 14px; padding: 0; outline: none; background: #fff; -moz-appearance: textfield; }
.pd-qty input::-webkit-outer-spin-button, .pd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pd-qty .screen-reader-text { display: none; }

.pd-cart-btn {
    flex: 1; min-width: 160px;
    height: 40px; padding: 0 18px;
    background: #111; color: #fff; border: 0; border-radius: 8px;
    font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    cursor: pointer; transition: background .15s, transform .15s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none;
}
.pd-cart-btn:hover { background: #2d2d2d; transform: translateY(-1px); color: #fff; }
.pd-cart-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.pd-cart-btn .pd-icon { font-size: 14px; }
.pd-wish-btn { width: 40px; height: 40px; border: 1px solid #ddd; background: #fff; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; transition: border-color .15s, color .15s, background-color .15s, transform .1s; cursor: pointer; color: #333; text-decoration: none; font-size: 16px; padding: 0; }
.pd-wish-btn:hover { border-color: #111; color: #b91c1c; }
.pd-wish-btn:active { transform: scale(.92); }
.pd-wish-btn.is-saved { color: #b91c1c; border-color: #b91c1c; background: #fff5f5; }
.pd-wish-btn.is-saved:hover { background: #ffe7e7; }

/* Floating toast feedback after wishlist toggle */
.hafimax-wish-toast {
    position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 12px);
    background: #111; color: #fff; padding: 10px 18px; border-radius: 999px;
    font-size: 13px; font-weight: 500; letter-spacing: .01em;
    box-shadow: 0 12px 28px -10px rgba(0,0,0,.55);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 9999;
}
.hafimax-wish-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.pd-perks { list-style: none; padding: 14px 0 0; margin: 0; border-top: 1px solid #f0f0f0; display: grid; gap: 8px; font-size: 13px; color: #666; }
.pd-perks li { display: flex; align-items: center; gap: 8px; }
.pd-perks .pd-icon { color: #0f7cc7; font-size: 14px; width: 18px; display: inline-flex; justify-content: center; }
.pd-perks .pd-perk-strong { color: #111; font-weight: 500; }

.pd-section { margin-top: 48px; }
.pd-section h2 { font-size: 22px; font-weight: 700; margin: 0 0 14px; color: #111; }
.pd-prose { color: #555; line-height: 1.7; font-size: 14px; }
.pd-prose p { margin: 0 0 1em; }

/* Variation form (variable products) — pill-style attribute pickers */
.pd-card form.variations_form { margin: 0; }
.pd-card form.variations_form .variations { width: 100%; border: 0; margin: 0 0 6px; }
.pd-card form.variations_form .variations tbody { display: block; }
.pd-card form.variations_form .variations tr { display: block; margin-bottom: 16px; }
.pd-card form.variations_form .variations th,
.pd-card form.variations_form .variations td { display: block; padding: 0; text-align: left; border: 0; }
.pd-card form.variations_form .variations th label,
.pd-card form.variations_form .variations th { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #777; margin-bottom: 8px; display: block; }

/* Hide the native select once we render the buttons. */
.pd-card form.variations_form .variations select.pd-hidden-select {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
/* Fallback styling if JS is disabled */
.pd-card form.variations_form .variations select { height: 40px; border: 1px solid #ddd; border-radius: 8px; padding: 0 12px; min-width: 180px; background: #fff; font-size: 14px; }

.pd-attr-pill {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid #111; background: #fff; color: #111;
    padding: 6px 14px; min-height: 34px; min-width: 48px;
    font-size: 13px; font-weight: 500; line-height: 1;
    border-radius: 8px; cursor: pointer; user-select: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
    text-decoration: none;
}
.pd-attr-pill:hover { background: #1a1a1a; color: #fff; transform: translateY(-1px); }
.pd-attr-pill.active { background: #111; color: #fff; }
.pd-attr-pill.disabled,
.pd-attr-pill:disabled {
    opacity: .4; cursor: not-allowed; background: #fff; color: #999;
    border-color: #d8d8d8; transform: none;
}
.pd-attr-pill.disabled:hover,
.pd-attr-pill:disabled:hover { background: #fff; color: #999; transform: none; }

.pd-card form.variations_form .reset_variations {
    display: inline-block; font-size: 12px; color: #888;
    margin: 4px 0 8px; text-decoration: underline; visibility: hidden;
}
.pd-card form.variations_form .reset_variations:hover { color: #111; }

.pd-card form.variations_form .single_variation_wrap .woocommerce-variation-price { display: none; }
.pd-card form.variations_form .single_variation_wrap .woocommerce-variation-availability { display: none; }
/* Our override at woocommerce/single-product/add-to-cart/variation-add-to-cart-button.php
   wraps qty/cart/wishlist in .pd-actions > .pd-qty / .pd-cart-btn / .pd-wish-btn so the
   shared styling above already applies. We just need to neutralise the
   .woocommerce-variation-add-to-cart wrapper itself. */
.pd-card form.variations_form .woocommerce-variation-add-to-cart { margin-top: 8px; }
.pd-card form.variations_form .single_add_to_cart_button.disabled,
.pd-card form.variations_form .single_add_to_cart_button[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* Stock line shown for selected variation */
.pd-card form.variations_form .single_variation .woocommerce-variation-description { color: #555; font-size: 13px; line-height: 1.55; margin-bottom: 8px; }
.pd-card form.variations_form .stock { font-size: 13px; margin: 6px 0 8px; }
.pd-card form.variations_form .stock.in-stock { color: #15803d; }
.pd-card form.variations_form .stock.out-of-stock { color: #b91c1c; }

/* Related products */
.pd-related-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 991.98px) { .pd-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .pd-related-grid { grid-template-columns: 1fr; } }
.pd-related-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.04); border: 1px solid #f0f0f0; transition: transform .15s, box-shadow .15s; }
.pd-related-card:hover { transform: translateY(-3px); box-shadow: 0 6px 22px rgba(0,0,0,.08); }
.pd-related-card a { color: inherit; text-decoration: none; }
.pd-related-img { aspect-ratio: 1 / 1; background: #f6f3ee; overflow: hidden; }
.pd-related-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-related-body { padding: 14px 14px 16px; }
.pd-related-name { font-size: 14px; font-weight: 600; color: #111; margin: 0 0 4px; line-height: 1.35; }
.pd-related-price { font-size: 14px; color: #111; font-weight: 700; }
.pd-related-price del { color: #aaa; font-weight: 400; margin-right: 6px; font-size: 12px; }

.pd-section-heading { text-align: center; margin: 0 0 24px; }
.pd-section-heading h2 { font-size: 24px; font-weight: 700; color: #111; }
