/* ==========================================================
   Kliniva - price list
   Palette: deep petrol + warm porcelain + champagne gold
   ========================================================== */
:root {
    color-scheme: light;

    --bg: #F4F1EA;
    --surface: #FFFFFF;
    --surface-soft: #FBF9F5;
    --sand: #F1ECE3;
    --line: #E5DED2;
    --line-strong: #D6CCBB;

    --ink: #14232A;
    --ink-2: #3B4C54;
    --muted: #6A787E;

    --brand: #0E3B43;
    --brand-700: #0B3138;
    --brand-600: #155560;
    --brand-50: #E6EFEF;
    --on-brand: #F4EFE6;

    --gold: #E2B45F;
    --gold-deep: #B8862F;
    --gold-soft: #F7ECD7;

    --ok: #24805F;
    --danger: #B9413A;
    --whatsapp: #1DA851;
    --whatsapp-dark: #168A42;

    --radius: 18px;
    --shadow-card: 0 1px 2px rgba(20, 35, 42, 0.04);
    --shadow-lift: 0 22px 44px -22px rgba(14, 59, 67, 0.38);

    --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
    --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 2.5px solid var(--gold-deep); outline-offset: 2px; border-radius: 8px; }

.wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-primary {
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
}
.btn-primary:hover { background: var(--brand-600); }

.icon-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: var(--sand);
    color: var(--ink);
    transition: background-color 0.2s;
}
.icon-btn:hover { background: var(--line); }

.link-btn {
    display: block;
    margin: 10px auto 0;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}
.link-btn:hover { color: var(--danger); text-decoration: underline; }

/* ==========================================================
   HERO
   ========================================================== */
.hero {
    position: relative;
    overflow: hidden;
    color: var(--on-brand);
    background:
        radial-gradient(1200px 500px at 85% -10%, rgba(226, 180, 95, 0.20), transparent 60%),
        radial-gradient(900px 600px at -10% 120%, rgba(31, 122, 140, 0.35), transparent 60%),
        linear-gradient(160deg, #0F434C 0%, var(--brand) 45%, var(--brand-700) 100%);
}
.hero::before {
    /* fine technical grid */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(244, 239, 230, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244, 239, 230, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 85%);
    pointer-events: none;
}
.hero-glow {
    position: absolute;
    right: -120px;
    top: 40px;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    border: 1px solid rgba(226, 180, 95, 0.25);
    box-shadow: 0 0 0 60px rgba(226, 180, 95, 0.04), 0 0 0 130px rgba(226, 180, 95, 0.03);
    pointer-events: none;
}
.hero .wrap { position: relative; }

.brandbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}
.brand-logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 14px;
    object-fit: contain;
    box-shadow: 0 0 0 1px rgba(244, 239, 230, 0.18);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
}
.brand-tagline {
    margin-top: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(244, 239, 230, 0.66);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(226, 180, 95, 0.55);
    color: var(--on-brand);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.hero-contact:hover { background: rgba(226, 180, 95, 0.14); border-color: var(--gold); }
.hero-contact svg { color: var(--gold); }

.hero-body { padding: 34px 0 54px; max-width: 780px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 1.5px; background: currentColor; }

.hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.4vw, 3.5rem);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: #FBF7F0;
    text-wrap: balance;
}
.hero-text {
    max-width: 620px;
    margin: 18px 0 0;
    font-size: 1.06rem;
    color: rgba(244, 239, 230, 0.78);
    text-wrap: pretty;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: start;
    gap: 14px 48px;
    margin: 34px 0 0;
    padding-top: 22px;
    border-top: 1px solid rgba(244, 239, 230, 0.14);
}
.hero-stats dt {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(244, 239, 230, 0.55);
}
.hero-stats dd {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1.1;
    color: #FBF7F0;
}

/* ==========================================================
   TOOLBAR (sticky)
   ========================================================== */
.toolbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(244, 241, 234, 0.88);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--line);
}
.toolbar-inner {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 12px 0 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within { border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(14, 59, 67, 0.1); }
.search-icon { color: var(--muted); flex-shrink: 0; }
.search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.93rem;
    font-weight: 500;
}
.search input::placeholder { color: #98A3A8; }
.search input::-webkit-search-cancel-button { display: none; }
.search-kbd {
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
}
.search:focus-within .search-kbd { display: none; }
.search-clear {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: var(--sand);
    color: var(--ink-2);
    flex-shrink: 0;
}
.search-clear:hover { background: var(--line); }

.chips-scroller {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
}
.chips-scroller::-webkit-scrollbar { display: none; }
.chips {
    display: flex;
    gap: 8px;
    width: max-content;
    padding: 3px 36px 3px 2px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 8px 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip-count {
    min-width: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--sand);
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0;
    text-align: center;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.active .chip-count { background: var(--gold); color: var(--brand-700); }

/* ==========================================================
   CATALOG
   ========================================================== */
.catalog { padding-top: 26px; padding-bottom: 120px; }

.catalog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.result-count { margin: 0; color: var(--muted); font-size: 0.92rem; }
.result-count strong { color: var(--ink); font-weight: 800; }

.sort { display: inline-flex; align-items: center; gap: 10px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.sort select {
    height: 38px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233B4C54' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 700;
    appearance: none;
    -webkit-appearance: none;
}
.sort select:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(14, 59, 67, 0.1); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* ---------- Product card ---------- */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }

.card-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 14px;
    border: none;
    border-bottom: 1px solid var(--sand);
    background: #fff;
    cursor: zoom-in;
    overflow: hidden;
}
.card-media.no-image { cursor: default; background: var(--surface-soft); }
.card-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.5s ease;
}
.card-img.is-loaded { opacity: 1; }
.card:hover .card-img { transform: scale(1.04); }
.card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--line-strong);
}

.card-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    max-width: calc(100% - 20px);
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--brand-600);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.card-tag:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
}
.card-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-desc {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-line;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--ok);
}
.stock::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}
.stock.low { color: var(--gold-deep); }
.stock.out { color: var(--danger); }

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.price { display: flex; flex-direction: column; min-width: 0; }
.price-value {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--ink);
    overflow-wrap: anywhere;
}
.price-value.is-range { font-size: 1.04rem; }
.price-cur {
    margin-top: 2px;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--muted);
}
.price-ask { font-size: 0.86rem; font-weight: 800; color: var(--brand-600); }

/* add button / quantity stepper */
.card-action { flex-shrink: 0; }
.btn-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border: none;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 800;
    transition: background-color 0.2s, transform 0.15s;
}
.btn-add:hover { background: var(--brand-600); }
.btn-add:active { transform: scale(0.96); }

.stepper {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 4px;
    border-radius: 12px;
    background: var(--brand-50);
    color: var(--brand);
}
.stepper button {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}
.stepper button:hover { background: #fff; }
.stepper output { min-width: 26px; text-align: center; font-weight: 800; font-size: 0.92rem; }
.stepper.sm { height: 34px; padding: 3px; }
.stepper.sm button { width: 28px; height: 28px; }

/* ---------- Empty state ---------- */
.empty { padding: 64px 20px; text-align: center; }
.empty-mark {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-50);
    color: var(--brand);
}
.empty h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.empty p { margin: 0 0 20px; color: var(--muted); }

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
    background: var(--brand-700);
    color: rgba(244, 239, 230, 0.74);
    padding: 40px 0 110px;
}
.footer-inner { display: grid; gap: 14px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { border-radius: 12px; }
.footer-brand strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--on-brand);
}
.footer-brand span {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(244, 239, 230, 0.55);
}
.footer-note { max-width: 640px; margin: 4px 0 0; font-size: 0.88rem; }
.footer-copy { margin: 0; font-size: 0.78rem; color: rgba(244, 239, 230, 0.45); }

/* ==========================================================
   CART BUTTON + DRAWER
   ========================================================== */
.cart-fab {
    position: fixed;
    right: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 10px 0 20px;
    border: none;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 18px 40px -14px rgba(11, 49, 56, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.cart-fab:hover { background: var(--brand-600); transform: translateY(-2px); }
.cart-fab svg { color: var(--gold); }
.cart-fab-count {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.9rem;
}
.cart-fab.has-items .cart-fab-count { background: var(--gold); color: var(--brand-700); }
.cart-fab.bump { animation: bump 0.45s ease; }
@keyframes bump { 40% { transform: scale(1.08); } }

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(8, 26, 30, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.drawer-backdrop.open { opacity: 1; }

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    width: min(440px, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--surface-soft);
    box-shadow: -24px 0 60px -24px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.38s;
}
.drawer.open { transform: translateX(0); visibility: visible; transition-delay: 0s; }

.drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; line-height: 1.15; }
.drawer-sub { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted); }

.drawer-body { flex: 1; overflow-y: auto; padding: 4px 24px 20px; overscroll-behavior: contain; }

.drawer-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.drawer-thumb {
    width: 58px;
    height: 58px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
}
.drawer-thumb.blank { display: block; }
.drawer-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drawer-title { font-size: 0.9rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.drawer-unit { font-size: 0.78rem; color: var(--muted); }
.drawer-line { font-size: 0.86rem; font-weight: 800; color: var(--brand-600); }

.drawer-empty { padding: 56px 10px; text-align: center; color: var(--muted); }
.drawer-empty p { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--ink); }
.drawer-empty span { font-size: 0.86rem; }

.order-form { display: grid; gap: 12px; margin-top: 20px; }
.order-form label { display: grid; gap: 6px; }
.order-form span { font-size: 0.78rem; font-weight: 800; color: var(--ink-2); }
.order-form em { font-style: normal; font-weight: 500; color: var(--muted); }
.order-form input, .order-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-size: 0.9rem;
    resize: vertical;
}
.order-form input:focus, .order-form textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(14, 59, 67, 0.1); }

.drawer-foot {
    padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #fff;
}
.total-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.total-row span { font-size: 0.9rem; font-weight: 800; color: var(--muted); }
.total-row strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--ink); }
.total-note { margin: 4px 0 0; font-size: 0.76rem; line-height: 1.4; color: var(--muted); }

.btn-whatsapp {
    width: 100%;
    height: 52px;
    margin-top: 14px;
    border-radius: 14px;
    background: var(--whatsapp);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 10px 24px -12px rgba(29, 168, 81, 0.8);
}
.btn-whatsapp:hover { background: var(--whatsapp-dark); }

/* ==========================================================
   LIGHTBOX + TOAST
   ========================================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 22, 25, 0.84);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: zoom-out;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.lightbox.open { opacity: 1; visibility: visible; transition-delay: 0s; }
.lightbox figure { margin: 0; max-width: min(92vw, 880px); }
.lightbox img {
    display: block;
    max-width: 100%;
    max-height: 76vh;
    margin: 0 auto;
    border-radius: 18px;
    background: #fff;
    object-fit: contain;
    transform: scale(0.96);
    transition: transform 0.3s ease;
}
.lightbox.open img { transform: scale(1); }
.lightbox figcaption {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    color: var(--on-brand);
    font-weight: 700;
}
.lightbox figcaption strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--gold); white-space: nowrap; }
.lightbox-close { position: absolute; top: 18px; right: 18px; background: rgba(255, 255, 255, 0.12); color: #fff; }
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(96px + env(safe-area-inset-bottom));
    z-index: 100;
    max-width: calc(100vw - 32px);
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, 16px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--danger); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 900px) {
    .toolbar-inner { grid-template-columns: minmax(0, 1fr); gap: 10px; padding-top: 12px; padding-bottom: 12px; }
    .hero-stats { grid-template-columns: repeat(2, auto); gap: 16px 40px; }
}

@media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    .brandbar { padding: 16px 0; }
    .brand-logo { width: 40px; height: 40px; }
    .brand-name { font-size: 1.4rem; }
    .brand-tagline { font-size: 0.6rem; letter-spacing: 0.12em; }
    .hero-contact { width: 42px; padding: 0; justify-content: center; }
    .hero-contact span { display: none; }
    .hero-body { padding: 14px 0 34px; }
    .hero h1 { font-size: 1.9rem; }
    .hero-text { font-size: 0.95rem; margin-top: 12px; }
    .hero-stats { margin-top: 24px; padding-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
    .hero-stats dd { font-size: 1.3rem; }
    .hero-glow { width: 300px; height: 300px; right: -150px; top: 20px; }

    .search { height: 44px; }
    .search-kbd { display: none; }
    .chip { height: 34px; font-size: 0.7rem; padding: 0 6px 0 12px; }

    .catalog { padding-top: 16px; }
    .catalog-head { margin-bottom: 12px; }
    .result-count { font-size: 0.82rem; }
    .sort span { display: none; }
    .sort select { height: 34px; font-size: 0.8rem; max-width: 170px; }

    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .card { border-radius: 14px; }
    .card:hover { transform: none; }
    .card-media { padding: 8px; }
    .card-tag { top: 7px; left: 7px; max-width: calc(100% - 14px); font-size: 0.56rem; padding: 3px 7px; }
    .card-body { padding: 10px 11px 12px; gap: 4px; }
    .card-title { font-size: 0.86rem; }
    .card-desc { font-size: 0.74rem; }
    .stock { font-size: 0.68rem; }
    .card-foot { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 10px; }
    .price { flex-direction: row; align-items: baseline; gap: 5px; flex-wrap: wrap; }
    .price-value { font-size: 1.1rem; }
    .price-value.is-range { font-size: 0.94rem; }
    .price-cur { margin-top: 0; font-size: 0.58rem; }
    .price-ask { font-size: 0.78rem; }
    .btn-add, .stepper { width: 100%; height: 36px; }
    .stepper { justify-content: space-between; padding: 2px; }
    .stepper button { width: 32px; height: 32px; }

    .site-footer { padding: 32px 0 100px; }

    .cart-fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); height: 52px; padding-left: 16px; }

    .drawer {
        top: auto;
        width: 100vw;
        height: min(88vh, 88dvh);
        border-radius: 22px 22px 0 0;
        transform: translateY(100%);
    }
    .drawer.open { transform: translateY(0); }
    .drawer-head { padding: 18px 18px 12px; }
    .drawer-head::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        width: 40px;
        height: 4px;
        margin-left: -20px;
        border-radius: 99px;
        background: var(--line-strong);
    }
    .drawer-body { padding: 0 18px 16px; }
    .drawer-foot { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
    .drawer-item { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
    .drawer-thumb { width: 48px; height: 48px; }
    .drawer-item .stepper { width: auto; height: 34px; padding: 3px; }
    .drawer-item .stepper button { width: 28px; height: 28px; }

    .lightbox figcaption { flex-direction: column; gap: 4px; }
}

@media (hover: none) {
    .card:hover { transform: none; box-shadow: var(--shadow-card); }
    .card:hover .card-img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
    .hero { background: none; color: var(--ink); }
    .hero::before, .hero-glow, .hero-contact, .toolbar, .catalog-head, .card-action, .cart-fab, .drawer, .drawer-backdrop, .toast { display: none !important; }
    .hero h1, .hero-stats dd, .brand-name { color: var(--ink); }
    .card { break-inside: avoid; box-shadow: none; }
    .card-img { opacity: 1; }
}
