* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }

:root {
    --brand: rgb(16 185 129);
    --brand-ink: #0a2f23;
    --accent: rgb(14 165 233);
    --danger: rgb(239 68 68);

    --bg: rgb(246 248 251);
    --card: rgba(255, 255, 255, .96);
    --card-strong: rgba(255, 255, 255, .98);
    --text: rgb(10 16 28);
    --muted: rgb(86 96 114);
    --border: rgba(226, 232, 240, .95);

    --shadow-sm: 0 8px 22px rgba(2, 6, 23, .08);
    --shadow-md: 0 16px 40px rgba(2, 6, 23, .10);
    --shadow-lg: 0 24px 60px rgba(2, 6, 23, .12);

    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-sm: 14px;

    --gutter: 16px;
    --maxw: 1040px;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 20% -10%, rgba(16, 185, 129, .22), transparent 60%),
        radial-gradient(900px 520px at 90% 0%, rgba(14, 165, 233, .22), transparent 55%),
        var(--bg);
    overflow-x: hidden;
}

a { color: inherit; }
button, [role="button"] { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(14, 165, 233, .45); outline-offset: 2px; border-radius: 14px; }

.skip-link {
    position: absolute;
    left: 12px;
    top: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transform: translateY(-200%);
    transition: transform .18s ease;
    z-index: 999;
}

.skip-link:focus { transform: translateY(0); }

.app-root {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-bottom: calc(92px + var(--safe-b));
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, .8);
}

.topbar::after {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(90deg, rgba(16, 185, 129, .55), rgba(14, 165, 233, .45), rgba(16, 185, 129, .15));
    opacity: .35;
}

.topbar__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: calc(10px + var(--safe-t)) var(--gutter) 12px;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 10px;
}

.topbar__actions { display: flex; justify-content: flex-end; gap: 10px; }

.brand {
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(226, 232, 240, .85);
    box-shadow: var(--shadow-sm);
}

.brand:active { transform: scale(.99); }

.brand__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 10px 18px rgba(16, 185, 129, .28);
}

.brand__text { display: grid; gap: 2px; min-width: 0; }
.brand__title { font-weight: 950; font-size: 15px; letter-spacing: .2px; line-height: 1.1; }
.brand__subtitle { font-size: 12px; color: var(--muted); line-height: 1.1; }

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 1);
    background: rgba(255, 255, 255, .95);
    box-shadow: var(--shadow-sm);
    display: grid;
    place-items: center;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.icon-btn:hover { box-shadow: 0 12px 26px rgba(2, 6, 23, .10); }
.icon-btn:active { transform: scale(.92); box-shadow: 0 10px 20px rgba(2, 6, 23, .08); }

.badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 950;
    padding: 2px 7px;
    border-radius: 999px;
    box-shadow: 0 10px 18px rgba(239, 68, 68, .28);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(226, 232, 240, .9);
    padding-bottom: var(--safe-b);
    z-index: 90;
}

.bottom-nav__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 10px var(--gutter) 12px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.bottom-nav__item {
    position: relative;
    padding: 10px 0 12px;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 900;
    color: rgba(10, 16, 28, .72);
    border-radius: 16px;
    transition: background .14s ease;
}

.bottom-nav__item:hover { background: rgba(2, 6, 23, .04); }

.bottom-nav__item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 26%;
    right: 26%;
    height: 3px;
    border-radius: 999px;
    background: transparent;
}

.bottom-nav__item.active { color: var(--brand); }
.bottom-nav__item.active::before { background: linear-gradient(90deg, rgba(16, 185, 129, .8), rgba(14, 165, 233, .55)); }
.nav-icon { font-size: 18px; }
.nav-text { line-height: 1; }

.store-hero { padding: 14px var(--gutter) 10px; }

.store-hero__card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(226, 232, 240, .65);
    position: relative;
    overflow: hidden;
    animation: fadeUp .35s ease;
}

.store-hero__card::before {
    content: "";
    position: absolute;
    inset: -2px;
    background:
        radial-gradient(500px 220px at 18% 10%, rgba(16, 185, 129, .18), transparent 60%),
        radial-gradient(520px 260px at 92% 0%, rgba(14, 165, 233, .14), transparent 55%);
    pointer-events: none;
}

.store-hero__info, .store-hero__meta { position: relative; }
.store-name { font-size: 22px; font-weight: 950; margin: 0; }
.store-desc { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.35; }

.store-hero__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.meta-item {
    background: rgba(246, 248, 251, .9);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, .7);
}

.meta-label { font-size: 11px; color: var(--muted); }
.meta-value { font-weight: 900; font-size: 13px; margin-top: 2px; }

.quick-filters {
    display: flex;
    gap: 10px;
    padding: 8px var(--gutter) 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.categories {
    display: flex;
    gap: 10px;
    padding: 8px var(--gutter) 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.categories::-webkit-scrollbar { display: none; }

.quick-filters::-webkit-scrollbar { display: none; }

.chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border-radius: 999px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 950;
    border: 1px solid rgba(226, 232, 240, 1);
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 10px 22px rgba(2, 6, 23, .08);
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
    white-space: nowrap;
}

.category-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border-radius: 999px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 950;
    border: 1px solid rgba(226, 232, 240, 1);
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 10px 22px rgba(2, 6, 23, .08);
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
    white-space: nowrap;
}

.category-chip:hover { box-shadow: 0 14px 30px rgba(2, 6, 23, .10); }
.category-chip:active { transform: scale(.98); }
.category-chip.active { background: var(--brand); color: var(--brand-ink); border-color: transparent; box-shadow: 0 18px 38px rgba(16, 185, 129, .30); }

.chip:hover { box-shadow: 0 14px 30px rgba(2, 6, 23, .10); }
.chip:active { transform: scale(.98); }
.chip.active { background: var(--brand); color: var(--brand-ink); border-color: transparent; box-shadow: 0 18px 38px rgba(16, 185, 129, .30); }

.products {
    padding: 0 var(--gutter) 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.product-card {
    background: var(--card-strong);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, .65);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    animation: fadeUp .35s ease;
    position: relative;
    overflow: hidden;
    transition: transform .14s ease, box-shadow .14s ease;
}

.product-card::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 120px;
    right: -90px;
    top: -60px;
    background: radial-gradient(circle at center, rgba(14, 165, 233, .12), transparent 65%);
    pointer-events: none;
}

.product-card:hover { transform: translateY(-1px); box-shadow: 0 18px 46px rgba(2, 6, 23, .12); }
.product-card:active { transform: translateY(0) scale(.995); }

.product-left { display: flex; gap: 12px; min-width: 0; }

.product-image {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background:
        radial-gradient(44px 44px at 30% 25%, rgba(16, 185, 129, .24), transparent 60%),
        radial-gradient(54px 54px at 80% 10%, rgba(14, 165, 233, .22), transparent 55%),
        linear-gradient(135deg, rgba(16, 185, 129, .10), rgba(14, 165, 233, .08));
    border: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 12px 26px rgba(2, 6, 23, .10);
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
}

.product-image::before {
    content: "";
    position: absolute;
    inset: -20%;
    background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, .18) 38%, rgba(255, 255, 255, .08) 52%, transparent 70%);
    transform: translateX(-30%);
    animation: shimmer 2.6s ease-in-out infinite;
    opacity: .12;
    pointer-events: none;
}

.product-image::after {
    content: "SR";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-weight: 950;
    letter-spacing: .6px;
    color: rgba(255, 255, 255, .95);
    text-shadow: 0 10px 18px rgba(2, 6, 23, .18);
    opacity: .18;
    pointer-events: none;
}

.product-image img { display: block; width: 0; height: 0; opacity: 0; position: absolute; }
.product-info { min-width: 0; }
.product-title { font-size: 15px; font-weight: 950; margin: 0; line-height: 1.2; }
.product-desc {
    font-size: 12px;
    color: var(--muted);
    margin: 6px 0 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
}

.product-price { font-weight: 950; font-size: 15px; }

.product-add {
    border-radius: 14px;
    padding: 10px 12px;
    border: none;
    background: var(--brand);
    color: var(--brand-ink);
    font-weight: 950;
    box-shadow: 0 12px 26px rgba(16, 185, 129, .35);
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.product-add::before {
    content: "+";
    width: 18px;
    height: 18px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .35);
    font-weight: 950;
}

.product-add:hover { filter: saturate(1.05); box-shadow: 0 16px 34px rgba(16, 185, 129, .40); }
.product-add:active { transform: scale(.94); }

.page { padding: 10px var(--gutter) 14px; }
.page h2 { margin: 0 0 12px; font-size: 18px; font-weight: 950; letter-spacing: .2px; }

.cart { padding: 10px var(--gutter) 14px; }
.cart h2 { margin: 0 0 12px; font-size: 18px; font-weight: 950; letter-spacing: .2px; }

.card {
    background: rgba(255, 255, 255, .95);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: 0 12px 28px rgba(2, 6, 23, .10);
    border: 1px solid rgba(226, 232, 240, .7);
}

.muted { color: var(--muted); }
.small { font-size: 12px; font-weight: 900; line-height: 1.45; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

.profile-grid { display: grid; gap: 10px; }
.field { display: grid; gap: 8px; }
.field__label { font-weight: 950; }

.input, .textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, .9);
    background: rgba(255, 255, 255, .95);
    outline: none;
    font-weight: 900;
    font-size: 14px;
}

.textarea { padding: 12px 14px; border-radius: 18px; resize: none; }

.cart-item {
    background: rgba(255, 255, 255, .95);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: 0 12px 28px rgba(2, 6, 23, .10);
    border: 1px solid rgba(226, 232, 240, .7);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.cart-line { align-items: flex-start; }

.cart-item strong { display: block; font-weight: 950; margin-bottom: 6px; }

.cart-total {
    margin-top: 14px;
    font-size: 15px;
    font-weight: 950;
    display: flex;
    justify-content: space-between;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(226, 232, 240, .8);
    box-shadow: var(--shadow-sm);
}

.checkout-btn {
    margin-top: 12px;
    width: 100%;
    border-radius: 18px;
    padding: 16px;
    border: none;
    background: var(--brand);
    color: var(--brand-ink);
    font-weight: 950;
    font-size: 16px;
    box-shadow: 0 18px 42px rgba(16, 185, 129, .40);
    transition: transform .14s ease, box-shadow .14s ease;
}

.checkout-btn:active { transform: scale(.98); box-shadow: 0 14px 34px rgba(16, 185, 129, .34); }

.empty { padding: 14px; }

.boot { padding: 6px var(--gutter) 0; }

.boot__hint {
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(226, 232, 240, .8);
    border-radius: 18px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    color: var(--muted);
    font-weight: 800;
    font-size: 13px;
}

.product-image[data-action="view-photo"], .product-image[role="button"] {
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.product-image[data-action="view-photo"]:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(2, 6, 23, .14); }
.product-image[data-action="view-photo"]:active { transform: scale(.98); }
.product-image[data-action="view-photo"] { outline: 2px solid rgba(14, 165, 233, .12); outline-offset: 2px; animation: photoHint 2.8s ease-in-out infinite; }
@keyframes photoHint { 0%, 100% { outline-color: rgba(14, 165, 233, .10); } 50% { outline-color: rgba(16, 185, 129, .16); } }

.cart-item .icon-btn {
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(226, 232, 240, .90);
    color: rgba(10, 16, 28, .92);
    box-shadow: 0 10px 18px rgba(2, 6, 23, .08);
}

.cart-item .icon-btn:hover { filter: saturate(1.02); }
.cart-item .icon-btn:active { transform: scale(.96); }
.cart-item .icon-btn[data-action="cart-remove"] { background: rgba(239, 68, 68, .10); border-color: rgba(239, 68, 68, .18); color: rgb(153 27 27); box-shadow: 0 10px 18px rgba(239, 68, 68, .18); }
.cart-item .icon-btn[data-action="cart-edit"] { background: rgba(14, 165, 233, .10); border-color: rgba(14, 165, 233, .18); color: rgb(3 105 161); box-shadow: 0 10px 18px rgba(14, 165, 233, .16); }

.overlay, #overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .42);
    backdrop-filter: blur(2px);
    z-index: 95;
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 96;
    max-width: min(var(--maxw), 720px);
    margin: 0 auto;
    background: rgba(255, 255, 255, .98);
    border-top-left-radius: 26px;
    border-top-right-radius: 26px;
    border: 1px solid rgba(226, 232, 240, .7);
    box-shadow: 0 -24px 70px rgba(2, 6, 23, .20);
    transform: translateY(12px);
    animation: sheetUp .22s ease forwards;
    overflow: hidden;
}

.sheet__header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 10px;
    border-bottom: 1px solid rgba(226, 232, 240, .85);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
}

.sheet__title { text-align: center; font-weight: 950; letter-spacing: .2px; }
.sheet__spacer { width: 44px; height: 40px; }

.sheet__body {
    max-height: min(78vh, 680px);
    overflow: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
}

.sheet-product { display: grid; gap: 12px; }

.sheet-product__top { display: flex; gap: 12px; align-items: flex-start; }

.sheet-product__thumb { width: 92px; height: 92px; border-radius: 22px; position: relative; }

.sheet-product__thumb-hint {
    position: absolute;
    left: 8px;
    bottom: 8px;
    font-weight: 950;
    font-size: 11px;
    background: rgba(255, 255, 255, .85);
    border: 1px solid rgba(226, 232, 240, .9);
    padding: 4px 8px;
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(2, 6, 23, .08);
}

.sheet-product__info { min-width: 0; }
.sheet-product__title { font-weight: 950; font-size: 16px; }
.sheet-product__desc { margin-top: 6px; color: var(--muted); font-weight: 900; font-size: 12px; line-height: 1.35; }
.sheet-product__base { margin-top: 10px; font-weight: 950; }
.sheet-product__meta { margin-top: 10px; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(246, 248, 251, .92);
    border: 1px solid rgba(226, 232, 240, .8);
    font-weight: 950;
    font-size: 12px;
    color: rgba(10, 16, 28, .82);
}

.sheet-section__title { font-weight: 950; margin-bottom: 6px; }

.sheet-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-action__chev { font-weight: 950; opacity: .7; }

.toast, #toast {
    position: fixed;
    left: 50%;
    top: calc(12px + var(--safe-t));
    transform: translateX(-50%);
    z-index: 120;
    max-width: min(520px, calc(100% - 24px));
    padding: 12px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(226, 232, 240, .85);
    box-shadow: 0 18px 42px rgba(2, 6, 23, .16);
    font-weight: 900;
    font-size: 13px;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheetUp { from { transform: translateY(28px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes shimmer { 0% { transform: translateX(-55%) rotate(8deg); } 50% { transform: translateX(25%) rotate(8deg); } 100% { transform: translateX(55%) rotate(8deg); } }

@media (min-width: 760px) {
    .topbar__inner { grid-template-columns: 44px 1fr 110px; }
    .product-image { width: 60px; height: 60px; border-radius: 20px; }
    .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-grid { grid-template-columns: 1fr 1fr; }
    .field--full { grid-column: 1 / -1; }
}

@media (min-width: 1100px) {
    .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
    :root { --gutter: 14px; }
    .brand__subtitle { display: none; }
    .product-add { padding: 10px 10px; }
}

@media (max-width: 520px) {
    .cart-line { flex-wrap: wrap; }
    .cart-line__sum { width: 100%; text-align: right; margin-top: 8px; }
}
