/* ============================================================
   RELAX SHOP — ПОЛНЫЙ STYLE.CSS (Финальная версия)
   ============================================================ */

/* ===== БАЗА ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    /* Необычный градиентный фон */
    background: linear-gradient(135deg, #e0f2fe 0%, #f3e8ff 50%, #ffe4e6 100%);
    background-attachment: fixed;
    color: #111827;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ============================================================
   ===== HEADER (Эффект стекла) ===============================
   ============================================================ */
header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
}

.logo { display: flex; flex-direction: column; line-height: 1; }
.logo .relax { color: #111827; font-size: 22px; font-weight: 900; letter-spacing: 1px; }
.logo .shop { color: #dc2626; font-size: 13px; font-weight: 700; letter-spacing: 5px; margin-top: 2px; }

.nav-right { display: flex; align-items: center; gap: 15px; color: #64748b; font-size: 13px; }
.nav-cart { position: relative; font-size: 22px; color: #111827; }
.cart-badge {
    position: absolute; top: -6px; right: -10px;
    background: #dc2626; color: white; font-size: 11px; font-weight: 900;
    padding: 2px 6px; border-radius: 999px; min-width: 18px; text-align: center;
}

/* ============================================================
   ===== MAIN =================================================
   ============================================================ */
main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    padding-bottom: 60px;
}

/* ============================================================
   ===== ГЛАВНАЯ: КАТЕГОРИИ ===================================
   ============================================================ */
.category-section { margin: 30px 0; }
.category-title { font-size: 18px; font-weight: 800; color: #111827; margin-bottom: 15px; }
.category-buttons { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.category-buttons::-webkit-scrollbar { display: none; }

.category-btn {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: transparent; border: none; cursor: pointer; flex-shrink: 0; width: 80px;
}

.cat-icon-circle {
    width: 70px; height: 70px; border-radius: 50%;
    background: #ffffff; border: 1px solid #e5e7eb;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); overflow: hidden; padding: 12px;
}

.cat-icon-circle img { width: 100%; height: 100%; object-fit: contain; }
.category-btn.active .cat-icon-circle { border: 2px solid #dc2626; }
.cat-name { font-size: 12px; font-weight: 600; color: #111827; text-align: center; }

/* ============================================================
   ===== ГЛАВНАЯ: ТОВАРЫ ======================================
   ============================================================ */
.products-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 15px; margin-bottom: 40px;
}
@media (min-width: 700px) { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
    background: #ffffff; border-radius: 24px; padding: 15px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); position: relative;
}

.product-card-link { display: flex; flex-direction: column; align-items: center; width: 100%; }
.product-image {
    width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden;
    margin-bottom: 15px; background: #f8fafc;
    display: flex; align-items: center; justify-content: center;
}
.product-image img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.product-name { color: #111827; font-size: 14px; font-weight: 800; margin-bottom: 8px; line-height: 1.3; min-height: 40px; }
.product-old-price { color: #9ca3af; font-size: 13px; font-weight: 600; text-decoration: line-through; margin-bottom: 2px; }
.product-price { color: #dc2626; font-size: 17px; font-weight: 900; margin-bottom: 10px; }
.product-category-tag { display: inline-block; padding: 5px 14px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 999px; color: #9ca3af; font-size: 11px; font-weight: 600; margin-bottom: 15px; }
.product-btn {
    display: inline-block; padding: 12px 15px; background: #dc2626; color: white;
    border-radius: 999px; font-size: 14px; font-weight: 700; width: 100%;
    text-align: center; margin-top: auto; border: none; cursor: pointer;
}

/* ============================================================
   ===== СТРАНИЦА ТОВАРА ======================================
   ============================================================ */
.breadcrumbs { padding: 20px 0; color: #64748b; font-size: 14px; }
.breadcrumbs a { color: #dc2626; }

.product-detail { display: flex; flex-direction: column; gap: 30px; margin: 20px 0 60px; }
@media (min-width: 768px) {
    .product-detail { flex-direction: row; gap: 50px; align-items: flex-start; }
    .product-detail-left { width: 45%; position: sticky; top: 20px; }
    .product-detail-right { width: 55%; }
}

.gallery-main {
    position: relative; width: 100%; aspect-ratio: 1; border-radius: 24px;
    overflow: hidden; background: #ffffff; border: 1px solid #e5e7eb;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; padding: 20px; }
.gallery-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; background: rgba(255,255,255,0.95);
    border: 1px solid #e5e7eb; border-radius: 50%; color: #111827;
    font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    z-index: 10; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.gallery-prev { left: 15px; }
.gallery-next { right: 15px; }
.gallery-counter {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%);
    padding: 6px 16px; background: rgba(255,255,255,0.95); border-radius: 999px;
    color: #111827; font-size: 13px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 15px; }
.product-detail-title { font-size: 32px; font-weight: 900; color: #111827; line-height: 1.2; margin: 0; flex: 1; }
.product-close-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background: #ffffff; border: 2px solid #f97316;
    border-radius: 12px; color: #f97316; font-size: 24px; font-weight: 900;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.15); transition: all 0.2s; flex-shrink: 0;
}
.product-close-btn:hover { background: #f97316; color: #ffffff; }

.product-detail-price { font-size: 36px; font-weight: 900; color: #dc2626; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.product-detail-price::before { content: attr(data-old-price); color: #9ca3af; font-size: 20px; font-weight: 600; text-decoration: line-through; margin-right: 10px; }
.product-detail-mg { display: inline-block; padding: 8px 16px; background: #fef2f2; border: 1.5px solid #dc2626; border-radius: 12px; color: #dc2626; font-size: 15px; font-weight: 700; margin-bottom: 25px; }
.product-detail-mg strong { color: #111827; font-weight: 900; }
.product-detail-desc { color: #4b5563; font-size: 16px; line-height: 1.6; margin-bottom: 30px; }

.flavors-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: #111827; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #f1f5f9; }
.flavors-title-line { width: 4px; height: 20px; background: #dc2626; border-radius: 2px; }

.tile-flavors { display: flex; flex-direction: column; gap: 12px; }
.tile { display: flex; flex-direction: column; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 15px; transition: border-color 0.2s; }
.tile:hover { border-color: #dc2626; }
.tile-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tile-name { font-size: 15px; font-weight: 700; color: #111827; }
.tile-stock { font-size: 12px; font-weight: 700; color: #16a34a; background: #f0fdf4; padding: 4px 8px; border-radius: 6px; }
.tile-stock-out { color: #dc2626; background: #fef2f2; }
.tile-body { display: flex; align-items: center; gap: 12px; }
.tile-qty { display: flex; align-items: center; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; height: 36px; }
.tile-qty-btn { width: 32px; height: 100%; background: #f8fafc; border: none; color: #64748b; font-size: 18px; font-weight: 700; cursor: pointer; }
.tile-qty-btn:hover { background: #e2e8f0; }
.tile-qty-input { width: 40px; height: 100%; border: none; border-left: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; text-align: center; font-size: 15px; font-weight: 700; color: #111827; outline: none; }
.tile-add { flex: 1; height: 36px; background: #dc2626; color: white; border: none; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; text-transform: uppercase; }
.tile-add:hover { background: #b91c1c; }
.tile-add:disabled { background: #16a34a; }
.tile-out { opacity: 0.5; background: #f8fafc; }
.tile-body-out { justify-content: center; padding: 8px; }
.tile-body-out span { font-size: 13px; font-weight: 700; color: #9ca3af; text-transform: uppercase; }

/* ============================================================
   ===== КОРЗИНА ==============================================
   ============================================================ */
.cart-section { max-width: 1000px; margin: 0 auto; padding: 40px 0 80px; }
.cart-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.cart-title { font-size: 32px; font-weight: 900; color: #111827; margin: 0; }
.cart-clear-link { color: #94a3b8; font-size: 14px; font-weight: 600; text-decoration: none; transition: color 0.2s; }
.cart-clear-link:hover { color: #dc2626; }

.cart-content-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .cart-content-grid { grid-template-columns: 1.2fr 0.8fr; align-items: start; } }

.cart-items-list { display: flex; flex-direction: column; gap: 15px; }
.cart-item { display: flex; align-items: center; gap: 15px; background: #ffffff; border-radius: 20px; padding: 15px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); }
.cart-item-preorder { border: 1px solid rgba(160, 80, 220, 0.3); }
.cart-item-photo { width: 80px; height: 80px; border-radius: 12px; background: #f8fafc; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.cart-item-photo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.cart-item-photo span { font-size: 32px; opacity: 0.5; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 16px; font-weight: 800; color: #111827; margin-bottom: 4px; line-height: 1.3; }
.cart-preorder-tag { display: inline-block; font-size: 10px; font-weight: 800; color: #fff; background: #a050dc; padding: 2px 6px; border-radius: 4px; vertical-align: middle; margin-left: 5px; text-transform: uppercase; }
.cart-item-flavor { font-size: 13px; color: #4f46e5; font-weight: 600; margin-bottom: 4px; }
.cart-item-arrival { font-size: 12px; color: #16a34a; margin-bottom: 4px; }
.cart-item-price { font-size: 13px; color: #64748b; }

.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.cart-item-subtotal { font-size: 18px; font-weight: 900; color: #111827; white-space: nowrap; }
.cart-item-remove { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: #f4f7fc; color: #94a3b8; transition: all 0.2s; }
.cart-item-remove:hover { background: #fee2e2; color: #dc2626; }

.cart-summary { background: #ffffff; border-radius: 20px; padding: 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); position: sticky; top: 20px; }
.cart-summary-title { font-size: 18px; font-weight: 800; color: #111827; margin-bottom: 20px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 14px; color: #64748b; margin-bottom: 12px; }
.text-muted { color: #94a3b8; font-size: 13px; }
.cart-summary-divider { height: 1px; background: #f1f5f9; margin: 20px 0; }
.cart-summary-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 20px; }
.cart-summary-total strong { font-size: 28px; font-weight: 900; color: #dc2626; }
.cart-summary-warn { font-size: 12px; color: #a050dc; background: rgba(160, 80, 220, 0.1); padding: 10px; border-radius: 8px; margin-bottom: 20px; line-height: 1.4; }
.cart-checkout-btn { display: flex; justify-content: center; align-items: center; width: 100%; padding: 16px; background: #dc2626; color: white; border-radius: 14px; font-size: 16px; font-weight: 800; text-decoration: none; margin-bottom: 15px; transition: background 0.2s; }
.cart-checkout-btn:hover { background: #b91c1c; }
.cart-continue-link { display: block; text-align: center; font-size: 14px; color: #64748b; text-decoration: none; }
.cart-continue-link:hover { color: #111827; }

.cart-empty { text-align: center; background: #ffffff; border-radius: 20px; padding: 60px 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); }
.cart-empty-icon { font-size: 64px; opacity: 0.2; margin-bottom: 20px; }
.cart-empty h2 { font-size: 24px; font-weight: 900; color: #111827; margin-bottom: 10px; }
.cart-empty p { font-size: 15px; color: #64748b; margin-bottom: 30px; }

/* ============================================================
   ===== ОФОРМЛЕНИЕ ЗАКАЗА (CHECKOUT) =========================
   ============================================================ */
.co-section { max-width: 1000px; margin: 0 auto; padding: 20px 0 80px; }
.co-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.co-title { font-size: 28px; font-weight: 900; color: #111827; margin: 0; }
.co-back-btn { padding: 10px 20px; background: rgba(255,255,255,0.6); color: #64748b; border-radius: 999px; font-size: 14px; font-weight: 600; transition: background 0.2s; }
.co-back-btn:hover { background: rgba(255,255,255,0.9); }

.co-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .co-grid { grid-template-columns: 1.2fr 0.8fr; align-items: start; } }

.co-form { display: flex; flex-direction: column; gap: 20px; }
.co-form-block { background: #ffffff; border-radius: 20px; padding: 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); }
.co-form-block-title { font-size: 18px; font-weight: 800; color: #111827; margin-bottom: 20px; }

.co-radio-group { display: flex; flex-direction: column; gap: 15px; margin-bottom: 15px; }
.co-radio-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; color: #111827; }
.co-radio-input { display: none; }
.co-radio-custom { width: 20px; height: 20px; border: 2px solid #4f46e5; border-radius: 50%; position: relative; flex-shrink: 0; }
.co-radio-input:checked + .co-radio-custom::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; background: #4f46e5; border-radius: 50%; }

.co-pay-desc, .co-pickup-desc { font-size: 13px; color: #64748b; line-height: 1.5; margin-bottom: 15px; padding-left: 32px; }

.co-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.co-field label { font-size: 14px; font-weight: 600; color: #111827; }
.co-req { color: #dc2626; }
.co-field input, .co-field textarea { width: 100%; padding: 15px 20px; background: #f4f7fc; border: none; border-radius: 14px; font-size: 15px; color: #111827; outline: none; transition: box-shadow 0.2s; font-family: inherit; }
.co-field input:focus, .co-field textarea:focus { box-shadow: 0 0 0 2px #4f46e5; }
.co-field input::placeholder, .co-field textarea::placeholder { color: #94a3b8; }

.co-tg-input { display: flex; align-items: center; background: #f4f7fc; border: none; border-radius: 14px; overflow: hidden; }
.co-tg-prefix { padding: 0 10px 0 16px; color: #94a3b8; font-size: 15px; font-weight: 700; }
.co-tg-input input { border: none; background: transparent; padding-left: 0; }

.co-submit { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 18px; background: #dc2626; color: white; border: none; border-radius: 16px; font-size: 16px; font-weight: 800; cursor: pointer; transition: background 0.2s; text-transform: uppercase; }
.co-submit:hover { background: #b91c1c; }

.co-summary { background: #ffffff; border-radius: 20px; padding: 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); position: sticky; top: 20px; }
.co-summary-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; border-bottom: 1px solid #f1f5f9; padding-bottom: 15px; }
.co-summary-title { font-size: 16px; font-weight: 800; color: #111827; }
.co-summary-count { font-size: 13px; color: #94a3b8; }
.co-summary-items { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }
.co-summary-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.co-summary-name { font-size: 14px; font-weight: 600; color: #111827; }
.co-summary-qty { font-size: 12px; color: #64748b; margin-top: 4px; }
.co-summary-price { font-size: 14px; font-weight: 700; color: #111827; white-space: nowrap; }
.co-summary-divider { height: 1px; background: #f1f5f9; margin: 15px 0; }
.co-summary-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; font-weight: 700; color: #111827; }
.co-summary-total strong { font-size: 24px; font-weight: 900; color: #dc2626; }
.co-summary-note { margin-top: 15px; font-size: 11px; color: #94a3b8; text-align: center; }

/* ============================================================
   ===== FOOTER ===============================================
   ============================================================ */
footer { background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(12px); padding: 30px 20px; text-align: center; border-top: 1px solid rgba(255,255,255,0.5); }
.footer-title { color: #64748b; font-size: 13px; margin-bottom: 5px; }
.footer-note { color: #9ca3af; font-size: 11px; }