:root {
    --store-ink: #1a1d29;
    --store-ink-2: #6b7280;
    --store-line: #e6e8ef;
    --store-bg: #f7f7fb;
    --store-surface: #ffffff;
    --store-primary: #3730a3;
    --store-primary-ink: #ffffff;
    --store-accent: #f59e0b;
    --store-accent-ink: #1a1d29;
    --store-danger: #dc2626;
    --store-success: #16a34a;
    --store-radius: 14px;
    --store-shadow: 0 2px 10px rgba(26, 29, 41, .06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--store-bg);
    color: var(--store-ink);
    padding-bottom: 24px;
}

a { color: inherit; text-decoration: none; }

/* ---------- header ---------- */

.store-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--store-surface);
    border-bottom: 1px solid var(--store-line);
}

.store-logo {
    font-weight: 800;
    font-size: 20px;
    color: var(--store-primary);
    letter-spacing: -.02em;
}
.store-logo span { color: var(--store-accent); }

.store-header__right { display: flex; align-items: center; gap: 14px; }

.store-lang { display: flex; gap: 8px; font-size: 13px; font-weight: 600; color: var(--store-ink-2); }
.store-lang a.is-active { color: var(--store-primary); }

.store-cart-btn {
    position: relative;
    font-size: 20px;
    line-height: 1;
    padding: 6px;
}
.store-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--store-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    min-width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ---------- layout / page ---------- */

.store-main { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.store-page { padding-block: 18px; }
.store-page__title { font-size: 20px; font-weight: 800; margin: 0 0 14px; }
.store-count { color: var(--store-ink-2); font-weight: 500; font-size: 15px; }

.store-back {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--store-ink-2);
}

.store-empty { color: var(--store-ink-2); padding: 30px 0; text-align: center; }

/* ---------- tiles (categories / brands) ---------- */

.store-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.store-tile {
    background: var(--store-surface);
    border: 1px solid var(--store-line);
    border-radius: var(--store-radius);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    box-shadow: var(--store-shadow);
    transition: transform .12s ease, box-shadow .12s ease;
}
.store-tile:active { transform: scale(.97); }
.store-tile__icon { font-size: 28px; }
.store-tile__label { font-weight: 600; font-size: 14px; }

/* ---------- products layout ---------- */

.store-products-layout { display: flex; gap: 22px; align-items: flex-start; }
.store-filters {
    flex: 0 0 220px;
    background: var(--store-surface);
    border: 1px solid var(--store-line);
    border-radius: var(--store-radius);
    padding: 16px;
    position: sticky;
    top: 70px;
}
.store-filters h2 { font-size: 15px; margin: 0 0 12px; }
.store-filter-group { margin-bottom: 18px; }
.store-filter-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--store-ink-2); margin: 0 0 8px; }
.store-checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.store-filter-actions { display: flex; gap: 8px; }

.store-products { flex: 1 1 auto; min-width: 0; }

/* ---------- price range slider ---------- */

.store-price-slider { position: relative; height: 24px; margin: 6px 2px 4px; }
.store-price-slider__track, .store-price-slider__range {
    position: absolute; top: 50%; height: 4px; border-radius: 4px; transform: translateY(-50%);
}
.store-price-slider__track { left: 0; right: 0; background: var(--store-line); }
.store-price-slider__range { background: var(--store-primary); }
.store-price-slider__input {
    position: absolute; left: 0; right: 0; top: 0; width: 100%; margin: 0;
    -webkit-appearance: none; appearance: none; background: none; pointer-events: none; height: 24px;
}
.store-price-slider__input::-webkit-slider-thumb {
    -webkit-appearance: none; pointer-events: auto;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--store-primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3);
    cursor: pointer; margin-top: 3px;
}
.store-price-slider__input::-moz-range-thumb {
    pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
    background: var(--store-primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer;
}
.store-price-slider__labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--store-ink-2); }

/* ---------- product grid / card ---------- */

.store-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 14px;
}
.store-card {
    background: var(--store-surface);
    border: 1px solid var(--store-line);
    border-radius: var(--store-radius);
    overflow: hidden;
    box-shadow: var(--store-shadow);
    display: flex;
    flex-direction: column;
}
.store-card__image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f1f2f7;
    display: flex; align-items: center; justify-content: center;
}
.store-card__image img { width: 100%; height: 100%; object-fit: cover; }
.store-card__noimg { font-size: 34px; opacity: .35; }
.store-card__noimg--lg { font-size: 64px; }
.store-badge {
    position: absolute; top: 8px; left: 8px;
    font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.store-badge--out { background: rgba(220,38,38,.12); color: var(--store-danger); }
.store-badge--in { background: rgba(22,163,74,.12); color: var(--store-success); }

.store-card__body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.store-card__brand { font-size: 11px; color: var(--store-ink-2); text-transform: uppercase; letter-spacing: .03em; }
.store-card__name { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.store-card__price { font-weight: 800; color: var(--store-primary); font-size: 15px; }
.store-card__stock { font-size: 12px; color: var(--store-ink-2); }
.store-card__actions { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; }

/* ---------- buttons ---------- */

.store-btn {
    border: none; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: 14px;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.store-btn--primary { background: var(--store-accent); color: var(--store-accent-ink); }
.store-btn--ghost { background: var(--store-surface); border: 1px solid var(--store-line); color: var(--store-ink); }
.store-btn--sm { padding: 7px 10px; font-size: 12px; flex: 1; }
.store-btn--lg { padding: 13px 20px; font-size: 15px; }
.store-btn--block { width: 100%; }
.store-btn[disabled] { opacity: .5; cursor: not-allowed; }
.store-btn.is-added { background: var(--store-success); color: #fff; }

/* ---------- pagination ---------- */

.store-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.store-pagination__link {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--store-line); font-size: 13px; font-weight: 600;
}
.store-pagination__link.is-active { background: var(--store-primary); color: #fff; border-color: var(--store-primary); }

/* ---------- product detail ---------- */

.store-product-detail { display: flex; gap: 26px; flex-wrap: wrap; }
.store-product-detail__image {
    flex: 1 1 300px; max-width: 420px; aspect-ratio: 1/1; background: #f1f2f7; border-radius: var(--store-radius);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.store-product-detail__image img { width: 100%; height: 100%; object-fit: cover; }
.store-product-detail__info { flex: 1 1 280px; display: flex; flex-direction: column; gap: 10px; }
.store-product-detail__info h1 { margin: 0; font-size: 22px; }
.store-product-detail__price { font-size: 26px; font-weight: 800; color: var(--store-primary); }
.store-product-detail__stock { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--store-ink-2); }
.store-product-detail__stock .store-badge { position: static; }
.store-product-detail__variants { display: flex; gap: 6px; flex-wrap: wrap; }
.store-tag { background: var(--store-bg); border: 1px solid var(--store-line); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.store-product-detail__desc { color: var(--store-ink-2); line-height: 1.6; font-size: 14px; }

.store-qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--store-line); border-radius: 10px; width: fit-content; }
.store-qty-stepper button { border: none; background: none; width: 34px; height: 36px; font-size: 18px; cursor: pointer; }
.store-qty-stepper input { width: 44px; border: none; text-align: center; font-size: 14px; font-weight: 700; -moz-appearance: textfield; }
.store-qty-stepper input::-webkit-outer-spin-button, .store-qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.store-related { margin-top: 34px; }
.store-related h2 { font-size: 17px; margin-bottom: 12px; }

/* ---------- modal (quick view) ---------- */

.store-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.store-modal[hidden] { display: none; }
.store-modal__backdrop { position: absolute; inset: 0; background: rgba(26,29,41,.5); }
.store-modal__panel {
    position: relative; background: var(--store-surface); width: 100%; max-width: 480px;
    max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 20px; z-index: 1;
}
@media (min-width: 641px) {
    .store-modal { align-items: center; }
    .store-modal__panel { border-radius: 18px; }
}

/* ---------- cart ---------- */

.store-cart-line {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--store-line);
}
.store-cart-line__name { font-weight: 700; font-size: 14px; }
.store-cart-line__variant { font-size: 12px; color: var(--store-ink-2); }
.store-cart-line__price { font-size: 13px; color: var(--store-ink-2); }
.store-cart-line__total { font-weight: 800; min-width: 70px; text-align: right; }
.store-cart-line__remove { border: none; background: none; font-size: 20px; color: var(--store-ink-2); cursor: pointer; line-height: 1; }

.store-cart__summary { margin-top: 18px; padding-top: 16px; border-top: 2px solid var(--store-line); display: flex; flex-direction: column; gap: 10px; }
.store-cart__total-row { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; }
.store-cart__note-label { font-size: 13px; font-weight: 600; color: var(--store-ink-2); }
.store-cart textarea { border: 1px solid var(--store-line); border-radius: 10px; padding: 10px; font-family: inherit; font-size: 14px; resize: vertical; }

/* ---------- gate / success ---------- */

.store-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.store-gate__card {
    background: var(--store-surface); border-radius: 20px; padding: 32px 26px; max-width: 380px;
    text-align: center; box-shadow: var(--store-shadow); display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.store-gate__card--inline { margin: 30px auto 0; }
.store-gate__logo { font-weight: 800; font-size: 22px; color: var(--store-primary); margin-bottom: 4px; }
.store-gate__logo span { color: var(--store-accent); }
.store-gate__icon { font-size: 40px; }
.store-gate__lang { display: flex; gap: 12px; font-size: 13px; font-weight: 600; color: var(--store-ink-2); margin-bottom: 4px; }
.store-gate__lang a.is-active { color: var(--store-primary); }
.store-gate__card h1 { font-size: 18px; margin: 4px 0; }
.store-gate__card p { color: var(--store-ink-2); font-size: 14px; margin: 0 0 8px; }
.store-gate__btn { background: #25d366; color: #fff; padding: 12px 22px; border-radius: 12px; font-weight: 700; }
.store-order-no { font-weight: 800; font-size: 16px; color: var(--store-primary); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
    .store-products-layout { flex-direction: column; }
    .store-filters { position: static; flex: 1 1 auto; width: 100%; }
}

@media (max-width: 480px) {
    .store-cart-line { grid-template-columns: 1fr auto; grid-template-areas: "info remove" "qty total"; }
    .store-cart-line__info { grid-area: info; }
    .store-cart-line__remove { grid-area: remove; }
    .store-qty-stepper { grid-area: qty; }
    .store-cart-line__total { grid-area: total; }
}
