/* ============================================
   Респиратор — Электронное меню
   Тема: Dark + Neon
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Inter:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #09090f;
    --bg2:       #0e0e1a;
    --bg3:       #13131f;
    --border:    #1c1c30;
    --neon:      #00c8ff;
    --neon-dim:  rgba(0, 200, 255, 0.12);
    --pink:      #ff3cac;
    --pink-dim:  rgba(255, 60, 172, 0.15);
    --text:      #e2e2f0;
    --text-dim:  #666688;
    --text-mid:  #9999bb;
    --radius:    10px;
    --shadow:    0 4px 24px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 90px;
}

/* ---- HEADER ---- */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(9,9,15,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    text-align: center;
    padding: 18px 16px 14px;
}
.header-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% -20%, rgba(0,200,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.logo-svg { width: 220px; height: auto; display: block; margin: 0 auto; }
.logo-sub {
    font-family: 'Orbitron', monospace;
    font-size: 11px; letter-spacing: 5px;
    color: var(--pink);
    text-shadow: 0 0 10px rgba(255,60,172,0.5);
    text-transform: uppercase;
    margin-top: 4px;
}
.header-line {
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,200,255,0.25), rgba(255,60,172,0.2), transparent);
    margin-top: 12px;
}

/* Малый хедер для страницы товара */
.header-small { padding: 12px 16px; display: flex; align-items: center; justify-content: center; }
.back-btn {
    position: absolute; left: 16px;
    color: var(--neon); text-decoration: none; font-size: 14px;
    opacity: 0.8; transition: opacity .2s;
}
.back-btn:hover { opacity: 1; }
.logo-small {
    font-family: 'Orbitron', monospace;
    font-size: 15px; letter-spacing: 3px; color: var(--neon);
    text-shadow: 0 0 10px rgba(0,200,255,0.4);
}

/* ---- SEARCH ---- */
.search-wrap { padding: 14px 16px 0; }
.search-bar {
    position: relative;
}
.search-bar input {
    width: 100%;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 36px 10px 38px;
    color: var(--text); font-size: 14px; outline: none;
    transition: border-color .2s;
    font-family: 'Inter', sans-serif;
}
.search-bar input:focus { border-color: rgba(0,200,255,0.3); }
.search-bar input::placeholder { color: var(--text-dim); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; }
.search-clear {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-dim); text-decoration: none; font-size: 14px; line-height: 1;
}

/* ---- CATEGORIES ---- */
.cats-wrap { padding: 12px 0 0; }
.cats {
    display: flex; gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat-btn {
    flex-shrink: 0; padding: 7px 16px;
    border-radius: 20px; border: 1px solid var(--border);
    background: var(--bg2); color: var(--text-mid);
    font-size: 13px; text-decoration: none;
    white-space: nowrap; transition: all .2s;
    font-family: 'Inter', sans-serif; cursor: pointer;
}
.cat-btn.active {
    border-color: var(--neon); color: var(--neon);
    background: var(--neon-dim);
    text-shadow: 0 0 8px rgba(0,200,255,0.4);
}
.cat-btn:hover:not(.active) { border-color: #2a2a44; color: var(--text); }

/* ---- SECTION TITLE ---- */
.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 11px; letter-spacing: 3px;
    color: var(--pink); text-transform: uppercase;
    padding: 20px 16px 10px;
    text-shadow: 0 0 10px rgba(255,60,172,0.35);
}

/* ---- CARDS ---- */
.main { padding-bottom: 16px; }
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 10px; padding: 0 16px;
}

.card {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column;
    transition: border-color .2s, transform .2s;
}
.card:hover { border-color: rgba(0,200,255,0.25); transform: translateY(-2px); }
.card:active { transform: translateY(0); }

.card-img {
    width: 100%; aspect-ratio: 1;
    background: var(--bg3);
    overflow: hidden; position: relative;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px;
}

.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.card-name { font-size: 13px; font-weight: 500; line-height: 1.35; margin-bottom: 3px; }
.card-weight { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }

.card-price-row { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: auto; }
.card-price {
    font-family: 'Orbitron', monospace;
    font-size: 14px; font-weight: 700;
    color: var(--neon);
    text-shadow: 0 0 8px rgba(0,200,255,0.3);
}
.price-second { color: rgba(0,200,255,0.6); }
.price-label { font-size: 10px; font-family: 'Inter', sans-serif; color: var(--text-dim); }

/* ---- EMPTY ---- */
.empty-state {
    text-align: center; padding: 60px 16px;
    color: var(--text-dim);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ---- CART BAR ---- */
.cart-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: var(--bg2); border-top: 1px solid var(--border);
    padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
.cart-bar.pulse { animation: pulse .3s ease; }
@keyframes pulse { 0%,100%{transform:none} 50%{transform:scale(1.02)} }

.cart-count { font-size: 12px; color: var(--text-dim); }
.cart-total {
    font-family: 'Orbitron', monospace;
    font-size: 16px; color: var(--neon);
    text-shadow: 0 0 8px rgba(0,200,255,0.3);
}
.cart-btn {
    background: var(--neon-dim); border: 1px solid rgba(0,200,255,0.3);
    color: var(--neon); padding: 10px 20px; border-radius: 8px;
    font-size: 14px; cursor: pointer; letter-spacing: 0.5px;
    transition: all .2s; font-family: 'Inter', sans-serif;
}
.cart-btn:hover { background: rgba(0,200,255,0.2); border-color: var(--neon); }

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    display: flex; align-items: flex-end; justify-content: center;
}
.modal {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    width: 100%; max-width: 600px;
    max-height: 80vh; display: flex; flex-direction: column;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-title {
    font-family: 'Orbitron', monospace; font-size: 12px;
    letter-spacing: 2px; color: var(--pink);
}
.modal-close {
    background: none; border: none; color: var(--text-dim);
    font-size: 18px; cursor: pointer; padding: 0;
}
.modal-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); }
.modal-note {
    font-size: 13px; color: var(--text-dim); margin-bottom: 10px; text-align: center;
}

.cart-empty { text-align: center; color: var(--text-dim); padding: 30px 0; }

.cart-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.cart-item-name { font-size: 14px; font-weight: 500; }
.cart-item-price { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.cart-item-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cart-item-controls button {
    width: 28px; height: 28px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg3);
    color: var(--text); font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s;
}
.cart-item-controls button:hover { border-color: var(--neon); color: var(--neon); }
.cart-item-controls span { min-width: 20px; text-align: center; font-size: 14px; }
.remove-btn { color: var(--text-dim) !important; font-size: 13px !important; }

.cart-total-row {
    padding: 14px 0 4px; font-size: 15px; color: var(--text-mid);
    text-align: right;
}
.cart-total-row strong {
    font-family: 'Orbitron', monospace; color: var(--neon);
    text-shadow: 0 0 8px rgba(0,200,255,0.3);
}
.clear-btn {
    width: 100%; padding: 10px;
    background: none; border: 1px solid rgba(255,60,172,0.2);
    color: rgba(255,60,172,0.6); border-radius: 8px;
    cursor: pointer; font-size: 13px;
    transition: all .2s; font-family: 'Inter', sans-serif;
}
.clear-btn:hover { border-color: var(--pink); color: var(--pink); }

/* ---- PRODUCT PAGE ---- */
.product-page { padding-bottom: 90px; }
.product-main { max-width: 600px; margin: 0 auto; }

.product-img-wrap { width: 100%; aspect-ratio: 4/3; overflow: hidden; }
.product-img { width: 100%; height: 100%; object-fit: cover; }
.product-img-placeholder {
    width: 100%; height: 100%;
    background: var(--bg3); display: flex; align-items: center;
    justify-content: center; font-size: 90px;
}

.product-info { padding: 20px 16px; }
.product-cat { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.product-name {
    font-family: 'Inter', sans-serif;
    font-size: 22px; font-weight: 700; line-height: 1.25;
    color: var(--text); margin-bottom: 8px;
}
.product-weight { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.product-desc {
    font-size: 14px; color: var(--text-mid); line-height: 1.65;
    margin-bottom: 20px;
    border-left: 2px solid rgba(0,200,255,0.2);
    padding-left: 12px;
}

/* Цена на странице товара */
.product-price-block { margin-bottom: 20px; }
.product-price {
    font-family: 'Orbitron', monospace;
    font-size: 26px; font-weight: 700;
    color: var(--neon); text-shadow: 0 0 12px rgba(0,200,255,0.35);
}
.price-prefix { font-size: 14px; color: var(--text-dim); font-family: 'Inter', sans-serif; }

.price-options { display: flex; gap: 0; }
.price-option {
    flex: 1; text-align: center;
    padding: 14px 10px;
    background: var(--bg3); border: 1px solid var(--border);
}
.price-option:first-child { border-radius: 8px 0 0 8px; }
.price-option:last-child  { border-radius: 0 8px 8px 0; border-left: none; }
.price-opt-label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.price-opt-val {
    font-family: 'Orbitron', monospace; font-size: 18px; font-weight: 700;
    color: var(--neon); text-shadow: 0 0 8px rgba(0,200,255,0.3);
}
.price-divider { width: 1px; background: var(--border); }

/* Кнопка добавить */
.add-to-cart-btn {
    width: 100%; padding: 14px;
    background: var(--neon-dim); border: 1px solid rgba(0,200,255,0.35);
    color: var(--neon); border-radius: 10px;
    font-size: 15px; font-weight: 600;
    cursor: pointer; letter-spacing: 0.5px;
    transition: all .2s; font-family: 'Inter', sans-serif;
}
.add-to-cart-btn:hover { background: rgba(0,200,255,0.2); border-color: var(--neon); }
.add-to-cart-btn.added { background: rgba(0,255,120,0.1); border-color: #00ff7888; color: #00ff78; }

/* Похожие */
.related { padding: 0 0 20px; }
.related-list { display: flex; flex-direction: column; gap: 0; padding: 0 16px; }
.related-item {
    display: block; padding: 12px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-mid); text-decoration: none;
    font-size: 14px; transition: color .15s;
}
.related-item:hover { color: var(--neon); }

/* ---- RESPONSIVE ---- */
@media (min-width: 600px) {
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (min-width: 900px) {
    .logo-svg { width: 300px; }
    .logo-main { font-size: 36px; }
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
