/* ---------- Палитра и базовые переменные (в духе Wildberries) ---------- */
:root {
    --accent: #1a9d5b;
    --accent-dark: #147a46;
    --accent-light: #e3f6ec;
    --text: #1a1a1a;
    --text-muted: #75757a;
    --bg-soft: #f5f5f7;
    --border: #e7e7ea;
    --star: #ffa900;
    --heart: #e0293c;
    --radius: 10px;
    --radius-lg: 14px;

    --bs-primary: var(--accent);
    --bs-primary-rgb: 26, 157, 91;
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: 26, 157, 91;
    --bs-link-hover-color: var(--accent-dark);
    --bs-link-hover-color-rgb: 20, 122, 70;
    --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bs-body-color: var(--text);
    --bs-border-radius: var(--radius);
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: var(--radius-lg);
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: #fff;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

a {
    text-decoration: none;
}

.page-content {
    flex: 1 0 auto;
    width: 100%;
    padding-top: 1.75rem;
    padding-bottom: 3rem;
}

/* ---------- Хедер ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
    z-index: 1030;
    flex-shrink: 0;
}

.site-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
    margin-right: 1.5rem;
    white-space: nowrap;
}

.site-logo:hover {
    color: var(--accent-dark);
}

.site-search {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.35rem 0.5rem 0.35rem 1rem;
    max-width: 720px;
    transition: border-color .15s ease;
}

.site-search:focus-within {
    border-color: var(--accent);
    background: #fff;
}

.site-search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.site-search input {
    border: 0;
    background: transparent;
    outline: none;
    flex: 1 1 auto;
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
    color: var(--text);
    min-width: 0;
}

.site-search button {
    border: 0;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    transition: background-color .15s ease;
}

.site-search button:hover {
    background: var(--accent-dark);
}

.header-icons {
    gap: 0.25rem;
    margin-left: 1rem;
}

.icon-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text);
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius);
    position: relative;
    font-size: 0.9rem;
    white-space: nowrap;
}

.icon-link:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.icon-link svg {
    flex-shrink: 0;
}

.icon-label {
    font-size: 0.85rem;
}

.icon-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.28em 0.5em;
    border-radius: 999px;
    position: relative;
    top: -8px;
    margin-left: -0.6rem;
}

@media (min-width: 992px) {
    .icon-label { display: none; }
    .icon-link { padding: 0.5rem; }
}

.dropdown-menu {
    border-radius: var(--radius);
    border-color: var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    min-width: 220px;
}

.dropdown-header {
    font-weight: 700;
    color: var(--text);
    font-size: 0.85rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: var(--accent-light);
    color: var(--accent-dark);
}

/* ---------- Кнопки ---------- */
.btn {
    font-weight: 600;
    border-radius: var(--radius);
    padding: 0.55rem 1.15rem;
    font-size: 0.92rem;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease, color .15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    padding: 0.36rem 0.8rem;
    font-size: 0.82rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 0.8rem 1.6rem;
    font-size: 1.05rem;
    border-radius: 12px;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 1px 2px rgba(26, 157, 91, 0.25);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--accent-dark) !important;
    border-color: var(--accent-dark) !important;
    box-shadow: 0 4px 12px rgba(26, 157, 91, 0.3) !important;
}

.btn-primary:disabled {
    background: var(--border);
    border-color: var(--border);
    color: var(--text-muted);
    box-shadow: none;
}

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
    background: #fff;
}

.btn-outline-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-secondary, .btn-outline-secondary {
    color: var(--text);
    border-color: var(--border);
    background: #fff;
}

.btn-secondary:hover, .btn-outline-secondary:hover {
    background: var(--bg-soft);
    border-color: #c9c9cf;
    color: var(--text);
}

.btn-success {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 1px 2px rgba(26, 157, 91, 0.25);
}

.btn-success:hover, .btn-success:focus, .btn-success:active {
    background: var(--accent-dark) !important;
    border-color: var(--accent-dark) !important;
    box-shadow: 0 4px 12px rgba(26, 157, 91, 0.3) !important;
}

.btn-danger {
    background: #e0293c;
    border-color: #e0293c;
    box-shadow: 0 1px 2px rgba(224, 41, 60, 0.25);
}

.btn-danger:hover, .btn-danger:focus, .btn-danger:active {
    background: #bf1f30 !important;
    border-color: #bf1f30 !important;
    box-shadow: 0 4px 12px rgba(224, 41, 60, 0.3) !important;
}

.btn-outline-danger {
    color: #e0293c;
    border-color: #f3c2c8;
    background: #fff;
}

.btn-outline-danger:hover {
    background: #e0293c;
    border-color: #e0293c;
    color: #fff;
}

.btn-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.btn-link:hover {
    color: var(--accent-dark);
}

.btn-close:focus {
    box-shadow: 0 0 0 0.2rem var(--accent-light);
}

/* ---------- Карточки товаров ---------- */
.product-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.product-card img {
    height: 200px;
    object-fit: contain;
    background: #fff;
}

.product-card .card-body {
    padding: 0.9rem 1rem 1rem;
}

.product-card .card-title a {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

.product-card .card-title a:hover {
    color: var(--accent);
}

.product-card .fw-bold {
    font-size: 1.15rem;
    color: var(--text);
}

.product-card small.text-muted {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

.text-warning, .text-warning.small {
    color: var(--star) !important;
}

.fav-toggle {
    border: none;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease, transform .1s ease;
}

.fav-toggle:hover {
    color: var(--heart);
    transform: scale(1.08);
}

.fav-toggle.active {
    color: var(--heart);
}

.btn-outline-secondary.active {
    color: var(--heart);
    border-color: #f3c2c8;
    background: #fdecec;
}

/* ---------- Галерея товара ---------- */
.product-gallery {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
}

.product-gallery .carousel-control-prev,
.product-gallery .carousel-control-next {
    width: 40px;
    height: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 26, 26, 0.55);
    border-radius: 50%;
    opacity: 0.85;
}

.product-gallery .carousel-control-prev { left: 12px; }
.product-gallery .carousel-control-next { right: 12px; }

.product-gallery .carousel-control-prev-icon,
.product-gallery .carousel-control-next-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.gallery-thumb {
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: border-color .15s ease;
}

.gallery-thumb:hover {
    border-color: var(--accent);
}

/* ---------- Категории / фильтры ---------- */
.category-list a {
    color: var(--text);
    display: inline-block;
    padding: 0.2rem 0;
}

.category-list a:hover {
    color: var(--accent);
}

.category-list a.active {
    color: var(--accent);
    font-weight: 700;
}

/* ---------- Формы ---------- */
.form-control, .form-select {
    border-radius: var(--radius);
    border-color: var(--border);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem var(--accent-light);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem var(--accent-light);
}

/* ---------- Прочие компоненты ---------- */
.breadcrumb-item.active {
    color: var(--text-muted);
}

.wb-pagination {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.wb-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.4rem;
    border-radius: 999px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    background: transparent;
    transition: background-color .15s ease, color .15s ease;
}

a.wb-page-link:hover {
    background: var(--bg-soft);
}

.wb-page-link.active {
    background: var(--accent);
    color: #fff;
}

.wb-page-link.disabled {
    color: var(--border);
    cursor: default;
}

.wb-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    color: var(--text-muted);
}

.badge.bg-primary {
    background-color: var(--accent) !important;
}

.alert {
    border-radius: var(--radius);
    border: none;
}

.card {
    border-radius: var(--radius-lg);
}

/* ---------- Футер ---------- */
.site-footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.site-footer a {
    color: var(--text-muted);
}

.site-footer a:hover {
    color: var(--accent);
}

/* ---------- Админка ---------- */
.admin-sidebar {
    position: sticky;
    top: 5.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
    font-size: 0.92rem;
}

.admin-nav-link:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.admin-nav-link.active {
    background: var(--accent-light);
    color: var(--accent-dark);
    font-weight: 700;
}

.admin-nav-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1em 0.55em;
    border-radius: 999px;
}

.admin-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 0.6rem 0.2rem;
}

.stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.3rem;
    background: #fff;
    height: 100%;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.stat-card.accent {
    background: var(--accent-light);
    border-color: transparent;
}

.stat-card.accent .stat-value {
    color: var(--accent-dark);
}

.status-pill {
    display: inline-block;
    padding: 0.25em 0.75em;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-new { background: #eef2ff; color: #4338ca; }
.status-processing { background: #fff3cd; color: #8a6d00; }
.status-shipped { background: #d9eeff; color: #0b5faa; }
.status-done { background: #d9f4e6; color: #157a4a; }
.status-returned { background: #fde3e1; color: #b3261e; }
.status-cancelled { background: #f3f0f4; color: #75757a; }

.order-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
}

.order-tab {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-muted);
    background: var(--bg-soft);
}

.order-tab:hover {
    color: var(--text);
}

.order-tab.active {
    background: var(--accent);
    color: #fff;
}

.chart-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background: #fff;
    height: 100%;
}

.chart-card h6 {
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ---------- Всплывающие уведомления (toast) ---------- */
.toast-stack {
    position: fixed;
    top: 84px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(320px, calc(100vw - 32px));
}

.toast-item {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 4px solid var(--accent);
    opacity: 0;
    transform: translateX(24px);
    transition: opacity .2s ease, transform .2s ease;
}

.toast-item.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success { border-left-color: #1a9c5e; }
.toast-danger { border-left-color: #e0293c; }
.toast-warning { border-left-color: #ffa900; }
.toast-info { border-left-color: #0ea5e9; }

/* ---------- Корзина: миниатюра, промокод, инфо-блок ---------- */
.cart-item-card {
    display: flex;
    gap: 0.9rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.9rem;
    margin-bottom: 0.75rem;
}

.cart-item-img-link {
    flex-shrink: 0;
}

.cart-item-img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    border-radius: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    display: block;
}

.cart-item-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.cart-item-title {
    color: var(--text);
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
}

.cart-item-title:hover {
    color: var(--accent);
}

.cart-item-sku {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.5rem;
    flex-wrap: wrap;
}

.cart-item-price {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    white-space: nowrap;
}

.qty-stepper {
    display: flex;
    align-items: center;
    background: var(--bg-soft);
    border-radius: 999px;
    padding: 0.2rem;
    flex-shrink: 0;
}

.qty-stepper form {
    display: contents;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.qty-btn:hover:not(:disabled) {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.qty-btn:disabled {
    color: var(--border);
}

.qty-value {
    min-width: 22px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color .15s ease, background-color .15s ease;
}

.icon-btn:hover {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.icon-btn.danger:hover {
    background: #fdecec;
    color: #e0293c;
}

.icon-btn.fav-toggle.active {
    color: var(--heart);
    background: #fdecec;
}

@media (max-width: 400px) {
    .cart-item-img {
        width: 68px;
        height: 68px;
    }

    .cart-item-card {
        padding: 0.7rem;
        gap: 0.6rem;
    }

    .cart-item-title {
        font-size: 0.86rem;
    }
}

.promo-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    background: #fff;
}

.cart-line {
    display: flex;
    justify-content: space-between;
}

.promo-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent-light);
    color: var(--accent-dark);
    border-radius: var(--radius);
    padding: 0.5rem 0.9rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-notice {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    background: var(--bg-soft);
    font-size: 0.88rem;
    color: var(--text-muted);
}

.cart-notice ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
}

.cart-notice li {
    margin-bottom: 0.25rem;
}

/* ---------- Вход / регистрация ---------- */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 65vh;
    padding: 1.5rem 0.5rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.07);
    padding: 2.25rem 2rem;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.auth-card .auth-switch {
    text-align: center;
    margin: 1.25rem 0 0;
    font-size: 0.92rem;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.75rem 1.25rem;
        box-shadow: none;
        border: none;
    }

    .auth-wrapper {
        padding: 0.5rem 0;
        min-height: auto;
    }
}

/* ---------- Фильтры каталога на мобильном (offcanvas) ---------- */
.filter-offcanvas {
    --bs-offcanvas-width: min(320px, 86vw);
}

.filter-offcanvas .offcanvas-body {
    padding: 1.25rem;
}

.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
}

.filter-toggle-btn:hover {
    background: var(--bg-soft);
}

.filter-toggle-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.28em 0.55em;
    border-radius: 999px;
}

.contact-map-frame {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.contact-map-frame iframe {
    display: block;
}

@media (min-width: 768px) {
    .filter-offcanvas .offcanvas-body {
        padding: 0;
    }
}

/* ---------- Выбор доставки / оплаты на чекауте ---------- */
.option-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    font-size: 0.92rem;
    transition: border-color .15s ease, background-color .15s ease;
}

.option-card:hover {
    border-color: var(--accent);
}

.option-card input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.option-card.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    font-weight: 600;
}

.option-card.disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.option-card.disabled:hover {
    border-color: var(--border);
}

/* ---------- Демо-оплата заказа ---------- */
.pay-page {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.pay-page .promo-box {
    text-align: left;
}
