/* ============================================================
   CoreCart Default — витрина
   ============================================================ */
:root {
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: #eff6ff;
    --text: #0f172a;
    --text-2: #64748b;
    --border: #e2e8f0;
    --bg-soft: #f8fafc;
    --danger: #dc2626;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(15,23,42,.08);
    --shadow-hover: 0 8px 24px rgba(15,23,42,.12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: #fff;
    font-size: 15px;
    line-height: 1.55;
}

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 440px; }
.center { text-align: center; }
.muted { color: var(--text-2); }

/* ---------- Header ---------- */
.site-header {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(8px);
    z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 24px; padding: 14px 20px; }
.logo { font-size: 21px; font-weight: 800; text-decoration: none; color: var(--text); letter-spacing: -.02em; }
.logo em { color: var(--accent); font-style: normal; }

.search-form { flex: 1; max-width: 520px; position: relative; }
.search-form input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-soft) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" stroke="%2394a3b8" stroke-width="2"><circle cx="7" cy="7" r="5"/><path d="m11 11 4 4"/></svg>') 14px center no-repeat;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.search-form input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: #fff;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-2);
    font-weight: 600;
    font-size: 14px;
    transition: background .12s, color .12s;
}
.main-nav a:hover { background: var(--bg-soft); color: var(--text); }
.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.nav-categories {
    border-top: 1px solid var(--border);
    background: #fff;
}
.nav-categories .container { display: flex; gap: 4px; overflow-x: auto; padding-top: 0; padding-bottom: 0; }
.nav-categories a {
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.nav-categories a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
    margin: 24px 0 8px;
    border-radius: 18px;
    padding: 56px 48px;
    background: linear-gradient(120deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -60px; top: -60px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.hero h1 { margin: 0 0 10px; font-size: 36px; font-weight: 800; letter-spacing: -.02em; max-width: 640px; }
.hero p { margin: 0 0 24px; font-size: 16px; color: #cbd5e1; max-width: 520px; }
.hero .btn-cta {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 26px;
    background: #fff;
    color: var(--accent-dark);
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .12s, box-shadow .12s;
}
.hero .btn-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.25); }

/* ---------- Blocks ---------- */
.block { margin: 40px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.block-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.block-head a { font-size: 13px; font-weight: 600; text-decoration: none; }

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

.cat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cat-card:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.cat-card .cat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.cat-card b { display: block; font-size: 15px; }
.cat-card small { color: var(--text-2); font-size: 12px; }

.brands-row { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-link {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-2);
    font-weight: 600;
    font-size: 14px;
    transition: border-color .12s, color .12s;
}
.badge-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Advantages ---------- */
.advantages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.adv {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    background: var(--bg-soft);
}
.adv .adv-icon { font-size: 24px; margin-bottom: 10px; }
.adv b { display: block; margin-bottom: 4px; font-size: 14px; }
.adv span { font-size: 13px; color: var(--text-2); }
@media (max-width: 900px) { .advantages { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .advantages { grid-template-columns: 1fr; } }

/* ---------- Products ---------- */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.products-grid .product-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.products-grid .product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: transparent; }
.product-thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .no-img { color: #cbd5e1; font-size: 40px; font-weight: 800; }
.product-name { text-decoration: none; color: inherit; font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.product-name:hover { color: var(--accent); }
.product-price b { font-size: 18px; }
.product-price s { color: var(--text-2); margin-right: 8px; font-size: 13px; }
.product-price.big b { font-size: 30px; }
.product-badge {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    color: var(--danger);
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    height: 38px;
    padding: 0 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: background .12s;
}
.btn-buy:hover { background: var(--accent-dark); }
.btn-buy:disabled { background: #cbd5e1; cursor: default; }
.btn-buy.big { height: 48px; padding: 0 28px; font-size: 15px; }
.btn-ghost {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-fav { background: none; border: 1px solid var(--border); border-radius: 10px; height: 38px; padding: 0 14px; cursor: pointer; font-family: inherit; }
.btn-fav:hover { border-color: var(--danger); color: var(--danger); }
.btn-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 14px; font-family: inherit; }
.btn-remove:hover { text-decoration: underline; }

/* ---------- Catalog ---------- */
.catalog { display: grid; grid-template-columns: 260px 1fr; gap: 28px; margin-top: 16px; }
.filters { border-right: 1px solid var(--border); padding-right: 20px; }
.filters h3 { margin-top: 0; font-size: 15px; }
.filter-group { margin-bottom: 18px; }
.filter-group > label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.filter-group input[type=number], .filter-group select {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    font-family: inherit;
}
.filter-group .checkbox { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 13.5px; margin-bottom: 4px; }
.filter-group input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); }

.sort-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sort-bar select { height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; }

.breadcrumbs { font-size: 13px; color: var(--text-2); margin: 16px 0; }
.breadcrumbs a { color: var(--accent); text-decoration: none; }

/* ---------- Product page ---------- */
.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.main-image { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.main-image.no-image {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 72px;
    font-weight: 800;
    background: var(--bg-soft);
}
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumbs img { width: 68px; height: 68px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; }
.thumbs img:hover { border-color: var(--accent); }
.meta { color: var(--text-2); font-size: 13px; margin: 6px 0 14px; }
.buy-block { display: flex; flex-direction: column; gap: 10px; max-width: 340px; margin: 18px 0; }
.buy-block select, .buy-block input { height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 14px; }
.specs { width: 100%; border-collapse: collapse; margin-top: 18px; }
.specs td { padding: 9px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
.specs td:first-child { color: var(--text-2); width: 45%; }

/* ---------- Cart ---------- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.cart-table th { font-size: 12px; text-transform: uppercase; color: var(--text-2); letter-spacing: .04em; }
.qty-form { display: flex; gap: 6px; align-items: center; }
.qty-form input { width: 64px; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; text-align: center; }
.cart-footer { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 24px; flex-wrap: wrap; gap: 20px; }
.coupon-form { display: flex; gap: 8px; }
.coupon-form input { height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; }
.coupon-form button { height: 38px; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 600; }
.coupon-form button:hover { border-color: var(--accent); color: var(--accent); }
.cart-totals { text-align: right; min-width: 240px; }
.cart-totals .total { font-size: 22px; font-weight: 800; margin: 10px 0; }

/* ---------- Checkout ---------- */
.checkout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; align-items: start; }
.section-title { font-size: 15px; font-weight: 700; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.section-title:first-child { margin-top: 0; }

.checkout-form label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); }
.checkout-form input[type=text], .checkout-form input[type=tel],
.checkout-form input[type=email], .checkout-form textarea {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color .12s, box-shadow .12s;
}
.checkout-form textarea { height: auto; padding: 10px 13px; }
.checkout-form input:focus, .checkout-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color .12s, background .12s;
    margin: 0 !important;
}
.option-card:hover { border-color: var(--text-2); }
.option-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option-card input[type=radio] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.option-body { display: flex; flex-direction: column; gap: 2px; }
.option-name { font-weight: 600; color: var(--text); font-size: 14px; }
.option-price { font-size: 13px; color: var(--text-2); font-weight: 600; }

.checkbox.agree {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 20px 0;
    font-weight: 400;
    color: var(--text);
    font-size: 14px;
}
.checkbox.agree input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); }

.checkout-summary {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 90px;
}
.checkout-summary h3 { margin: 0 0 14px; }
.summary-item { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; }
.summary-item span { color: var(--text-2); }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: var(--text-2); }
.summary-row.discount span:last-child { color: var(--success, #16a34a); }
.summary-row.total { font-size: 18px; font-weight: 800; color: var(--text); border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
.checkout-summary hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ---------- Forms / auth ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.catalog-list { min-width: 0; }
.product-gallery, .product-info { min-width: 0; }
.auth-form label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.auth-form input {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 6px;
    font-size: 14px;
    font-family: inherit;
}
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-form .btn-buy { width: 100%; }

/* ---------- Account ---------- */
.account { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.account-nav {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    background: #fff;
    position: sticky;
    top: 90px;
}
.account-nav .user-block { padding: 14px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.account-nav .user-block b { display: block; font-size: 15px; }
.account-nav .user-block .muted { font-size: 12px; }
.account-nav .user-block .bonus { margin-top: 6px; font-size: 13px; color: var(--accent); font-weight: 700; }
.account-nav a, .account-nav button {
    display: flex;
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--text-2);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    align-items: center;
    gap: 8px;
}
.account-nav a:hover, .account-nav button:hover { background: var(--bg-soft); color: var(--text); }
.account-nav a.active { background: var(--accent-soft); color: var(--accent); }
.account-nav form { margin: 0; }
.account-nav .logout { color: var(--danger); }

.account-panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; background: #fff; }
.account-panel h3 { margin: 0 0 16px; font-size: 16px; }
.account-panel label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); }
.account-panel input[type=text], .account-panel input[type=tel],
.account-panel input[type=email], .account-panel input[type=password] {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 6px;
    font-size: 14px;
    font-family: inherit;
}
.account-panel input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.account-panel .form-grid > div { align-self: end; }
.order-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.order-card .order-num { font-weight: 700; }
.order-card .order-total { font-size: 17px; font-weight: 800; }
.badge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: #94a3b8; }

/* ---------- Alerts / pagination / footer ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin: 12px 0; font-weight: 500; }
.alert.success { background: #dcfce7; color: #14532d; }
.alert.error { background: #fee2e2; color: #7f1d1d; }

.pagination { display: flex; gap: 6px; margin-top: 22px; }
.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 56px;
    padding: 28px 0;
    color: var(--text-2);
    font-size: 14px;
    background: var(--bg-soft);
}

.reviews { margin-top: 32px; }
.review { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.review .stars { color: #f59e0b; margin-left: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
    .catalog, .product-page, .checkout, .account, .form-grid { grid-template-columns: 1fr; }
    .options-grid { grid-template-columns: 1fr; }
    .filters { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 18px; }
    .header-inner { flex-wrap: wrap; gap: 12px; }
    .search-form { order: 3; flex-basis: 100%; max-width: none; }
    .hero { padding: 36px 28px; }
    .hero h1 { font-size: 26px; }
    .account-nav { position: static; }
    .checkout-summary { position: static; }
}
