/* ==========================================================================
   Storefront default — mobile-native UX (cards, pricing, PDP, reduced motion)
   ========================================================================== */

/* ---------- Native price row (_price storefront_native) ----------
 * Hierarchy:
 *   - Primary (payment) currency: BIG + bold (.sf-price-native-current)
 *   - Old/strike price: small, muted, on the same line
 *   - Secondary reference currency: small, muted, dedicated line below with breathing room
 *   - Savings / dealer badge: green accent below
 */
.sf-price-storefront-native {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sf-price-storefront-native .sf-price-native-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    line-height: 1.1;
}

.sf-price-native-current {
    font-weight: 800;
    color: #0f172a;
    font-size: 1.32em;
    letter-spacing: -0.01em;
    line-height: 1;
}

.sf-price-native-old {
    font-size: 0.78em;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: line-through;
    line-height: 1;
}

.sf-price-native-ref {
    margin-top: 6px;
    font-size: 0.72em;
    font-weight: 600;
    color: #64748b;
    line-height: 1.1;
    letter-spacing: 0;
}

.sf-price-native-kazanc {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #15803d;
    line-height: 1.1;
}

.sf-price-native-dealer {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #15803d;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.1;
}

@media (min-width: 768px) {
    .sf-price-native-current {
        font-size: 1.4em;
    }
}

/* ---------- Centered alignment (PDP price card) ---------- */
.sf-price-storefront-native--center {
    align-items: center;
    text-align: center;
}

.sf-price-storefront-native--center .sf-price-native-line {
    justify-content: center;
}

/* ---------- LG size (Product Detail price card) ----------
 * Hero treatment: payment currency dominates, secondary is much smaller,
 * sizes scale fluidly so they always fit the card width / viewport.
 */
.sf-price-wrap.sf-price-lg.sf-price-storefront-native {
    width: 100%;
    max-width: 100%;
    gap: 6px;
}

.sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-line {
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: inherit;
    gap: 6px 14px;
    max-width: 100%;
}

.sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-current {
    /* PDP main (payment-currency) price — hero treatment, dominant on the card */
    font-size: clamp(38px, 9vw, 60px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-old {
    /* Strike-through old price scales proportionally with the hero current price */
    font-size: clamp(17px, 3.4vw, 22px);
    line-height: 1;
}

.sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-ref {
    /* Secondary (reference) currency: visibly larger so it reads as a real price,
       still smaller than the hero so the hierarchy stays clear. */
    margin-top: 6px;
    font-size: clamp(16px, 3vw, 22px);
    font-weight: 700;
    color: #475569;
}

.sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-kazanc,
.sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-dealer {
    margin-top: 10px;
    font-size: clamp(13px, 2.2vw, 16px);
}

/* On wider screens we get a touch more headroom */
@media (min-width: 768px) {
    /* Desktop: PDP fiyatları okunaklı ama ekrana hâkim olmasın diye sınırlı.
       Mobil clamp değerleri korunur; sadece masaüstünde küçülür. */
    .sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-current {
        font-size: clamp(28px, 2.4vw, 38px);
    }

    .sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-old {
        font-size: clamp(14px, 1.1vw, 17px);
    }

    .sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-ref {
        font-size: clamp(13px, 1vw, 16px);
    }

    .sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-kazanc,
    .sf-price-wrap.sf-price-lg.sf-price-storefront-native .sf-price-native-dealer {
        font-size: clamp(12px, 1vw, 14px);
    }
}

/* ---------- Store cards (grid + sliders) ---------- */
.sf-store-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.sf-store-card-media {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

/*
 * Image area: defer to admin's `--sf-product-card-ratio` and `--sf-product-card-fit`
 * (declared in _head.blade.php) so all cards (slider, grid, PDP thumb) stay
 * visually consistent. We avoid forcing a hardcoded ratio here.
 * Background is always white so 'contain' fits don't leak the page color.
 */
.sf-store-thumb-inner {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    inset: auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.sf-store-thumb-inner img {
    width: 100%;
    height: 100%;
    object-fit: var(--sf-product-card-fit, cover);
    object-position: center center;
    display: block;
    padding: 0;
    border-radius: 12px;
    background: #fff;
}

.sf-store-disc-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    background: rgb(239, 68, 68, 0.95);
    color: #fff;
    border: 1px solid rgb(255, 255, 255, 0.35);
    pointer-events: none;
}

/* İşçilik mini rozeti — ürün kartında, sağ üstte (wishlist'in yanında değil; üstünde olmasın diye sol üstte tut). */
.sf-store-labor-pill {
    position: absolute;
    top: 8px;
    left: 8px;
    transform: translateY(28px);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    background: rgb(2, 6, 23, 0.85);
    color: #fff;
    border: 1px solid rgb(148, 163, 184, 0.35);
    pointer-events: none;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sf-store-labor-pill i { font-size: 11px; color: #fbbf24; }

.sf-store-wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgb(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgb(15, 23, 42, 0.12);
}

.sf-store-wishlist-btn i {
    font-size: 14px;
    line-height: 1;
}

/*
 * Card media containers should respect the admin-configured ratio variable.
 * We still flatten internal padding so the discount pill / heart icon sit
 * cleanly at the corners and the image fills its declared box.
 */
.sf-store-card .sf-pblock-thumb,
.sf-store-card .sf-featured-thumb,
.sf-store-card .electro-img-box {
    padding: 0 !important;
    min-height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #fff !important;
}

.sf-store-card .sf-pblock-thumb img,
.sf-store-card .sf-featured-thumb img,
.sf-store-card .electro-img-box img {
    padding: 0 !important;
    background: #fff !important;
    object-position: center center;
}

.sf-store-card.sf-featured-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.sf-store-card .sf-pblock-off {
    display: none;
}

.sf-store-card .sf-pblock-actions {
    position: static !important;
    width: 100% !important;
    right: auto !important;
    bottom: auto !important;
    opacity: 1 !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    margin-top: auto;
    padding-top: 8px;
}

/* Bu blok media query DIŞINDAydı: dosya adı "mobile-native" olmasına rağmen
   5 adet !important ile MASAÜSTÜNÜ de yönetiyordu (temanın kendi 10-12px
   değerlerini ezip 16px dayatıyordu). Hemen altındaki kural zaten mobile'a
   sarılmış; bu bloğun sarılması unutulmuş. Artık yalnızca mobilde geçerli. */
@media (max-width: 767.98px) {
    .sf-store-card .sf-pblock-actions .sf-add,
    .sf-store-card .sf-pblock-actions .sf-secondary {
        width: 100% !important;
        min-height: 33px !important;
        border-radius: 10px !important;
        font-size: 16px !important;
        font-weight: 800 !important;
    }
}

@media (max-width: 767.98px) {
    .sf-store-card .sf-pblock-actions .sf-add i {
        margin-right: 6px;
    }
}

/* Edge-to-edge grids on small phones */
@media (max-width: 480px) {
    .sf-store-edge .sf-pblock-wrap,
    .sf-store-edge .sf-featured-wrap {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

.sf-grid.sf-store-two-col {
    gap: 8px !important;
}

@media (max-width: 480px) {
    .sf-grid.sf-store-two-col {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
}

@media (min-width: 481px) and (max-width: 1023.98px) {
    .sf-pblock-grid.sf-store-two-col,
    .sf-grid.sf-store-two-col {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1024px) {
    .sf-pblock-grid.sf-store-two-col {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .sf-grid.sf-store-two-col {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

/*
 * Featured (Vitrin) slider on phones:
 * Native single-product horizontal swipe with mandatory snap.
 * One product per viewport; small peek-less feel for a clean store-app vibe.
 */
@media (max-width: 768px) {
    .sf-featured-section .sf-featured-wrap {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .sf-featured-section .sf-featured-track,
    .sf-featured-section .sf-featured-track.sf-store-two-col {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 12px !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        scroll-snap-stop: always !important;

        /* Match the per-card horizontal margin so each card snaps cleanly to
           the viewport edge while still showing its red border. */
        scroll-padding-inline: 12px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 6px 12px 10px !important;
    }

    .sf-featured-section .sf-featured-track::-webkit-scrollbar {
        display: none;
    }

    /* Mobile-only: each Showcase Products slider card gets a thick red
       rounded border so the slider reads as a featured/promotional rail. */
    .sf-featured-section .sf-featured-track .sf-featured-card,
    .sf-featured-section .sf-featured-track.sf-store-two-col .sf-featured-card {
        flex: 0 0 calc(100% - 24px) !important;
        min-width: calc(100% - 24px) !important;
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
        scroll-snap-align: start !important;
        margin: 0 !important;
        border: 3px solid #dc2626 !important;
        border-radius: 18px !important;
        box-shadow: 0 8px 22px rgb(220, 38, 38, 0.16) !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        background: #fff !important;
    }

    .sf-featured-section .sf-featured-arrow {
        display: none !important;
    }
}

/*
 * Mobile featured slider — typography upgrade.
 * Since each card now occupies the full viewport width on mobile, all card
 * texts (name, SKU, stars, rating, prices) get a noticeably larger, more
 * legible scale. The primary (payment-currency) price is rendered red to
 * highlight the offer on phones (Vitrin Ürünleri ana fiyat kırmızı).
 */
@media (max-width: 768px) {
    .sf-featured-section .sf-featured-card .sf-pblock-name {
        font-size: 17px;
        line-height: 1.3;
        font-weight: 800;
        min-height: 0;
    }

    .sf-featured-section .sf-featured-card .sf-pblock-meta {
        font-size: 13px;
    }

    .sf-featured-section .sf-featured-card .sf-pblock-rate {
        font-size: 15px;
        gap: 8px;
    }

    .sf-featured-section .sf-featured-card .sf-pblock-rate-stars {
        font-size: 17px;
        letter-spacing: 0;
    }

    .sf-featured-section .sf-featured-card .sf-pblock-vat {
        font-size: 13px;
    }

    .sf-featured-section .sf-featured-card .sf-pblock-chip {
        font-size: 12px;
    }

    .sf-featured-section .sf-featured-card .sf-pblock-price-row {
        margin-top: 8px;
    }

    /* Native price hierarchy inside featured cards (mobile only) */
    .sf-featured-section .sf-featured-card .sf-price-storefront-native {
        gap: 6px;
    }

    .sf-featured-section .sf-featured-card .sf-price-native-line {
        gap: 6px 12px;
    }

    .sf-featured-section .sf-featured-card .sf-price-native-current {
        color: #dc2626;
        font-size: clamp(26px, 7vw, 34px);
        font-weight: 900;
        letter-spacing: -0.02em;
        line-height: 1;
    }

    .sf-featured-section .sf-featured-card .sf-price-native-old {
        font-size: clamp(13px, 3.4vw, 16px);
        line-height: 1;
    }

    .sf-featured-section .sf-featured-card .sf-price-native-ref {
        font-size: clamp(12px, 3vw, 14px);
        margin-top: 4px;
    }

    .sf-featured-section .sf-featured-card .sf-price-native-kazanc,
    .sf-featured-section .sf-featured-card .sf-price-native-dealer {
        font-size: 14px;
        margin-top: 6px;
    }

    .sf-featured-section .sf-featured-card .sf-pblock-old {
        font-size: 16px;
    }

    .sf-featured-section .sf-featured-card .sf-pblock-actions .sf-add,
    .sf-featured-section .sf-featured-card .sf-pblock-actions .sf-secondary {
        min-height: 48px !important;
        font-size: 15px !important;
    }
}

/* Native single-product peek dots for the featured slider on phones */
.sf-featured-section .sf-featured-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.sf-featured-section .sf-featured-dots .sf-featured-dot {
    width: 6px;
    height: 6px;
    border: 0;
    border-radius: 50%;
    background: #cbd5e1;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.sf-featured-section .sf-featured-dots .sf-featured-dot.is-active {
    background: #0f172a;
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .sf-featured-section .sf-featured-dots {
        display: flex;
    }
}

/* ---------- Product detail: gallery snap + dots ---------- */
.sf-pd-gallery-mobile {
    position: relative;
}

/*
 * Gallery scroller: aspect-ratio comes from --sf-product-card-ratio (admin) via
 * the @media-free rule in _head.blade.php. We only handle scroll behavior here.
 */
.sf-pd-gallery-scroller {
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 12px;
    background: #f8fafc;
    width: 100%;
}

.sf-pd-gallery-scroller::-webkit-scrollbar {
    display: none;
}

.sf-pd-gallery-slide {
    flex: 0 0 100%;
    min-width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: 100%;
    display: block;
}

.sf-pd-gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.sf-pd-gallery-dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: #cbd5e1;
    cursor: pointer;
}

.sf-pd-gallery-dot::before {
    content: "";
    position: absolute;
    inset: -8px;
}

.sf-pd-gallery-dot.active {
    background: #0f172a;
    transform: scale(1.15);
}

@media (min-width: 768px) {
    .sf-pd-gallery-dots {
        display: none;
    }
}

.sf-pd-gallery-nav.sf-pd-gallery-nav--desktop {
    display: none;
}

@media (min-width: 768px) {
    .sf-pd-gallery-nav.sf-pd-gallery-nav--desktop {
        display: inline-flex;
        z-index: 6;
    }
}

@media (max-width: 991.98px) {
    .sf-pd-add:active:not([disabled]),
    .sf-pd-buy-now:active {
        transform: scale(0.98);
    }
}

/* Mobile header back */
.sf-pd-mobile-head {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sf-pd-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 2px 8px rgb(15, 23, 42, 0.08);
}

.sf-pd-back-btn i {
    font-size: 18px;
}

@media (max-width: 991.98px) {
    .sf-pd-mobile-head {
        display: flex;
    }
}

@media (display-mode: standalone) {
    .sf-pd-mobile-head {
        padding-top: env(safe-area-inset-top, 0);
    }
}

/* Underlined tabs (mobile) */
@media (max-width: 991.98px) {
    .sf-pd-tab-head.underlined-mobile-tab {
        position: sticky;
        top: 0;
        z-index: 20;
        background: rgb(255, 255, 255, 0.92);
        backdrop-filter: blur(8px);
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid #e5e7eb !important;
        padding: 0 !important;
        gap: 0 !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sf-pd-tab-head.underlined-mobile-tab .sf-pd-tab-btn {
        flex: 1 1 auto;
        border-radius: 0 !important;
        background: transparent !important;
        border-bottom: 3px solid transparent !important;
        box-shadow: none !important;
        padding: 12px 10px !important;
    }

    .sf-pd-tab-head.underlined-mobile-tab .sf-pd-tab-btn.active {
        border-bottom-color: #0f172a !important;
        color: #0f172a !important;
        background: transparent !important;
    }
}

/* Sticky buy bar */
.sf-pd-stickbuy {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgb(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e5e7eb;
    gap: 8px;
    flex-direction: column;
    box-shadow: 0 -8px 24px rgb(15, 23, 42, 0.08);
}

@media (max-width: 991.98px) {
    body.sf-pd-has-stickbuy.sf-mobile-dock-on {
        padding-top: calc(56px + env(safe-area-inset-top, 0px)) !important;
    }

    body.sf-pd-has-stickbuy.sf-mobile-dock-on .sf-shell {
        padding-top: 0 !important;
    }

    body.sf-pd-has-stickbuy .sf-pd-wrap {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .sf-pd-stickbuy {
        display: flex;
    }

    .sf-pd-buy-col--main {
        display: none !important;
    }

    body.sf-pd-has-stickbuy {
        padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
    }
}

.sf-pd-stickbuy .sf-pd-add,
.sf-pd-stickbuy .sf-pd-buy-now {
    width: 100%;
    min-height: 48px;
    justify-content: center;
}

.sf-pd-stickbuy .sf-pd-add:active:not([disabled]),
.sf-pd-stickbuy .sf-pd-buy-now:active {
    transform: scale(0.98);
}

/* Description accordion */
.sf-desc-acc {
    position: relative;
}

.sf-desc-acc-inner {
    max-height: 140px;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.sf-desc-acc-inner.is-expanded {
    max-height: none;
}

.sf-desc-acc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 11px 24px;
    border: 2px solid #2563eb;
    border-radius: 10px;
    background: #fff;
    color: #2563eb;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background .18s, color .18s;
    letter-spacing: .01em;
}

.sf-desc-acc-toggle:hover {
    background: #2563eb;
    color: #fff;
}

.sf-desc-acc:not(.is-collapsible) .sf-desc-acc-toggle {
    display: none;
}

/* 1000 karakter altında içeriği klipleme — tamamını göster */
.sf-desc-acc:not(.is-collapsible) .sf-desc-acc-inner {
    max-height: none;
    overflow: visible;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sf-pd-gallery-scroller {
        scroll-behavior: auto;
    }

    .sf-desc-acc-inner {
        transition: none;
    }

    .sf-fly-clone {
        animation: none !important;
        opacity: 0 !important;
    }
}
