/* Storefront › marketplace-style product cards & category sliders */

/* ── Card ── */
.dz-card {
    position: relative; display: flex; flex-direction: column; width: 100%; height: 100%;
    background: #fff; border: 1px solid #eef0f3; border-radius: 10px; overflow: hidden;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.dz-card:hover { box-shadow: 0 8px 22px rgba(15, 23, 42, .13); transform: translateY(-2px); border-color: #e2e8f0; }
.dz-card__media { position: relative; display: block; aspect-ratio: 1 / 1; background: #f8fafc; }
.dz-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.dz-card:hover .dz-card__media img { transform: scale(1.05); }
.dz-card__sold { position: absolute; left: 8px; top: 8px; background: rgba(15, 23, 42, .78); color: #fff; font-size: .68rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; }
.dz-card.is-soldout .dz-card__media img { filter: grayscale(.8); opacity: .75; }

.dz-card__body { padding: .55rem .6rem .7rem; display: flex; flex-direction: column; gap: .22rem; text-align: left; min-width: 0; }
/* 1 — name */
.dz-card__name {
    color: #212121; font-size: .8rem; line-height: 1.35; text-decoration: none; font-weight: 500;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
}
.dz-card__name:hover { color: var(--shop-theme-primary, #f57224); }
/* 2 — offer price, old price small beside it */
.dz-card__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .4rem; line-height: 1.15; }
.dz-card__now { font-size: 1.08rem; font-weight: 800; color: var(--shop-theme-primary, #f57224); }
.dz-card__old { font-size: .7rem; color: #9e9e9e; font-weight: 500; }
.dz-card__off { font-size: .68rem; color: #212121; font-weight: 700; }
/* 3 — ★★★★★ */
.dz-card__stars { display: flex; align-items: center; gap: 1px; font-size: .62rem; color: #d6d9de; }
.dz-card__stars i.on { color: #ffb300; }
.dz-card__stars span { margin-left: .3rem; color: #9e9e9e; font-size: .68rem; }

/* hover tools (always visible on touch) */
.dz-card__tools { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; opacity: 0; transform: translateX(6px); transition: opacity .18s, transform .18s; }
.dz-card:hover .dz-card__tools, .dz-card:focus-within .dz-card__tools { opacity: 1; transform: none; }
@media (hover: none) { .dz-card__tools { opacity: 1; transform: none; } }
.dz-tool {
    width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; color: #334155; font-size: .82rem;
    display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(15, 23, 42, .22); cursor: pointer;
    transition: background .15s, color .15s;
}
.dz-tool:hover, .dz-tool--cart { background: var(--shop-theme-primary, #f57224); color: #fff; }
.dz-tool--cart:hover { filter: brightness(1.08); }
@media (max-width: 575.98px) { .dz-tool { width: 38px; height: 38px; } }

/* ── Category row ── */
.dz-row { background: #fff; border-radius: 12px; padding: .9rem 1rem 1rem; box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
.dz-row__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .7rem; }
.dz-row__title { margin: 0; font-size: 1.05rem; font-weight: 800; color: #212121; display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.dz-row__title a { color: inherit; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-row__title a:hover { color: var(--shop-theme-primary, #f57224); }
.dz-row__title small { font-size: .75rem; font-weight: 600; color: #9e9e9e; }
.dz-row__tools { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.dz-arrow {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid #e0e0e0; background: #fff; color: #424242;
    display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; cursor: pointer; transition: all .15s;
}
.dz-arrow:hover { background: var(--shop-theme-primary, #f57224); border-color: var(--shop-theme-primary, #f57224); color: #fff; }
.dz-shopall {
    display: inline-flex; align-items: center; min-height: 34px; padding: 0 .95rem; border: 1.5px solid var(--shop-theme-primary, #f57224);
    color: var(--shop-theme-primary, #f57224); border-radius: 4px; font-size: .78rem; font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: .02em;
}
.dz-shopall:hover { background: var(--shop-theme-primary, #f57224); color: #fff; }

/* ── Slider track: snap + swipe, 6-up desktop ── */
.dz-track {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; padding: 2px 2px 6px; cursor: grab; scrollbar-width: none;
}
.dz-track::-webkit-scrollbar { display: none; }
.dz-track .idea-slider-item, .dz-track .idea-product-slider-item {
    flex: 0 0 calc((100% - 50px) / 6) !important; min-width: 150px !important; max-width: none !important; scroll-snap-align: start;
}
@media (max-width: 1199.98px) { .dz-track .idea-slider-item, .dz-track .idea-product-slider-item { flex-basis: calc((100% - 30px) / 4) !important; } }
@media (max-width: 767.98px)  { .dz-track .idea-slider-item, .dz-track .idea-product-slider-item { flex-basis: calc((100% - 10px) / 2.35) !important; min-width: 140px !important; } .dz-row { padding: .75rem .65rem .85rem; } .dz-arrow { display: none; } }

/* grid view uses the same card */
#catalogProductsContainer .dz-card { height: 100%; }

/* list mode support */
#catalogProductsContainer.view-mode-list .dz-card { flex-direction: row; align-items: stretch; }
#catalogProductsContainer.view-mode-list .dz-card__media { width: 130px; flex: 0 0 130px; aspect-ratio: 1 / 1; }
#catalogProductsContainer.view-mode-list .dz-card__body { flex: 1; justify-content: center; }

body.dark-mode .dz-card, body.dark-mode .dz-row { background: #111827; border-color: #1f2937; }
body.dark-mode .dz-card__name, body.dark-mode .dz-row__title, body.dark-mode .dz-card__off { color: #f1f5f9; }
body.dark-mode .dz-arrow, body.dark-mode .dz-tool { background: #1e293b; color: #e2e8f0; border-color: #334155; }

/* ══════════ Clean shop page ══════════ */
.sf-page { background: #f6f7f9; min-height: 70vh; padding-bottom: 3rem; }
.sf-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.4rem; padding-bottom: 1rem; flex-wrap: wrap; }
.sf-head__title { display: flex; align-items: baseline; gap: .6rem; }
.sf-head__title h1 { margin: 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; color: #111827; }
.sf-head__title span { font-size: .9rem; font-weight: 700; color: #9ca3af; }
.sf-search { position: relative; flex: 1 1 320px; max-width: 520px; }
.sf-search input { width: 100%; height: 48px; padding: 0 3.2rem 0 1.15rem; border: 1.5px solid #e5e7eb; border-radius: 999px; background: #fff; font-size: 1rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.sf-search input:focus { border-color: var(--shop-theme-primary); box-shadow: 0 0 0 4px rgba(0, 0, 0, .05); }
.sf-search button { position: absolute; right: 5px; top: 5px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--shop-theme-primary); color: #fff; cursor: pointer; }

.sf-bar { position: sticky; top: 0; z-index: 900; background: rgba(246, 247, 249, .92); backdrop-filter: blur(8px); border-bottom: 1px solid #e5e7eb; }
.sf-bar__in { display: flex; align-items: center; gap: .75rem; padding-top: .6rem; padding-bottom: .6rem; }
.sf-cats { display: flex; gap: .4rem; overflow-x: auto; flex: 1 1 auto; min-width: 0; scrollbar-width: none; padding: 2px; }
.sf-cats::-webkit-scrollbar { display: none; }
.sf-cat { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: 0 1rem; border-radius: 999px; background: #fff; border: 1.5px solid #e5e7eb; color: #374151; font-weight: 600; font-size: .9rem; text-decoration: none; transition: all .15s; }
.sf-cat small { font-size: .72rem; color: #9ca3af; font-weight: 700; }
.sf-cat:hover { border-color: #9ca3af; color: #111827; }
.sf-cat.is-active { background: var(--shop-theme-primary); border-color: var(--shop-theme-primary); color: #fff; }
.sf-cat.is-active small { color: rgba(255, 255, 255, .8); }
.sf-tools { display: flex; gap: .5rem; flex: 0 0 auto; }
.sf-tools select, .sf-filter-btn { height: 40px; border: 1.5px solid #e5e7eb; border-radius: 12px; background: #fff; font-weight: 600; font-size: .9rem; padding: 0 .9rem; color: #374151; }
.sf-filter-btn { cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.sf-filter-btn b { background: var(--shop-theme-primary); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .45rem; }

.sf-main { padding-top: 1.1rem; display: flex; flex-direction: column; gap: 1rem; }
.sf-active { display: flex; flex-wrap: wrap; gap: .4rem; }
.sf-active a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 .8rem; background: #fff; border: 1.5px solid #e5e7eb; border-radius: 999px; font-size: .82rem; font-weight: 600; color: #374151; text-decoration: none; }
.sf-active a:hover { border-color: #dc2626; color: #dc2626; }
.sf-active .sf-active__clear { border-color: transparent; background: transparent; color: #dc2626; }

.sf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.sf-pager { display: flex; justify-content: center; margin-top: 1rem; }
.sf-empty { text-align: center; padding: 4rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; color: #6b7280; font-size: 1.1rem; }

/* Filters drawer */
.sf-drawer { width: min(380px, 92vw) !important; z-index: 2600 !important; }
.sf-drawer__body { display: flex; flex-direction: column; gap: 1.2rem; padding-bottom: 5.5rem; }
.sf-drawer fieldset { border: 0; padding: 0; margin: 0; }
.sf-drawer legend { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin-bottom: .5rem; float: none; width: auto; }
.sf-price { display: flex; align-items: center; gap: .5rem; }
.sf-price input { flex: 1; height: 46px; border: 1.5px solid #e5e7eb; border-radius: 12px; padding: 0 .8rem; font-size: 1rem; min-width: 0; }
.sf-brands { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.sf-check, .sf-switch { display: flex; align-items: center; gap: .65rem; min-height: 44px; margin: 0; cursor: pointer; font-weight: 600; color: #374151; }
.sf-check input, .sf-switch input { width: 20px; height: 20px; accent-color: var(--shop-theme-primary); flex: 0 0 auto; }
.sf-check small { margin-left: auto; color: #9ca3af; font-weight: 700; }
.sf-drawer__foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: .6rem; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #e5e7eb; }
.sf-drawer__foot .btn { flex: 1; min-height: 46px; font-weight: 700; border-radius: 12px; }

/* Quick view */
.qv { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.2rem; align-items: start; }
.qv__img { aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: #f3f4f6; }
.qv__img img { width: 100%; height: 100%; object-fit: cover; }
.qv__info h3 { font-size: 1.15rem; font-weight: 800; margin: 0 0 .5rem; }
.qv__info .dz-card__now { font-size: 1.5rem; }
.qv__act { display: flex; gap: .5rem; margin-top: 1rem; }
.qv__act .btn { flex: 1; min-height: 46px; font-weight: 700; border-radius: 12px; }
.qv .pr-specs { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: 2px; font-size: .82rem; }
.qv .pr-specs li { display: flex; justify-content: space-between; gap: .5rem; border-bottom: 1px dashed #e5e7eb; padding: 3px 0; }
.qv .pr-specs span { color: #6b7280; }

@media (max-width: 767.98px) {
    .sf-head { padding-top: 1rem; }
    .sf-head__title h1 { font-size: 1.4rem; }
    .sf-search { flex-basis: 100%; max-width: none; }
    .sf-bar__in { flex-wrap: wrap; row-gap: .5rem; }
    .sf-tools { width: 100%; }
    .sf-tools form { flex: 1; } .sf-tools select { width: 100%; } .sf-filter-btn { flex: 1; justify-content: center; }
    .sf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
    .qv { grid-template-columns: 1fr; }
}
@media (max-width: 380px) { .sf-grid { grid-template-columns: 1fr; } }
body.dark-mode .sf-page { background: #0b1220; }
body.dark-mode .sf-head__title h1 { color: #f1f5f9; }
body.dark-mode .sf-cat, body.dark-mode .sf-search input, body.dark-mode .sf-tools select, body.dark-mode .sf-filter-btn, body.dark-mode .sf-active a { background: #111827; border-color: #334155; color: #e5e7eb; }
body.dark-mode .sf-bar { background: rgba(11, 18, 32, .92); border-color: #1f2937; }

/* Uniform product images: every card shows a fixed square, any source ratio is cropped to fit */
.dz-card__media { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: #f3f4f6; }
.dz-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.dz-track .idea-slider-item, .dz-track .idea-product-slider-item { display: flex; align-items: stretch; }
.dz-track .dz-card { height: auto; width: 100%; }
.qv__img { position: relative; }
.qv__img img { position: absolute; inset: 0; }

/* ── Refined icons & stars ── */
.dz-card__stars { gap: 2px; font-size: .68rem; align-items: center; }
.dz-card__stars i { color: #e5e7eb; filter: none; }
.dz-card__stars i.on { color: #f5a623; }
.dz-card__stars span { font-size: .7rem; font-weight: 600; color: #8b93a1; margin-left: .35rem; }
.dz-card__tools { right: 10px; top: 10px; gap: 8px; }
.dz-tool {
    width: 36px; height: 36px; border: 0; border-radius: 50%; padding: 0;
    background: rgba(255, 255, 255, .94); color: #2b3340; font-size: .85rem; line-height: 1;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .18), inset 0 0 0 1px rgba(15, 23, 42, .06);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.dz-tool:hover { transform: scale(1.1); background: #fff; color: var(--shop-theme-primary, #f57224); box-shadow: 0 4px 14px rgba(15, 23, 42, .24); }
.dz-tool--cart { background: var(--shop-theme-primary, #f57224); color: #fff; box-shadow: 0 3px 12px rgba(15, 23, 42, .25); }
.dz-tool--cart:hover { background: var(--shop-theme-primary, #f57224); color: #fff; filter: brightness(1.08); }
.dz-tool:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.dz-tool:disabled { opacity: .7; transform: none; }
.dz-card__name, .dz-card__name:hover { text-decoration: none; }
.dz-card a, .dz-card a:hover { text-decoration: none; }
.dz-card__old { text-decoration: line-through; }

/* ══════════ Toolbar dropdowns ══════════ */
.sf-bar { overflow: visible; }
.sf-bar__in { gap: .6rem; flex-wrap: wrap; }
.sf-dd { position: relative; }
.sf-dd__btn {
    display: inline-flex; align-items: center; gap: .55rem; height: 46px; padding: 0 1rem; max-width: 100%;
    background: #fff; border: 1.5px solid #e5e7eb; border-radius: 14px; cursor: pointer; color: #111827; text-align: left;
    transition: border-color .15s, box-shadow .15s;
}
.sf-dd__btn:hover { border-color: #cbd5e1; }
.sf-dd.is-open .sf-dd__btn { border-color: var(--shop-theme-primary); box-shadow: 0 0 0 4px rgba(0, 0, 0, .05); }
.sf-dd__label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #9ca3af; }
.sf-dd__value { font-size: .92rem; font-weight: 700; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-dd__caret { font-size: .7rem; color: #9ca3af; transition: transform .2s; }
.sf-dd.is-open .sf-dd__caret { transform: rotate(180deg); color: var(--shop-theme-primary); }

.sf-dd__menu {
    position: absolute; left: 0; top: calc(100% + 8px); z-index: 1200; width: 360px; max-width: calc(100vw - 24px);
    background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: .5rem;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .05);
    opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top left;
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.sf-dd__menu--sm { width: 240px; }
.sf-dd.is-open .sf-dd__menu { opacity: 1; visibility: visible; transform: none; }
.sf-dd__sheet-head { display: none; }
.sf-dd__find { padding: .25rem .25rem .5rem; }
.sf-dd__find input { width: 100%; height: 40px; border: 1.5px solid #e5e7eb; border-radius: 10px; padding: 0 .8rem; font-size: .92rem; outline: none; background: #f9fafb; }
.sf-dd__find input:focus { border-color: var(--shop-theme-primary); background: #fff; }
.sf-dd__list { max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; padding: 2px; }
.sf-dd__item {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-height: 44px; padding: .45rem .8rem;
    border-radius: 10px; color: #1f2937; text-decoration: none; font-weight: 600; font-size: .92rem; line-height: 1.3;
    transition: background .12s, color .12s;
}
.sf-dd__item:hover { background: #f3f4f6; color: #111827; }
.sf-dd__item small { flex: 0 0 auto; min-width: 26px; text-align: center; padding: 1px 8px; border-radius: 999px; background: #f3f4f6; color: #6b7280; font-weight: 800; font-size: .72rem; }
.sf-dd__item.is-active { background: color-mix(in srgb, var(--shop-theme-primary) 10%, #fff); color: var(--shop-theme-primary); }
.sf-dd__item.is-active small { background: var(--shop-theme-primary); color: #fff; }
.sf-dd__item.is-active:not(:has(small))::after { content: '✓'; font-weight: 900; margin-left: auto; }
.sf-dd__name { min-width: 0; overflow-wrap: anywhere; }
.sf-dd__none { padding: .9rem; text-align: center; color: #9ca3af; font-weight: 600; }
.sf-dd__scrim { display: none; }

.sf-filter-btn { height: 46px; border-radius: 14px; padding: 0 1.1rem; }

/* Phones: menus become a bottom sheet */
@media (max-width: 767.98px) {
    .sf-bar__in { display: grid; grid-template-columns: 1fr 1fr; }
    .sf-dd__btn { width: 100%; justify-content: space-between; height: 48px; }
    .sf-dd__label { display: none; }
    .sf-dd__value { max-width: none; flex: 1; }
    .sf-filter-btn { grid-column: 1 / -1; height: 46px; justify-content: center; }
    .sf-dd__menu, .sf-dd__menu--sm {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; z-index: 2700;
        border-radius: 20px 20px 0 0; padding: .4rem .6rem calc(.8rem + env(safe-area-inset-bottom));
        transform: translateY(100%); transform-origin: bottom; box-shadow: 0 -12px 40px rgba(15, 23, 42, .25);
    }
    .sf-dd.is-open .sf-dd__menu { transform: none; }
    .sf-dd__sheet-head { display: flex; align-items: center; justify-content: space-between; padding: .5rem .4rem .3rem; font-size: 1.05rem; }
    .sf-dd__close { border: 0; background: #f3f4f6; width: 38px; height: 38px; border-radius: 50%; font-size: 1.4rem; line-height: 1; color: #374151; }
    .sf-dd__list { max-height: 55vh; }
    .sf-dd__item { min-height: 50px; font-size: 1rem; }
    .sf-dd__scrim { display: block; position: fixed; inset: 0; z-index: 2650; background: rgba(15, 23, 42, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
    .sf-dd__scrim.is-on { opacity: 1; pointer-events: auto; }
    html.sf-dd-lock, html.sf-dd-lock body { overflow: hidden; }
}
body.dark-mode .sf-dd__btn, body.dark-mode .sf-dd__menu { background: #111827; border-color: #334155; color: #f1f5f9; }
body.dark-mode .sf-dd__item { color: #e5e7eb; } body.dark-mode .sf-dd__item:hover { background: #1f2937; }
body.dark-mode .sf-dd__item small, body.dark-mode .sf-dd__close { background: #1f2937; color: #cbd5e1; }
body.dark-mode .sf-dd__find input { background: #0f172a; border-color: #334155; color: #f1f5f9; }

/* Many categories → multi-column grid inside the dropdown (1 column on phones) */
.sf-dd__menu--cols { width: min(calc(var(--sf-cols, 2) * 270px + 24px), calc(100vw - 24px)); }
.sf-dd__menu--cols .sf-dd__list {
    display: grid; grid-template-columns: repeat(var(--sf-cols, 2), minmax(0, 1fr)); gap: 2px 6px; max-height: min(64vh, 460px);
}
.sf-dd__menu--cols .sf-dd__none { grid-column: 1 / -1; }
@media (max-width: 991.98px) { .sf-dd__menu--cols { width: min(calc(2 * 240px + 24px), calc(100vw - 24px)); } .sf-dd__menu--cols .sf-dd__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
    .sf-dd__menu--cols { width: auto; }
    .sf-dd__menu--cols .sf-dd__list { grid-template-columns: 1fr; }
}