/* Modern Store Styles */
/* CSS Variables are defined dynamically in design-vars.php */

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

html,
body {
    height: 100%;
    overscroll-behavior-y: none;
}

body {
    font-family: 'Adekvat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page, #f8f9fa);
    color: var(--text-primary, #212529);
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

:root {
    --cookie-consent-height: 0px;
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Wrapper for sticky footer */
.content-wrapper {
    flex: 1 0 auto;
}

/* Header */
.store-header {
    background: var(--bg-card, #ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light, #e9ecef);
}

.header-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light, #e9ecef);
    font-size: 0.875rem;
}

.city-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary, #636c73);
    cursor: pointer;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    border-radius: 6px;
    transition: all 0.2s;
}

.city-selector:hover {
    background: var(--bg-page, #f8f9fa);
}

.city-selector i.bi-geo-alt {
    color: var(--accent-primary, #5b5ede);
}

.city-change-icon {
    color: var(--text-muted, #606669);
    transition: transform 0.2s;
}

.city-selector:hover .city-change-icon {
    color: var(--accent-primary, #5b5ede);
    transform: rotate(180deg);
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10000;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #111827;
    color: #fff;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.15s ease;
}

.skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

#main-content:focus {
    outline: none;
}

.header-contacts {
    display: flex;
    gap: 1rem;
}

.contact-link {
    color: var(--text-secondary, #636c73);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.contact-link:hover {
    color: var(--accent-primary, #5b5ede);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.25rem 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.header-center {
    flex: 2;
    max-width: 600px;
}

.search-form {
    width: 100%;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-group i.bi-search,
.search-input-group .search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--accent-primary, #5b5ede);
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 2.5rem !important;
    border: 2px solid var(--border-default, #dee2e6);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #212529);
}

.search-input::placeholder {
    color: var(--text-muted, #606669);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary, #5b5ede);
    background: var(--bg-card, #ffffff);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-clear {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted, #606669);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-clear:hover {
    background: var(--bg-page, #f8f9fa);
    color: var(--text-primary, #212529);
}

/* ========== LIVE SEARCH ========== */
.live-search-container {
    position: relative;
    width: 100%;
}

.live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 2000;
}

.live-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted, #606669);
}

.live-search-items {
    display: flex;
    flex-direction: column;
}

.live-search-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-primary, #212529);
    border-bottom: 1px solid var(--border-light, #e9ecef);
    transition: background 0.2s;
}

.live-search-item:last-child {
    border-bottom: none;
}

.live-search-item:hover,
.live-search-item:focus-visible,
.live-search-item.is-active {
    background: rgba(99, 102, 241, 0.05);
}

.live-search-item:focus-visible {
    outline: 2px solid var(--accent-primary, #5b5ede);
    outline-offset: -2px;
}

.search-item-image {
    width: 52px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #ffffff);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light, #e9ecef);
}

.search-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-item-image i {
    font-size: 1.5rem;
    color: var(--text-muted, #606669);
}

.search-item-no-image {
    width: 52px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #ffffff);
    border-radius: 8px;
    border: 1px solid var(--border-light, #e9ecef);
}

.search-item-no-image i {
    font-size: 1.5rem;
    color: var(--text-muted, #606669);
}

.live-search-item img {
    width: 52px;
    height: 70px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-light, #e9ecef);
}

.search-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.search-item-title,
.search-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #212529);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-brand {
    font-size: 0.85rem;
    color: var(--text-secondary, #636c73);
    margin-bottom: 0.25rem;
}

.search-item-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-primary, #5b5ede);
}

.search-item-price .price {
    font-weight: 700;
    color: var(--accent-primary, #5b5ede);
}

.search-item-price .old-price {
    text-decoration: line-through;
    color: var(--text-muted, #606669);
    font-size: 0.9rem;
}

.search-item-price .discount-badge {
    background: #ef4444;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.in-stock-badge {
    color: #10b981;
    font-size: 1.2rem;
}

.out-stock-badge {
    color: var(--text-muted, #606669);
    font-size: 0.75rem;
}

.live-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted, #606669);
}

.live-search-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* ========== CITY NOTIFICATION ========== */
.city-notification {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1055;
    width: min(560px, calc(100vw - 24px));
    animation: cityToastIn 0.22s ease;
}

@keyframes cityToastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.city-notification-content {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border-light, #e9ecef);
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
    padding: 0.85rem 0.9rem;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon text"
        "actions actions";
    gap: 0.6rem 0.75rem;
    backdrop-filter: blur(10px);
}

.city-notification-content i {
    font-size: 1.5rem;
    color: var(--accent-primary, #5b5ede);
    grid-area: icon;
}

.city-notification-text {
    grid-area: text;
    color: var(--text-primary, #212529);
    line-height: 1.25;
    font-size: 0.95rem;
}

.city-notification-actions {
    grid-area: actions;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.city-notification-actions .btn {
    white-space: nowrap;
}

@media (min-width: 992px) {
    .city-notification {
        bottom: 24px;
    }

    .city-notification-content {
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "icon text actions";
        align-items: center;
        padding: 0.9rem 1rem;
    }

    .city-notification-actions {
        justify-content: flex-end;
    }

    .city-notification-actions .btn {
        flex: 0 0 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .city-notification {
        animation: none;
    }
}

/* Responsive для поиска */
@media (max-width: 768px) {
    .live-search-results {
        max-height: 400px;
    }

    .search-item-title {
        font-size: 0.9rem;
    }

    .header-top-bar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

.search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: var(--bg-page, #f8f9fa);
    color: #f56565;
}

.header-right {
    display: flex;
    align-items: center;
}

.store-logo {
    height: 50px;
    width: auto;
    border-radius: 8px;
}

.store-title {
    font-size: var(--store-title-size, 1.5rem);
    font-weight: 700;
    color: var(--accent-primary, #5b5ede);
    margin: 0;
}

/* Кликабельное название магазина */
.header-left a:hover .store-title {
    color: var(--accent-secondary, #8b5cf6);
    transition: color 0.2s ease;
}

.header-left a {
    cursor: pointer;
}

.store-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: inherit;
    text-decoration: none;
}

/* ========== MOBILE HEADER ELEMENTS ========== */
/* Hamburger menu button */
.mobile-menu-toggle {
    display: none;
    /* Hidden by default, shown on mobile */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--accent-primary, #5b5ede);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile top buttons container */
.mobile-top-buttons {
    display: none;
    /* Hidden by default, shown on mobile */
    gap: 0.5rem;
}

/* Mobile search button */
.mobile-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-page, #f8f9fa);
    border: 1px solid var(--border-light, #e9ecef);
    border-radius: 10px;
    color: var(--accent-primary, #5b5ede);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-search-toggle:hover {
    background: var(--accent-primary, #5b5ede);
    color: white;
}

/* Mobile phone button */
.mobile-phone-button {
    /* 44×44 — минимальная тач-цель; было 40×40, единственная кнопка шапки,
       не дотягивавшая до нормы после правки бургера. */
    width: 44px;
    height: 44px;
    background: var(--bg-page, #f8f9fa);
    border: 1px solid var(--border-light, #e9ecef);
    border-radius: 10px;
    color: var(--accent-primary, #5b5ede);
    font-size: 1.1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mobile-phone-button:hover {
    background: var(--accent-primary, #5b5ede);
    color: white;
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card, #ffffff);
    z-index: 2000;
    display: none;
    flex-direction: column;
    padding: 1rem;
}

.mobile-search-overlay.active {
    display: flex;
}

.mobile-search-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mobile-search-close {
    width: 40px;
    height: 40px;
    background: var(--bg-page, #f8f9fa);
    border: none;
    border-radius: 10px;
    font-size: 1.5rem;
    color: var(--text-primary, #212529);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary, #212529);
}

.mobile-live-search-container {
    position: relative;
    width: 100%;
}

.mobile-search-form {
    display: flex;
    gap: 0.75rem;
    position: relative;
}

.mobile-search-input {
    flex: 1;
    padding: 1rem;
    padding-right: 3rem;
    border: 2px solid var(--border-default, #dee2e6);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--bg-page, #f8f9fa);
}

.mobile-search-input:focus {
    outline: none;
    border-color: var(--accent-primary, #5b5ede);
}

.mobile-search-clear {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--bg-card, #ffffff);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary, #636c73);
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.mobile-search-clear:hover {
    background: var(--bg-page, #f8f9fa);
    color: var(--text-primary, #212529);
}

.mobile-search-submit {
    width: 50px;
    height: 50px;
    background: var(--accent-primary, #5b5ede);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-search-submit:hover {
    opacity: 0.9;
}

/* Mobile live search results */
.mobile-live-search-results {
    margin-top: 1rem;
    background: var(--bg-page, #f8f9fa);
    border-radius: 12px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

/* ========== MOBILE SIDE MENU ========== */
.mobile-side-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    display: none;
}

.mobile-side-menu.active {
    display: block;
}

.mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    background: var(--bg-card, #ffffff);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-side-menu.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light, #e9ecef);
    background: linear-gradient(135deg, var(--accent-primary, #5b5ede), var(--accent-secondary, #8b5cf6));
    color: white;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-primary, #212529);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.mobile-menu-item:hover {
    background: var(--bg-page, #f8f9fa);
    color: var(--accent-primary, #5b5ede);
    border-left-color: var(--accent-primary, #5b5ede);
}

.mobile-menu-item.active {
    background: var(--bg-page, #f8f9fa);
    color: var(--accent-primary, #5b5ede);
    border-left-color: var(--accent-primary, #5b5ede);
}

.mobile-menu-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.mobile-menu-divider {
    height: 1px;
    background: var(--border-light, #e9ecef);
    margin: 0.5rem 1.5rem;
}

/* Mobile menu list - вертикальный список */
.mobile-menu-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-primary, #212529);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.mobile-menu-item:hover {
    background: var(--bg-page, #f8f9fa);
    color: var(--accent-primary, #5b5ede);
    border-left-color: var(--accent-primary, #5b5ede);
}

.mobile-menu-item.active {
    background: var(--bg-page, #f8f9fa);
    color: var(--accent-primary, #5b5ede);
    border-left-color: var(--accent-primary, #5b5ede);
}

.mobile-menu-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* Mobile dropdown */
.mobile-dropdown {
    display: flex;
    flex-direction: column;
}

.mobile-dropdown-toggle {
    justify-content: space-between;
}

.mobile-dropdown-toggle i.bi-chevron-down,
.mobile-dropdown-toggle i.bi-chevron-up {
    font-size: 1rem;
    margin-left: auto;
    transition: transform 0.2s;
}

.mobile-dropdown-toggle.active i.bi-chevron-down {
    transform: rotate(180deg);
}

.mobile-submenu {
    background: var(--bg-page, #f8f9fa);
    padding-left: 2rem;
}

.mobile-submenu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary, #636c73);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.mobile-submenu-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--accent-primary, #5b5ede);
    border-left-color: var(--accent-primary, #5b5ede);
}

.mobile-submenu-item i {

    /* Account & Login Styles */
    .login-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        background: rgba(var(--accent-primary-rgb, 102, 126, 234), 0.1);
        border-radius: 8px;
        color: var(--accent-primary, #667eea);
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
        margin-right: 1rem;
    }

    .login-link:hover {
        background: rgba(var(--accent-primary-rgb, 102, 126, 234), 0.2);
        color: var(--accent-primary, #667eea);
    }

    .login-link i {
        font-size: 1.2rem;
    }

    .account-dropdown {
        position: relative;
        margin-right: 1rem;
    }

    .account-button {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        background: rgba(var(--accent-primary-rgb, 102, 126, 234), 0.1);
        border-radius: 8px;
        color: var(--accent-primary, #667eea);
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .account-button:hover {
        background: rgba(var(--accent-primary-rgb, 102, 126, 234), 0.2);
        color: var(--accent-primary, #667eea);
    }

    .account-button i {
        font-size: 1.5rem;
    }

    .account-name {
        white-space: nowrap;
    }

    .account-dropdown:hover .account-dropdown-content {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .account-dropdown-content {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        background: white;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        min-width: 250px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: 1000;
        overflow: hidden;
    }

    .account-dropdown-header {
        padding: 1rem;
        background: linear-gradient(135deg, var(--accent-primary, #667eea), var(--accent-secondary, #764ba2));
        color: white;
    }

    .account-dropdown-header strong {
        display: block;
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .account-dropdown-header small {
        font-size: 0.85rem;
        opacity: 0.9;
    }

    .account-dropdown-content .dropdown-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        color: #1a1a1a;
        text-decoration: none;
        transition: background 0.2s ease;
    }

    .account-dropdown-content .dropdown-item:hover {
        background: #f7fafc;
    }

    .account-dropdown-content .dropdown-item i {
        font-size: 1.1rem;
        width: 20px;
        text-align: center;
    }

    .account-dropdown-content .dropdown-divider {
        height: 1px;
        background: #e2e8f0;
        margin: 0.5rem 0;
    }

    .account-dropdown-content .dropdown-item.text-danger {
        color: #f56565 !important;
    }

    .account-dropdown-content .dropdown-item.text-danger:hover {
        background: #fff5f5;
    }

    /* Mobile responsive */
    @media (max-width: 768px) {
        .account-name {
            display: none;
        }

        .login-link span {
            display: none;
        }

        .login-link {
            padding: 0.5rem;
            margin-right: 0.5rem;
        }

        .account-button {
            padding: 0.5rem;
        }

        .account-dropdown {
            margin-right: 0.5rem;
        }
    }

    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.cart-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary, #5b5ede), var(--accent-secondary, #8b5cf6));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.cart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #f56565;
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(245, 101, 101, 0.4);
}

/* Cart Dropdown */
.cart-dropdown {
    position: relative;
}

.cart-dropdown:hover .cart-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-dropdown-content {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.cart-dropdown-content::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -3px -3px 5px rgba(0, 0, 0, 0.05);
}

.cart-dropdown-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light, #e9ecef);
}

.cart-dropdown-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
}

.cart-dropdown-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    max-height: 300px;
}

.cart-dropdown-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s;
    margin-bottom: 0.5rem;
}

.cart-dropdown-item:hover {
    background: var(--bg-page, #f8f9fa);
}

.cart-dropdown-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--bg-page, #f8f9fa);
    padding: 0.25rem;
    flex-shrink: 0;
}

.cart-dropdown-item-info {
    flex: 1;
    min-width: 0;
}

.cart-dropdown-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary, #212529);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-dropdown-item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.cart-dropdown-item-quantity {
    color: var(--text-muted, #606669);
}

.cart-dropdown-item-price {
    font-weight: 600;
    color: var(--accent-primary, #5b5ede);
}

/* Новые стили для обновленной корзины */
.cart-item-image-small {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: var(--bg-page, #f8f9fa);
    padding: 0.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image-small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-image-small i {
    font-size: 1.5rem;
    color: var(--text-muted, #606669);
}

.cart-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cart-item-title-small {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary, #212529);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-price-qty {
    font-size: 0.85rem;
    color: var(--text-muted, #606669);
}

.cart-item-total-small {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--accent-primary, #5b5ede);
    white-space: nowrap;
}

.cart-dropdown-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted, #606669);
}

.cart-dropdown-empty i {
    font-size: 3rem;
    color: var(--border-light, #e9ecef);
    margin-bottom: 1rem;
}

.cart-dropdown-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light, #e9ecef);
    background: var(--bg-page, #f8f9fa);
    border-radius: 0 0 12px 12px;
}

.cart-dropdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary, #212529);
}

.cart-dropdown-total span:last-child {
    color: var(--accent-primary, #5b5ede);
}

.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--accent-primary, #5b5ede), var(--accent-secondary, #8b5cf6));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Navigation */
.store-nav {
    background: var(--bg-card, #ffffff);
    border-bottom: 1px solid var(--border-light, #e9ecef);
    padding: 0.75rem 0;
    margin-bottom: 2rem;
}

.store-nav .container {
    display: flex;
    justify-content: center;
}

.store-nav .nav-links {
    min-height: 3.5rem;
}

.nav-links {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    list-style: none;
}

.nav-link {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary, #636c73);
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: normal;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary, #5b5ede);
    text-decoration: none;
}

.nav-link.active {
    background: var(--accent-primary, #5b5ede);
    color: white;
}

.nav-link i {
    font-size: 1.1rem;
}

/* Navigation Dropdown */
.nav-item-dropdown {
    position: relative;
    display: inline-block;
}

.nav-item-dropdown .nav-link {
    cursor: pointer;
}

.nav-item-dropdown .dropdown-arrow {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.nav-item-dropdown:hover .dropdown-arrow,
.nav-item-dropdown:focus-within .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-light, #e9ecef);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    margin-top: 0;
    padding: 0.5rem 0;
    z-index: 1000;
    animation: dropdownFadeIn 0.3s ease;
    /* Увеличиваем область наведения */
    padding-top: 0.75rem;
}

/* Псевдоэлемент для безопасной зоны наведения */
.nav-dropdown-content::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-item-dropdown:hover .nav-dropdown-content,
.nav-item-dropdown:focus-within .nav-dropdown-content {
    display: block;
}

.nav-dropdown-item:focus-visible,
.nav-link:focus-visible,
.city-selector:focus-visible,
.mobile-menu-toggle:focus-visible,
.mobile-search-toggle:focus-visible,
.mobile-search-close:focus-visible,
.mobile-menu-close:focus-visible {
    outline: 3px solid var(--input-focus, #4f46e5);
    outline-offset: 2px;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary, #212529);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-dropdown-item:hover {
    background: var(--bg-page, #f8f9fa);
    color: var(--accent-primary, #5b5ede);
    text-decoration: none;
}

.nav-dropdown-item i {
    font-size: 1rem;
    color: var(--text-muted, #606669);
}

.nav-dropdown-item:hover i {
    color: var(--accent-primary, #5b5ede);
}

.nav-dropdown-item.active {
    background: var(--bg-page, #f8f9fa);
    color: var(--accent-primary, #5b5ede);
    font-weight: 600;
}

.nav-dropdown-item.active i {
    color: var(--accent-primary, #5b5ede);
}

/* Mobile dropdown styles */
@media (max-width: 768px) {
    .nav-item-dropdown {
        width: 100%;
    }

    .nav-dropdown-content {
        position: static;
        width: 100%;
        margin-top: 0;
        border: none;
        box-shadow: none;
        background: var(--bg-page, #f8f9fa);
        border-radius: 0 0 10px 10px;
        padding: 0.25rem 0;
    }

    .nav-item-dropdown:hover .nav-dropdown-content {
        display: none;
        /* Отключаем hover на мобильных */
    }

    .nav-item-dropdown.mobile-open .nav-dropdown-content {
        display: block;
        /* Показываем по клику */
    }

    .nav-dropdown-item {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Hero Section */
.hero-section {
    background: var(--bg-card, #ffffff);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.hero-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.125rem;
    color: var(--text-muted, #606669);
    max-width: 800px;
    margin: 0 auto;
}

/* Home Tiles (Блок ссылок на главной) */
.home-tiles-section {
    margin-bottom: 2rem;
}

.home-tiles-header {
    margin-bottom: 1rem;
}

.home-tiles-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    margin: 0 0 0.25rem 0;
}

.home-tiles-subtitle {
    margin: 0;
    color: var(--text-muted, #606669);
}

.home-tiles-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1200px) {
    .home-tiles-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .home-tiles-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .home-tiles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

.home-tile {
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-light, #e9ecef);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.home-tile-image {
    aspect-ratio: 16 / 9;
    background: var(--bg-page, #f8f9fa);
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-tile-image-placeholder {
    font-size: 2rem;
    color: var(--text-muted, #606669);
}

.home-tile-body {
    padding: 0.85rem 0.95rem 0.95rem;
}

.home-tile-title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
    color: var(--text-primary, #212529);
}

.home-tile-text {
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--text-muted, #606669);
}

/* Section Title */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    margin-bottom: 1.5rem;
    background: var(--bg-card, #ffffff);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ========== FEATURED PRODUCTS CAROUSEL ========== */
.featured-section-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 0;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.featured-section-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.6;
}

.featured-section-wrapper .container {
    position: relative;
    z-index: 1;
}

.featured-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.featured-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.featured-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

.featured-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.featured-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0.25rem 0 0 0;
}

.featured-nav {
    display: flex;
    gap: 0.75rem;
}

.featured-nav-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    color: var(--accent-primary, #5b5ede);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.featured-nav-btn:hover:not(:disabled) {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.featured-nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.featured-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.featured-products-wrapper {
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.featured-products-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.featured-product-item {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    height: 100%;
}

/* В карусели карточка обёрнута в .featured-product-item, из-за чего высота могла отличаться.
   Растягиваем саму .product-card на высоту grid-ячейки, чтобы все карточки были одинаковыми. */
.featured-product-item>.product-card {
    height: 100%;
}

.featured-product-item.visible {
    display: block;
    opacity: 1;
}

/* Адаптация под разные экраны */
@media (min-width: 1024px) {
    .featured-products-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .featured-products-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 639px) {
    .featured-products-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .featured-section-wrapper {
        padding: 2rem 0;
    }

    .featured-title {
        font-size: 1.5rem;
    }

    .featured-subtitle {
        font-size: 0.875rem;
    }

    .featured-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .featured-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .featured-products-wrapper {
        padding: 1rem;
    }
}

/* Индикаторы страниц */
.featured-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.featured-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.featured-indicator:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.featured-indicator.active {
    width: 32px;
    border-radius: 5px;
    background: white;
}

/* Улучшаем карточки товаров в карусели */
.featured-section-wrapper .product-card {
    background: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .featured-section-wrapper .product-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    }
}

/* OLD Featured Slider Section - DEPRECATED */
.featured-section {
    margin-bottom: 3rem;
    display: none;
    /* Скрываем старую версию */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header .section-title {
    margin-bottom: 0;
    flex: 1;
}

.slider-nav {
    display: flex;
    gap: 0.5rem;
}

.slider-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-light, #e9ecef);
    background: white;
    color: var(--text-primary, #212529);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.slider-btn:hover {
    border-color: var(--accent-primary, #5b5ede);
    background: var(--accent-primary, #5b5ede);
    color: white;
    transform: scale(1.1);
}

.slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.slider-btn:disabled:hover {
    transform: none;
    border-color: var(--border-light, #e9ecef);
    background: white;
    color: var(--text-primary, #212529);
}

.featured-slider {
    overflow: visible;
}

.featured-slider .swiper-slide {
    height: auto;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.category-card {
    background: var(--bg-card, #ffffff);
    border: 2px solid var(--border-light, #e9ecef);
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    border-color: var(--accent-primary, #5b5ede);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.15);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--accent-primary, #5b5ede);
    margin-bottom: 0.75rem;
}

.category-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
}

/* Filters and Sort Bar */
.filters-bar {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filters-section {
    display: flex;
    gap: 0.75rem;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-page, #f8f9fa);
    border: 2px solid var(--border-light, #e9ecef);
    border-radius: 8px;
    color: var(--text-primary, #212529);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-toggle:hover {
    border-color: var(--accent-primary, #5b5ede);
    background: white;
}

.filter-toggle.active {
    background: var(--accent-primary, #5b5ede);
    color: white;
    border-color: var(--accent-primary, #5b5ede);
}

.sort-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-section label {
    font-weight: 500;
    color: var(--text-muted, #606669);
    white-space: nowrap;
}

.sort-select {
    padding: 0.625rem 1rem;
    border: 2px solid var(--border-light, #e9ecef);
    border-radius: 8px;
    background: white;
    color: var(--text-primary, #212529);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 200px;
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent-primary, #5b5ede);
}

/* Filters Panel */
.filters-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-group h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin-bottom: 1rem;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.price-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 2px solid var(--border-light, #e9ecef);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.price-input:focus {
    outline: none;
    border-color: var(--accent-primary, #5b5ede);
}

.brand-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.brand-checkbox {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.brand-checkbox:hover {
    background: var(--bg-page, #f8f9fa);
}

.brand-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light, #e9ecef);
}

.btn-apply-filters {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary, #5b5ede), var(--accent-secondary, #8b5cf6));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-apply-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-reset-filters {
    padding: 0.75rem 1.5rem;
    background: white;
    color: var(--text-muted, #606669);
    border: 2px solid var(--border-light, #e9ecef);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-reset-filters:hover {
    border-color: #f56565;
    color: #f56565;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.product-card {
    position: relative;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-light, #e9ecef);
    border-radius: 12px;
    overflow: visible;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    color: inherit;
}

/* Product Card style modifiers (from modules_config) */
.product-card--flat {
    border-color: transparent;
    box-shadow: none;
}

.product-card--outlined {
    border-width: 2px;
}

.product-card--soft {
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.product-card--square {
    border-radius: 0;
}

.product-card--rounded {
    border-radius: 18px;
}

.product-card--shadow-none,
.product-card--shadow-none:hover {
    box-shadow: none !important;
}

.product-card--shadow-none:hover {
    transform: none;
}

.product-card--image-rect .product-image-wrapper {
    padding-top: 72%;
}

.product-card--image-tall .product-image-wrapper {
    padding-top: 125%;
}

.product-card--text-focus .product-image-wrapper {
    padding-top: 70%;
}

.product-card--text-focus .product-title {
    font-size: 1rem;
}

.product-card--button-wide .btn-add-cart {
    width: 100%;
    justify-content: center;
}

@media (hover: hover) and (pointer: fine) {
    .product-card:hover {
        border-color: var(--accent-primary, #5b5ede);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        transform: translateY(-4px);
    }
}

.product-image-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-top: 100%;
    background: var(--bg-card, #ffffff);
    overflow: hidden;
    border-bottom: 1px solid var(--border-light, #e9ecef);
}

.product-image-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    color: inherit;
}

.product-image-link:focus-visible {
    outline: 3px solid var(--input-focus, #4f46e5);
    outline-offset: -3px;
}

.product-gallery-slide img[role="button"] {
    cursor: zoom-in;
}

.product-gallery-slide img[role="button"]:focus-visible {
    outline: 3px solid var(--input-focus, #4f46e5);
    outline-offset: -3px;
}

/* ========== PRODUCT BADGES - STACKED VERSION ========== */

/* Контейнер для бейджей */
.product-badges-container {
    position: absolute;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.18rem !important;
    max-width: 35% !important;
    pointer-events: none;
}

/* Позиции контейнера */
.product-badges-container.product-badges-top-left {
    top: 8px;
    left: 8px;
    align-items: flex-start;
}

.product-badges-container.product-badges-top-right {
    top: 8px;
    right: 8px;
    align-items: flex-end;
}

.product-badges-container.product-badges-bottom-left {
    bottom: 8px;
    left: 8px;
    align-items: flex-start;
}

.product-badges-container.product-badges-bottom-right {
    bottom: 8px;
    right: 8px;
    align-items: flex-end;
}

/* Бейдж скидки - отдельный элемент */
.product-badge-discount {
    position: absolute;
    background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%) !important;
    color: white !important;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: var(--badge-discount-size, 0.7rem);
    z-index: 11;
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3) !important;
    line-height: 1;
    backdrop-filter: blur(4px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    white-space: nowrap;
    pointer-events: none;
}

/* Позиции для бейджа скидки */
.product-badge-discount.product-badge-top-left {
    top: 8px;
    left: 8px;
}

.product-badge-discount.product-badge-top-right {
    top: 8px;
    right: 8px;
}

.product-badge-discount.product-badge-bottom-left {
    bottom: 8px;
    left: 8px;
}

.product-badge-discount.product-badge-bottom-right {
    bottom: 8px;
    right: 8px;
}

/* Универсальный стиль для всех бейджей */
.product-badge {
    padding: 0.12rem 0.35rem !important;
    border-radius: 3px !important;
    font-size: var(--badge-regular-size, 0.52rem);
    font-weight: 600 !important;
    text-transform: uppercase !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
    line-height: 1.1 !important;
    backdrop-filter: blur(4px) !important;
    letter-spacing: 0.15px !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Badge style modifiers (from modules_config) */
.product-badges-container.product-badges-style-pill .product-badge,
.product-badges-container.product-badges-style-pill .product-badge-discount,
.product-badges-style-pill.product-badge,
.product-badges-style-pill.product-badge-discount {
    border-radius: 999px !important;
}

.product-badges-container.product-badges-style-soft .product-badge,
.product-badges-container.product-badges-style-soft .product-badge-discount,
.product-badges-style-soft.product-badge,
.product-badges-style-soft.product-badge-discount {
    box-shadow: none !important;
    filter: saturate(0.95);
    opacity: 0.92;
}

.product-badges-container.product-badges-style-outline .product-badge,
.product-badges-container.product-badges-style-outline .product-badge-discount,
.product-badges-style-outline.product-badge,
.product-badges-style-outline.product-badge-discount {
    background: rgba(255, 255, 255, 0.94) !important;
    color: var(--text-primary, #212529) !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    text-shadow: none !important;
    backdrop-filter: blur(6px) !important;
}

.product-badges-container.product-badges-style-glass .product-badge,
.product-badges-container.product-badges-style-glass .product-badge-discount,
.product-badges-style-glass.product-badge,
.product-badges-style-glass.product-badge-discount {
    backdrop-filter: blur(10px) !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: #fff !important;
}

.product-badges-container.product-badges-style-mono .product-badge,
.product-badges-container.product-badges-style-mono .product-badge-discount,
.product-badges-style-mono.product-badge,
.product-badges-style-mono.product-badge-discount {
    background: rgba(0, 0, 0, 0.72) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    text-shadow: none !important;
}

.product-badges-container.product-badges-style-contrast .product-badge,
.product-badges-container.product-badges-style-contrast .product-badge-discount,
.product-badges-style-contrast.product-badge,
.product-badges-style-contrast.product-badge-discount {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
    text-shadow: none !important;
}

.product-badges-container.product-badges-style-shadow .product-badge,
.product-badges-container.product-badges-style-shadow .product-badge-discount,
.product-badges-style-shadow.product-badge,
.product-badges-style-shadow.product-badge-discount {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28) !important;
}

.product-badges-container.product-badges-style-tag .product-badge,
.product-badges-container.product-badges-style-tag .product-badge-discount,
.product-badges-style-tag.product-badge,
.product-badges-style-tag.product-badge-discount {
    border-radius: 6px 6px 6px 2px !important;
}

.product-badges-container.product-badges-style-neon .product-badge,
.product-badges-container.product-badges-style-neon .product-badge-discount,
.product-badges-style-neon.product-badge,
.product-badges-style-neon.product-badge-discount {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.25) inset,
        0 0 12px rgba(102, 126, 234, 0.55) !important;
}

/* "ribbon" — простая имитация через скошенный угол */
.product-badges-container.product-badges-style-ribbon .product-badge,
.product-badges-container.product-badges-style-ribbon .product-badge-discount,
.product-badges-style-ribbon.product-badge,
.product-badges-style-ribbon.product-badge-discount {
    border-radius: 4px !important;
    clip-path: polygon(0% 0%, 92% 0%, 100% 50%, 92% 100%, 0% 100%, 6% 50%);
}

/* Цвета для разных типов бейджей */
.product-badge-new {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-size: var(--badge-regular-size, 0.52rem) !important;
}

.product-badge-hit {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    color: white !important;
    font-size: var(--badge-regular-size, 0.52rem) !important;
}

.product-badge-featured {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: white !important;
    font-size: var(--badge-regular-size, 0.52rem) !important;
}

.product-badge-stock {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    font-size: var(--badge-regular-size, 0.52rem) !important;
}

.product-badge-out {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%) !important;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    font-size: var(--badge-regular-size, 0.52rem) !important;
}

/* Адаптивность для мобильных */
@media (max-width: 639px) {
    .product-badges-container {
        gap: 0.25rem;
        max-width: 60%;
    }

    .product-badges-container.product-badges-top-left,
    .product-badges-container.product-badges-bottom-left {
        left: 6px;
    }

    .product-badges-container.product-badges-top-right,
    .product-badges-container.product-badges-bottom-right {
        right: 6px;
    }

    .product-badges-container.product-badges-top-left,
    .product-badges-container.product-badges-top-right {
        top: 6px;
    }

    .product-badges-container.product-badges-bottom-left,
    .product-badges-container.product-badges-bottom-right {
        bottom: 6px;
    }

    .product-badge-discount {
        padding: 0.15rem 0.35rem;
        font-size: 0.65rem;
        border-radius: 4px;
    }

    .product-badge {
        padding: 0.15rem 0.35rem;
        font-size: 0.6rem;
        border-radius: 3px;
    }

    .product-badge-discount.product-badge-top-left,
    .product-badge-discount.product-badge-top-right {
        top: 6px;
    }

    .product-badge-discount.product-badge-top-left {
        left: 6px;
    }

    .product-badge-discount.product-badge-top-right {
        right: 6px;
    }
}

/* OLD BADGE STYLES - DEPRECATED - Удалим старые стили */

.btn-wishlist {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 12;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
}

.btn-wishlist .wishlist-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    border: 0;
}

.btn-quick-view {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: fit-content;
    height: auto;
    padding: 0.5rem 0.85rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 2px solid var(--border-light, #e9ecef);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    font-size: 0.95rem;
    line-height: 1;
    gap: 0.45rem;
    max-width: calc(100% - 16px);
    white-space: nowrap;
    color: var(--accent-primary, #5b5ede);
}

/*
 * Подпись помещается не всегда: обложка карточки бывает 106 px (шесть колонок
 * на 1024), а прежняя фраза «Быстрый просмотр» требовала 177 px и обрезалась
 * на ЛЮБОЙ десктопной ширине — max-width резал её без многоточия. Поэтому
 * короткое слово, а на узких карточках остаётся только глаз; полная
 * формулировка живёт в title и доступна скринридеру.
 */
@media (max-width: 1199.98px) {
    .btn-quick-view__label {
        display: none;
    }

    .btn-quick-view {
        padding: 0.5rem;
    }
}

.btn-quick-view i {
    font-size: 1.1rem;
    margin: 0 !important;
}

.btn-quick-view:focus-visible {
    opacity: 1;
    pointer-events: auto;
    outline: 3px solid var(--input-focus, #4f46e5);
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .product-card:hover .btn-quick-view {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (hover: hover) and (pointer: fine) {
    .btn-quick-view:hover {
        background: var(--accent-primary, #5b5ede);
        border-color: var(--accent-primary, #5b5ede);
        color: white;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

@media (max-width: 639px) {
    .btn-quick-view {
        display: none !important;
    }
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Lazy loading states.
   Стартовое состояние — ВИДИМОЕ. Раньше тут стояло opacity:0 + blur(5px), а показывал
   картинку только JS-наблюдатель (components/footer.php): на мобиле после полной прокрутки
   каталога 10 обложек так и оставались прозрачными при уже скачанных файлах.
   Ленивую загрузку обеспечивает нативный loading="lazy" в components/product-card.php. */
.lazy-image {
    opacity: 1;
    filter: none;
}

.lazy-image.loaded {
    opacity: 1;
    filter: blur(0);
}

@media (hover: hover) and (pointer: fine) {
    .product-card:hover .product-image {
        transform: scale(1.05);
    }
}

.product-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--border-light, #e9ecef);
}

.product-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 240px;
    overflow: visible;
}

.product-brand {
    color: var(--text-muted, #606669);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.product-title-link {
    color: inherit;
    text-decoration: none;
}

/* The card is an article with two genuine product links and sibling action
   buttons. Stretch the title link across the non-interactive card surface so
   mouse users keep the familiar whole-card hit area without invalid nested
   buttons or JavaScript navigation. */
.product-title-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.product-title-link:hover {
    color: var(--accent-primary, #5b5ede);
}

.product-title-link:focus-visible {
    border-radius: 0.2rem;
    outline: 3px solid var(--input-focus, #4f46e5);
    outline-offset: 2px;
}

.product-prices {
    display: flex !important;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    margin-top: auto;
    visibility: visible !important;
    opacity: 1 !important;
}

.product-price-original {
    font-size: 0.85rem;
    color: var(--text-muted, #606669);
    text-decoration: line-through;
    line-height: 1.2;
    opacity: 1;
    display: block !important;
}

.product-price-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Цена: !important у цвета и насыщенности снят. Он перебивал премиум-слой, и цена
   красилась в тот же акцентный синий, что и кнопка «В корзину» — два элемента
   спорили за внимание, а число читалось как ссылка. Акцент должен принадлежать
   действию; на пресете default цвет остаётся прежним, там премиум-слоя нет. */
.product-price {
    font-size: 1.75rem !important;
    font-weight: 700;
    color: var(--accent-primary, #5b5ede);
    line-height: 1.3 !important;
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

.product-discount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fef5e7;
    color: #d68910;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.btn-add-cart {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: var(--button-padding-y, 0.875rem) var(--button-padding-x, 1rem);
    background: var(--btn-primary-bg, #5b5ede);
    border: none;
    border-radius: var(--button-radius, 10px);
    color: var(--btn-primary-text, #ffffff);
    font-weight: var(--button-font-weight, 600);
    font-size: var(--button-font-size, 0.95rem);
    cursor: pointer;
    transition: var(--button-transition, all 0.3s ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-cart:hover {
    background: var(--btn-primary-hover, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-add-cart i {
    font-size: 1.1rem;
}

/* Footer */
.store-footer {
    flex-shrink: 0;
    background: var(--bg-card, #ffffff);
    border-top: 1px solid var(--border-light, #e9ecef);
    padding: 2.5rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-muted, #606669);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-primary, #5b5ede);
}

.footer-support-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted, #606669);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
}

.footer-support-link:hover,
.footer-support-link:focus-visible {
    color: var(--accent-primary, #5b5ede);
}

.footer-copyright {
    color: var(--text-muted, #606669);
    font-size: 0.875rem;
    text-align: center;
    width: 100%;
}

.footer-cookie-settings {
    margin-left: 0.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-primary, #5b5ede);
    text-decoration: underline;
    cursor: pointer;
}

/* Нижняя юридическая строка публичной витрины остаётся компактной на десктопе,
   но на телефоне каждая ссылка и кнопка получает самостоятельную тач-цель. */
@media (max-width: 767.98px) {
    .store-footer[data-shell-mode="public"] .footer-copyright :is(a, .footer-cookie-settings) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-info {
    background: #ebf8ff;
    color: #2c5282;
    border: 1px solid #bee3f8;
}

.alert i {
    font-size: 1.25rem;
}

/* Quick View Modal */
.quick-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.quick-view-modal.active {
    opacity: 1;
    visibility: visible;
}

.quick-view-modal:focus {
    outline: none;
}

.quick-view-close:focus-visible,
.quick-view-nav:focus-visible,
.image-modal-close:focus-visible,
.image-modal-nav:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.quick-view-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.quick-view-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.quick-view-modal.active .quick-view-content {
    transform: translate(-50%, -50%) scale(1);
}

.quick-view-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-page, #f8f9fa);
    color: var(--text-primary, #212529);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    font-size: 1.2rem;
}

.quick-view-close:hover {
    background: #f56565;
    color: white;
    transform: rotate(90deg);
}

.quick-view-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.quick-view-gallery {
    position: relative;
    background: var(--bg-page, #f8f9fa);
    border-radius: 12px;
    padding: 0.75rem;
}

.quick-view-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.quick-view-track::-webkit-scrollbar {
    display: none;
}

.quick-view-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.quick-view-slide img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

.quick-view-image-placeholder {
    width: 100%;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--border-light, #e9ecef);
}

.quick-view-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary, #212529);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.quick-view-prev {
    left: 10px;
}

.quick-view-next {
    right: 10px;
}

.quick-view-nav:hover {
    border-color: rgba(0, 0, 0, 0.16);
    background: rgba(255, 255, 255, 0.98);
}

.quick-view-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.quick-view-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-view-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    margin: 0;
}

.quick-view-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary, #636c73);
    margin: 0;
    padding: 1rem;
    background: var(--bg-page, #f8f9fa);
    border-radius: 8px;
    border-left: 3px solid var(--accent-primary, #5b5ede);
}

/*
 * Цены в быстром просмотре. Скидка и старая цена уже считались в quickView(),
 * но выводилась только новая цена: на карточке было «739 ₽, 950 ₽, −22 %»,
 * а в открытом окне — просто «739 ₽», и выгода пропадала ровно там, где
 * принимают решение.
 */
.quick-view-prices {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.6rem 0.75rem;
}

.quick-view-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary, #5b5ede);
}

.quick-view-price-original {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-muted, #606669);
    text-decoration: line-through;
}

.quick-view-discount {
    align-self: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.28);
}

.quick-view-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
}

.btn-view-details {
    padding: 0.875rem 1.5rem;
    background: var(--bg-page, #f8f9fa);
    border: 2px solid var(--border-light, #e9ecef);
    border-radius: 10px;
    color: var(--text-primary, #212529);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-view-details:hover {
    background: var(--accent-primary, #5b5ede);
    border-color: var(--accent-primary, #5b5ede);
    color: white;
    transform: translateY(-2px);
}

/* Toast Notifications */
.storefront-live-announcer {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/*
 * Всплывающее уведомление. Прежний вид — белый прямоугольник, цветная полоска
 * слева и текст цветом статуса: «Товар добавлен в корзину» набиралось зелёным
 * #48bb78 по белому, это контраст 2,3:1 при норме 4,5:1. Теперь цвет несёт
 * только кружок с иконкой, а текст тёмный и читаемый.
 * Появление — пружиной с небольшого сдвига (было 400 px рывком), внизу тонкая
 * полоса обратного отсчёта, синхронная с 3 с автозакрытия в footer.js.
 */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    border: 1px solid rgba(24, 32, 29, 0.07);
    padding: 0.9rem 1.35rem 0.9rem 0.9rem;
    border-radius: 16px;
    box-shadow:
        0 18px 44px rgba(24, 32, 29, 0.16),
        0 2px 6px rgba(24, 32, 29, 0.07);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 10000;
    opacity: 0;
    transform: translateX(28px) scale(0.96);
    transition:
        opacity 0.24s ease,
        transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
    color: #1f2a26;
    max-width: min(380px, calc(100vw - 40px));
    overflow: hidden;
}

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

/* Полоса обратного отсчёта до автозакрытия */
.toast-notification::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--toast-accent, #0b5e86);
    opacity: 0.55;
    transform-origin: left center;
    transform: scaleX(0);
}

.toast-notification.show::after {
    animation: toast-countdown 3s linear forwards;
}

@keyframes toast-countdown {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Цвет статуса — только на кружке иконки и на полосе отсчёта */
.toast-notification i {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #ffffff;
    background: var(--toast-accent, #0b5e86);
    box-shadow: 0 6px 16px var(--toast-glow, rgba(11, 94, 134, 0.32));
}

.toast-success {
    --toast-accent: linear-gradient(135deg, #2f9e6b 0%, #24855a 100%);
    --toast-glow: rgba(36, 133, 90, 0.34);
}

.toast-error {
    --toast-accent: linear-gradient(135deg, #e05656 0%, #c53d3d 100%);
    --toast-glow: rgba(197, 61, 61, 0.32);
}

.toast-info {
    --toast-accent: linear-gradient(135deg, #1a7fa8 0%, #0b5e86 100%);
    --toast-glow: rgba(11, 94, 134, 0.3);
}

@media (prefers-reduced-motion: reduce) {
    .toast-notification {
        transition: opacity 0.2s ease;
        transform: none;
    }

    .toast-notification.show {
        transform: none;
    }

    .toast-notification.show::after {
        animation: none;
        transform: scaleX(1);
    }
}

/* ========== CART NOTIFICATION (Mobile) ========== */
.cart-notification-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px 20px 0 0;
}

.cart-notification-mobile.show {
    transform: translateY(0);
}

.cart-notif-content {
    padding: 1.5rem;
}

.cart-notif-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.cart-notif-icon i {
    font-size: 3rem;
    color: #48bb78;
    animation: checkmark-pop 0.3s ease-out;
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.cart-notif-body {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-page, #f8f9fa);
    border-radius: 12px;
}

.cart-notif-image,
.cart-notif-image-placeholder {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-light, #e9ecef);
}

.cart-notif-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #ffffff);
    color: var(--text-muted, #606669);
    font-size: 1.5rem;
}

.cart-notif-info {
    flex: 1;
    min-width: 0;
}

.cart-notif-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary, #636c73);
    margin-bottom: 0.25rem;
}

.cart-notif-product {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary, #212529);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-notif-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-primary, #5b5ede);
}

.cart-notif-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-notif-btn {
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cart-notif-btn-primary {
    background: linear-gradient(135deg, var(--accent-primary, #5b5ede), var(--accent-secondary, #8b5cf6));
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.cart-notif-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.cart-notif-btn-secondary {
    background: var(--bg-page, #f8f9fa);
    color: var(--text-primary, #212529);
    border: 1px solid var(--border-default, #dee2e6);
}

.cart-notif-btn-secondary:hover {
    background: var(--bg-card, #ffffff);
}

.cart-notif-btn-danger {
    background: rgba(var(--bs-danger-rgb), 0.08);
    color: var(--bs-danger);
    border: 1px solid rgba(var(--bs-danger-rgb), 0.25);
}

.cart-notif-btn-danger:hover {
    background: rgba(var(--bs-danger-rgb), 0.14);
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    background: white;
    border: 1px solid var(--border-light, #e9ecef);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.skeleton-image {
    width: 100%;
    padding-top: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    width: 60%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-button {
    height: 44px;
    width: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: calc(96px + var(--cookie-consent-height, 0px));
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-primary, #5b5ede), var(--accent-secondary, #8b5cf6));
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.3s ease;
    z-index: 999;
}

/* Product page: keep Back-to-Top above sticky buy bar on mobile */
@media (max-width: 768px) {
    body.page-product .back-to-top {
        bottom: calc(96px + var(--cookie-consent-height, 0px) + 84px + env(safe-area-inset-bottom, 0px));
    }
}

/* Cookie consent banner */
.cookie-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3500;
    background: var(--bg-card, #ffffff);
    border-top: 1px solid var(--border-light, #e9ecef);
}

.cookie-consent__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
}

.cookie-consent__text {
    color: var(--text-secondary, #636c73);
    font-size: 0.95rem;
}

.cookie-consent__text a {
    color: var(--accent-primary, #5b5ede);
    text-decoration: none;
    font-weight: 600;
}

.cookie-consent__text a:hover {
    text-decoration: underline;
}

.cookie-consent__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-consent__accept,
.cookie-consent__reject {
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    justify-content: center;
}

.cookie-consent__reject {
    border: 1px solid var(--border-light, #e9ecef);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, #636c73);
}

@media (max-width: 576px) {
    .cookie-consent__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-consent__actions {
        flex-direction: column-reverse;
    }

    .cookie-consent__actions .cookie-consent__accept,
    .cookie-consent__actions .cookie-consent__reject {
        width: 100%;
    }
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ========== MOBILE RESPONSIVE (≤768px) ========== */
@media (max-width: 768px) {

    /* ===== HEADER ===== */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .header-top-bar {
        padding: 0.75rem 0;
        flex-direction: row;
        gap: 0.75rem;
        align-items: center;
        justify-content: space-between;
    }

    .city-selector {
        font-size: 0.8rem;
        flex: 1;
    }

    .mobile-top-buttons {
        display: flex !important;
        gap: 0.5rem;
    }

    .header-contacts {
        display: none;
        /* Hide on mobile, use button instead */
    }

    .header-content {
        gap: 0.75rem;
        padding: 1rem 0;
        position: relative;
    }

    .header-left {
        flex: 1;
        min-width: 0;
        order: 2;
    }

    .header-left a {
        gap: 0.5rem;
    }

    .store-logo {
        height: 36px;
    }

    .store-title {
        font-size: 1rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Show mobile elements */
    .mobile-menu-toggle {
        display: flex;
        order: 1;
        flex-shrink: 0;
        /*
         * Размер задаём здесь же, где кнопку показываем. Премиум-слой доводит
         * бургер до 44×44 только до 767.98px, а показывается он до 768px
         * включительно — ровно на 768 (портретный iPad) оставались базовые
         * 30×24 от десктопного правила.
         */
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    /* Hide desktop search */
    .header-center {
        display: none !important;
    }

    .header-right {
        order: 5;
        flex-shrink: 0;
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .cart-button {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
        border-radius: 10px;
    }

    .cart-badge {
        top: -4px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }

    /* ===== NAVIGATION ===== */
    /* Hide desktop nav on mobile, show in hamburger instead */
    .store-nav {
        display: none !important;
    }

    /* Dropdown styles (for use inside hamburger menu) */
    .nav-item-dropdown {
        position: relative;
        flex-shrink: 0;
    }

    .nav-item-dropdown .nav-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
        max-width: none;
        min-width: 90px;
        text-align: center;
    }

    .nav-item-dropdown .nav-link span {
        display: block;
    }

    .nav-item-dropdown .dropdown-arrow {
        display: block;
        margin-left: 0;
        margin-top: 0.125rem;
    }

    .nav-dropdown-content {
        position: absolute !important;
        top: calc(100% + 0.5rem) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        bottom: auto !important;
        min-width: 180px !important;
        width: auto !important;
        max-width: 90vw !important;
        max-height: 300px !important;
        overflow-y: auto !important;
        border-radius: 12px !important;
        padding: 0.5rem !important;
        display: none !important;
        grid-template-columns: 1fr !important;
        gap: 0.25rem !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        z-index: 9999 !important;
    }

    .nav-item-dropdown.active .nav-dropdown-content,
    .nav-item-dropdown:hover .nav-dropdown-content {
        display: block !important;
    }

    .nav-dropdown-item {
        padding: 0.625rem 1rem !important;
        text-align: left !important;
        border-radius: 8px !important;
        background: transparent !important;
        font-size: 0.875rem !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        display: block !important;
    }

    .nav-dropdown-item:hover,
    .nav-dropdown-item:active {
        background: var(--bg-page, #f8f9fa) !important;
        color: var(--accent-primary, #5b5ede) !important;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .hero-section h2 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.375rem;
        padding: 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    /* Mobile: цена и старая цена в одну строку (в карточках) */
    .product-prices {
        flex-direction: row !important;
        align-items: baseline !important;
        gap: 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    .product-price {
        display: inline-block !important;
        margin-bottom: 0 !important;
        white-space: nowrap;
    }

    .product-price-original {
        display: inline-block !important;
        white-space: nowrap;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .nav-links {
        gap: 0.5rem;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding-bottom: 0.5rem;
    }

    .nav-link {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
        white-space: normal;
        text-align: center;
        flex-shrink: 0;
        min-width: fit-content;
        max-width: 120px;
    }

    .nav-link span {
        display: block;
        line-height: 1.2;
        word-wrap: break-word;
    }

    .nav-link i {
        font-size: 0.95rem;
    }

    .nav-item-dropdown .nav-link {
        max-width: 100px;
    }

    .footer-links {
        gap: 1rem;
        font-size: 0.875rem;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-section {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .sort-select {
        min-width: auto;
        width: 100%;
    }

    .filter-actions {
        flex-direction: column;
    }

    .price-inputs {
        flex-wrap: wrap;
    }

    .quick-view-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    /* Mobile: свайп по галерее + виден край соседнего изображения */
    .quick-view-gallery {
        padding: 0.5rem 0;
        overflow: visible;
    }

    .quick-view-track {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 12px;
    }

    .quick-view-slide {
        flex: 0 0 94%;
    }

    .quick-view-slide img {
        max-height: 320px;
    }

    /* На мобилке перелистываем свайпом */
    .quick-view-nav {
        display: none;
    }

    .toast-notification {
        right: 10px;
        top: 10px;
        left: 10px;
        width: auto;
    }

    .slider-nav {
        display: none;
    }

    /* Hide sidebar on mobile - it's now in hamburger menu */
    .store-sidebar {
        display: none !important;
    }

    /* Remove sidebar spacing when hidden */
    .page-layout {
        grid-template-columns: 1fr !important;
    }
}

/* Image modal: на мобилке максимально полноэкранно */
@media (max-width: 768px) {
    .image-modal {
        padding: 0.75rem;
    }

    .image-modal img {
        max-width: 100%;
        max-height: 100vh;
    }
}

/* Catalog/categories: tighter mobile spacing */
@media (max-width: 768px) {
    .page-layout {
        margin-top: 1rem;
        margin-bottom: 1rem;
        gap: 1rem;
    }

    .breadcrumbs {
        margin-bottom: 0.75rem;
        gap: 0.4rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .breadcrumbs::-webkit-scrollbar {
        display: none;
    }

    .breadcrumbs a,
    .breadcrumbs span {
        flex: 0 0 auto;
    }

    /* Длинный текущий пункт (последний) не должен раздувать высоту */
    .breadcrumbs span:last-child {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .catalog-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .catalog-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
        line-height: 1.2;
    }

    .catalog-info {
        font-size: 0.9rem;
    }

    .filters-bar {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
    }

    .filters-panel {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .categories-grid {
        margin-bottom: 1.5rem;
    }
}

/* ========== CATALOG LOAD MORE ========== */
/*
 * Догрузка товаров. Был крутящийся спиннер с подписью «Загрузка товаров…» —
 * он ничего не сообщал о том, что появится, и страница на секунду «пустела».
 * Теперь на месте будущих карточек стоят их контуры с бегущим бликом: видно
 * и сколько товаров подгружается, и куда они встанут, а высота блока совпадает
 * с высотой ряда, поэтому подгрузка не дёргает страницу.
 */
.infinite-scroll-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0 2rem;
    color: var(--text-muted, #606669);
}

.catalog-load-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 1.25rem 0 2rem;
    text-align: center;
}

.catalog-load-progress,
.catalog-load-status {
    margin: 0;
    color: var(--text-muted, #606669);
    font-size: 0.9rem;
}

.catalog-load-more {
    min-width: min(100%, 240px);
    min-height: 48px;
    padding: 0.75rem 1.4rem;
    border: 1px solid var(--primary-color, #007db1);
    border-radius: 14px;
    color: #fff;
    background: var(--primary-color, #007db1);
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.catalog-load-more:hover:not(:disabled),
.catalog-load-more:focus-visible:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 9px 24px rgba(0, 125, 177, 0.2);
}

.catalog-load-more:disabled {
    cursor: wait;
    opacity: 0.68;
}

.catalog-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: -0.4rem 0 1rem;
}

.catalog-active-filters__label {
    color: var(--text-muted, #606669);
    font-size: 0.85rem;
    font-weight: 650;
}

.catalog-active-filters__chip {
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(0, 125, 177, 0.16);
    border-radius: 999px;
    color: #285d6f;
    background: #edf7fa;
    font-size: 0.82rem;
    line-height: 1.2;
    white-space: nowrap;
}

.catalog-active-filters__reset {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding-inline: 0.3rem;
    color: var(--primary-color, #007db1);
    font-size: 0.84rem;
    font-weight: 700;
}

.filters-panel__mobile-head {
    display: none;
}

/*
 * Каркас у контура тот же, что у настоящей карточки: .product-card,
 * .product-image-wrapper и .product-info. Поэтому падинги, скругления и
 * пропорция обложки берутся из настроек магазина, а не задаются здесь заново
 * и не разъезжаются при их смене. Свои размеры только у полосок внутри —
 * они повторяют замеренную карточку: бренд 18, заголовок 47, цены 77,
 * кнопка 50 px. Расхождение в пару пикселей видно лишь в момент догрузки.
 */
.skeleton-card {
    pointer-events: none;
}

.skeleton-card .product-info {
    justify-content: flex-start;
}

.skeleton-line {
    border-radius: 6px;
}

.skeleton-line--brand {
    height: 18px;
    width: 45%;
    margin-bottom: 16px;
}

.skeleton-line--title {
    height: 47px;
    width: 90%;
    margin-top: 8.8px;
    margin-bottom: 12px;
    border-radius: 8px;
}

.skeleton-line--facts {
    height: 24px;
    width: 72%;
    margin-bottom: 12px;
    border-radius: 999px;
}

.skeleton-prices {
    height: 77px;
    margin-bottom: 12.8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line--price {
    height: 32px;
    width: 52%;
}

.skeleton-line--old {
    height: 18px;
    width: 32%;
}

.skeleton-line--button {
    height: 50px;
    width: 100%;
    border-radius: 10px;
}

/* Общий блик: один фон на все плашки, чтобы волна шла по карточке целиком */
.skeleton-card .product-image-wrapper,
.skeleton-line {
    background:
        linear-gradient(
            100deg,
            rgba(233, 236, 235, 0.85) 20%,
            rgba(246, 248, 247, 0.95) 42%,
            rgba(233, 236, 235, 0.85) 64%
        );
    background-size: 220% 100%;
    animation: skeleton-sweep 1.55s ease-in-out infinite;
}

@keyframes skeleton-sweep {
    from { background-position: 130% 0; }
    to { background-position: -30% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-card .product-image-wrapper,
    .skeleton-line {
        animation: none;
        background: rgba(233, 236, 235, 0.9);
    }
}

/* ========== PAGE LAYOUT WITH SIDEBAR ========== */
.page-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.page-layout.no-sidebar {
    grid-template-columns: 1fr;
}

.page-content {
    min-width: 0;
    /* Prevent grid blowout */
}

/* Custom page styles */
.custom-page {
    background: var(--bg-card, #ffffff);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.custom-page h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary, #212529);
}

.custom-page .page-body {
    color: var(--text-secondary, #636c73);
    line-height: 1.8;
}

.custom-page .page-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary, #212529);
}

.custom-page .page-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #212529);
}

.custom-page .page-body p {
    margin-bottom: 1rem;
}

.custom-page .page-body ul,
.custom-page .page-body ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.custom-page .page-body li {
    margin-bottom: 0.5rem;
}

.custom-page .page-body a {
    color: var(--accent-primary, #5b5ede);
    text-decoration: underline;
}

.custom-page .page-body a:hover {
    text-decoration: none;
}

.custom-page .page-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Long text safety (mobile + desktop) */
.custom-page,
.custom-page .page-body {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.custom-page h1,
.custom-page .page-body h2,
.custom-page .page-body h3,
.custom-page .page-body p,
.custom-page .page-body li,
.custom-page .page-body a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.custom-page .page-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.custom-page .page-body pre,
.custom-page .page-body code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Responsive layout */
@media (max-width: 991px) {
    .page-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ========== SIDEBAR MENU ========== */
.store-sidebar {
    background: var(--bg-card, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar-header {
    border-bottom: 2px solid var(--border-light, #e9ecef);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #212529);
}

.sidebar-menu,
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-submenu {
    padding-left: 1.25rem;
    margin-top: 0.5rem;
    display: none;
}

.sidebar-submenu.open {
    display: block;
}

.sidebar-menu>li {
    margin-bottom: 0.5rem;
}

.sidebar-menu-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary, #636c73);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-menu-link:hover {
    background: var(--accent-primary, #5b5ede);
    color: white;
    transform: translateX(4px);
}

.sidebar-menu-link.active {
    background: var(--accent-primary, #5b5ede);
    color: white;
}

.menu-item-with-children {
    display: flex;
    align-items: center;
}

.menu-item-with-children .sidebar-menu-link {
    flex: 1;
}

.submenu-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted, #606669);
    transition: transform 0.2s;
}

.submenu-toggle:hover {
    color: var(--accent-primary, #5b5ede);
}

.submenu-toggle.active {
    transform: rotate(180deg);
}

.submenu-toggle i {
    display: block;
}

/* Responsive sidebar */
@media (max-width: 991px) {
    .store-sidebar {
        position: static;
        max-height: none;
        margin-bottom: 2rem;
    }
}

/* ========== EXTRA SMALL DEVICES (< 480px) ========== */
@media (max-width: 479px) {
    .nav-links {
        gap: 0.25rem;
        padding-bottom: 0.25rem;
    }

    .nav-link {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
        flex-direction: column;
        gap: 0.25rem;
        flex: 0 0 auto;
        width: 70px;
    }

    .nav-link span {
        font-size: 0.65rem;
        line-height: 1.1;
    }

    .nav-link i {
        font-size: 0.9rem;
    }

    /* Dropdown на очень маленьких экранах */
    .nav-item-dropdown .nav-link {
        width: 75px;
        padding: 0.5rem 0.5rem;
    }

    .nav-item-dropdown .dropdown-arrow {
        font-size: 0.65rem;
    }

    .nav-dropdown-content {
        min-width: 150px !important;
        max-width: 85vw !important;
    }

    .nav-dropdown-item {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
    }

    .store-title {
        font-size: 0.875rem;
    }

    .store-logo {
        height: 28px;
    }

    .city-selector {
        font-size: 0.8rem;
    }

    .header-contacts {
        flex-wrap: wrap;
    }

    .contact-link {
        font-size: 0.8rem;
    }

    .search-input {
        padding: 0.5rem 2rem 0.5rem 2rem;
        font-size: 0.8rem;
    }

    .cart-badge {
        font-size: 0.65rem;
        padding: 0.1rem 0.35rem;
    }

    .nav-dropdown-content {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
    }

    .nav-dropdown-item {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.7rem !important;
    }

    .section-title {
        font-size: 1.125rem;
        padding: 0.75rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.75rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.5rem;
    }

    .product-card {
        padding: 0.75rem;
    }

    .product-card .product-image {
        height: 100%;
        padding: 0.25rem;
    }

    .product-title {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 0.9rem;
    }

    .product-rating {
        font-size: 0.65rem;
    }
}

/* ===== CART PAGE STYLES ===== */
/* Фикс для кнопки корзины - компактный размер везде */
.header-right .cart-button,
a.cart-button {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.3rem !important;
    border-radius: 11px !important;
}

/* Кнопка ЛК в шапке: выравниваем по размеру с корзиной */
.header-right .account-button {
    height: 44px !important;
    font-size: 1.3rem !important;
    border-radius: 11px !important;
}

.header-right .account-button i {
    font-size: 1.3rem !important;
}

/* Компактнее на мобильных, но не мельче 44×44 — минимальная тач-цель */
@media (max-width: 768px) {

    .header-right .cart-button,
    a.cart-button {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem !important;
        border-radius: 10px !important;
    }

    .header-right .account-button {
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        justify-content: center;
        font-size: 1.2rem !important;
        border-radius: 10px !important;
    }

    .header-right .account-button i {
        font-size: 1.2rem !important;
    }
}

.cart-page {
    padding: 2rem 0;
    min-height: 60vh;
}

.cart-container {
    display: grid;
    /* minmax(0, ..) предотвращает «раздувание» колонок из-за длинного контента */
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem;
    max-width: 100%;
}

.cart-items {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    min-width: 0;
    max-width: 100%;
}

.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.cart-empty i {
    font-size: 5rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
    font-weight: 400;
}

.cart-empty h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.cart-empty p {
    color: #718096;
    margin-bottom: 2rem;
}

.cart-empty .btn-catalog {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--accent-primary, #5b5ede), var(--accent-secondary, #8b5cf6));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.cart-empty .btn-catalog:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: white;
}

.cart-empty .btn-catalog i {
    font-size: 1.2rem;
    color: white;
    margin: 0;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.cart-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

.cart-item-title:hover {
    color: var(--primary, var(--accent-primary, #6366f1));
}

.cart-item-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    background: #f7fafc;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    color: #4a5568;
    transition: background 0.2s;
}

.quantity-btn:hover {
    background: #edf2f7;
}

.quantity-value {
    padding: 0.5rem 1rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.remove-btn {
    background: none;
    border: none;
    color: #f56565;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    transition: transform 0.2s;
}

.remove-btn:hover {
    transform: scale(1.2);
}

.cart-item-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
    text-align: right;
    white-space: nowrap;
}

.cart-summary {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 20px;
    min-width: 0;
    max-width: 100%;
}

/* Планшеты/узкие экраны: уводим summary вниз, чтобы не было горизонтального скролла */
@media (max-width: 991px) {
    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: relative;
        top: auto;
        margin-top: 1.5rem;
    }
}

.cart-summary h2,
.cart-summary h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.summary-row:last-of-type {
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1rem;
}

.delivery-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.delivery-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}

/* Стили только для селектора города в форме доставки */
.delivery-section .city-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.delivery-section .city-selector input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.delivery-section .city-selector button {
    padding: 0.75rem 1.5rem;
    background: var(--primary, var(--accent-primary, #6366f1));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.delivery-section .city-selector button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.delivery-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.delivery-option:hover {
    border-color: var(--primary, var(--accent-primary, #6366f1));
}

.delivery-option.selected {
    border-color: var(--primary, var(--accent-primary, #6366f1));
    background: #f0f4ff;
}

.delivery-option input[type="radio"] {
    margin-right: 0.75rem;
}

.delivery-info {
    flex: 1;
}

.delivery-content {
    flex: 1;
    min-width: 0;
}

.delivery-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.delivery-period {
    font-size: 0.85rem;
    color: #718096;
}

.delivery-price {
    font-weight: 700;
    color: #2d3748;
    font-size: 1.1rem;
    white-space: nowrap;
}

.delivery-loading {
    text-align: center;
    padding: 1rem;
    color: #718096;
}

.delivery-error {
    padding: 0.75rem;
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-radius: 8px;
    color: #c53030;
    font-size: 0.9rem;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1rem 0;
    color: #1a1a1a;
}

.cart-page #totalWithDelivery {
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .cart-page .summary-total {
        display: grid;
        grid-template-columns: minmax(0, 1fr) max-content;
        gap: 0.75rem;
        align-items: baseline;
    }
}

@media (max-width: 359.98px) {
    /* На самом узком экране очень длинная сумма уже не помещается рядом с
       подписью даже при корректных двух колонках. Сохраняем число цельным и
       переносим его отдельной, выровненной вправо строкой. */
    .cart-page .summary-total {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0.375rem;
    }

    .cart-page #totalWithDelivery {
        justify-self: end;
    }
}

.checkout-btn {
    width: 100%;
    background: var(--gradient, linear-gradient(135deg, var(--accent-primary, #6366f1), var(--accent-secondary, #8b5cf6)));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.checkout-btn:hover {
    transform: translateY(-2px);
}

.checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: #4a5568;
    text-decoration: none;
}

.continue-shopping:hover {
    color: var(--primary, var(--accent-primary, #6366f1));
}

/* Checkout Modal */
.checkout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.checkout-modal.active {
    display: flex;
}

.checkout-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.checkout-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #718096;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary, var(--accent-primary, #6366f1));
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.order-summary-modal {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.order-summary-modal h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.submit-order-btn {
    width: 100%;
    background: var(--gradient, linear-gradient(135deg, var(--accent-primary, #6366f1), var(--accent-secondary, #8b5cf6)));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.submit-order-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Delete Modal */
.delete-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.delete-modal.active {
    opacity: 1;
    visibility: visible;
}

.delete-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.delete-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    text-align: center;
}

.delete-modal.active .delete-modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.delete-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.delete-modal-icon i {
    font-size: 2.5rem;
    color: white;
}

.delete-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
}

.delete-modal-text {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.delete-modal-actions {
    display: flex;
    gap: 1rem;
}

.btn-cancel,
.btn-delete {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-cancel {
    background: #f7fafc;
    color: #4a5568;
}

.btn-cancel:hover {
    background: #edf2f7;
    transform: translateY(-2px);
}

.btn-delete {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

/* Success Modal */
.success-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.success-modal.active {
    display: flex;
}

.success-modal-content {
    background: white;
    border-radius: 24px;
    padding: 3rem 2.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.4s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease 0.2s both;
}

.success-icon i {
    font-size: 3.5rem;
    color: white;
}

.success-modal h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
}

.order-details {
    background: #f8fafb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.order-details p {
    margin: 0.5rem 0;
    color: #4a5568;
    font-size: 1rem;
}

.order-details strong {
    color: var(--accent-primary, #5b5ede);
    font-size: 1.2rem;
}

.success-message {
    color: #718096 !important;
    font-size: 0.95rem !important;
}

.btn-success-continue {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-primary, #5b5ede), var(--accent-secondary, #8b5cf6));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* Стили для скидок */
.old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f56565 0%, #ef4444 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.savings-row {
    color: #10b981;
    font-weight: 600;
}

.savings-row i {
    color: #10b981;
}

.savings-amount {
    color: #10b981;
    font-weight: 700;
}

@media (max-width: 768px) {
    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-items {
        padding: 0.75rem;
        border-radius: 12px;
        margin: 0 -0.25rem;
    }

    .cart-item {
        display: grid;
        grid-template-columns: 84px 1fr;
        grid-template-areas:
            "image info"
            "image controls"
            "image total";
        column-gap: 0.75rem;
        row-gap: 0.5rem;
        padding: 0.75rem 0;
        max-width: 100%;
    }

    .cart-item-image {
        grid-area: image;
        width: 84px;
        height: 84px;
        aspect-ratio: 1 / 1;
        overflow: hidden;
        background: #f7fafc;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }

    .cart-item-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .cart-item-info {
        grid-area: info;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .cart-item-title {
        font-size: 0.95rem;
        line-height: 1.4;
        font-weight: 600;
        color: #1a1a1a;
        margin: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .cart-item-price {
        font-size: 1.2rem;
        font-weight: 700;
        color: #1a1a1a;
        margin: 0.25rem 0;
    }

    .cart-item-total {
        grid-area: total;
        font-size: 1.2rem;
        font-weight: 700;
        color: #1a1a1a;
        text-align: right;
        margin-top: 0;
    }

    .cart-item-controls {
        grid-area: controls;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .quantity-controls {
        display: inline-flex;
        align-items: center;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        overflow: hidden;
        background: #f7fafc;
    }

    .quantity-btn {
        background: transparent;
        border: none;
        padding: 0.4rem 0.6rem;
        font-size: 1rem;
        color: #4a5568;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
    }

    .quantity-value {
        padding: 0.4rem;
        font-weight: 600;
        min-width: 32px;
        text-align: center;
        font-size: 0.9rem;
        background: white;
    }

    .remove-btn {
        background: none;
        border: none;
        color: #f56565;
        font-size: 1.4rem;
        padding: 0.4rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .old-price {
        display: block;
        font-size: 0.8rem;
        margin-bottom: 0.15rem;
    }

    .discount-badge {
        font-size: 0.7rem;
        padding: 0.1rem 0.3rem;
    }

    .cart-summary {
        position: relative !important;
        top: auto !important;
        margin-bottom: 0;
        margin-top: 1.5rem;
    }

    .cart-page {
        padding-bottom: 6rem;
        /* Space for footer */
    }

    .container.cart-page {
        margin-bottom: 4rem;
    }

    .checkout-header {
        display: none;
    }
}

/* ===== CATALOG PAGE STYLES ===== */
.catalog-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.sidebar {
    flex: 0 0 280px;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

.category-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-menu>li {
    margin-bottom: 0.5rem;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    color: #4a5568;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.category-link:hover {
    background: #f7fafc;
    color: #2d3748;
}

.category-link.active {
    background: <?=htmlspecialchars($store['primary_color'] ?? '#4f46e5') ?>;
    color: white;
    font-weight: 500;
}

.category-count {
    font-size: 0.85rem;
    opacity: 0.7;
}

.subcategories {
    list-style: none;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.subcategories .category-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.catalog-content {
    flex: 1;
    min-width: 0;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #718096;
}

.breadcrumbs a,
.breadcrumbs span {
    white-space: nowrap;
}

.breadcrumbs a {
    color: #4a5568;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: <?=htmlspecialchars($store['primary_color'] ?? '#4f46e5') ?>;
}

.breadcrumb-separator {
    color: #cbd5e0;
    white-space: nowrap;
}

.catalog-header {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.catalog-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.catalog-info {
    color: #718096;
    font-size: 0.95rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.no-products {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
}

.no-products i {
    font-size: 4rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .catalog-container {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        flex: none;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
}

/* ===== CHECKOUT PAGE STYLES ===== */
body.checkout-page {
    background-color: var(--bg-primary, #f8f9fa);
}

.checkout-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.checkout-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary, #212529);
}

.delivery-option {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.delivery-option:hover {
    border-color: var(--accent-primary, #007bff);
}

.delivery-option.selected {
    border-color: var(--accent-primary, #007bff);
    background-color: rgba(var(--accent-primary-rgb, 0, 123, 255), 0.05);
}

.delivery-option input[type="radio"] {
    margin-right: 0.75rem;
}

.delivery-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delivery-name {
    font-weight: 500;
}

.delivery-period {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.delivery-price {
    font-weight: 600;
    color: var(--accent-primary, #007bff);
}

.order-summary {
    position: sticky;
    top: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
}

.checkout-page .cart-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.checkout-page .cart-item:last-child {
    border-bottom: none;
}

.checkout-page .cart-item-image {
    width: 72px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f3f5;
    flex: 0 0 auto;
}

.checkout-page .cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.checkout-page .cart-item-details {
    flex: 1;
}

.checkout-page .cart-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.checkout-page .cart-item-quantity {
    font-size: 0.875rem;
    color: #6c757d;
}

.checkout-page .cart-item-price {
    font-weight: 600;
    white-space: nowrap;
}

.checkout-page .btn-submit-order {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--accent-primary, #007bff);
    border: none;
    color: white;
}

.checkout-page .btn-submit-order:hover {
    background: var(--accent-secondary, #0056b3);
}

button.btn-checkout:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.checkout-page .city-search {
    position: relative;
}

.checkout-page .city-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.city-result-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    cursor: pointer;
    text-align: left;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #f0f0f0;
    font: inherit;
    color: inherit;
}

.city-result-item:hover,
.city-result-item.is-active,
.city-result-item:focus-visible {
    background-color: #f8f9fa;
}

.city-result-item:focus-visible {
    outline: 3px solid var(--input-focus, #4f46e5);
    outline-offset: -3px;
}

.city-result-item:last-child {
    border-bottom: none;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 1rem;
}

@media (max-width: 991px) {
    .order-summary {
        position: static;
        margin-top: 2rem;
    }
}

/* ===== PRODUCT PAGE STYLES ===== */

.product-page {
    padding: 2rem 0;
}

/* Prevent double-tap zoom quirks on interactive controls */
.quantity-btn,
.add-to-cart-btn,
.thumbnail,
.slider-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Sticky buy bar (mobile) */
.product-sticky-buy {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--cookie-consent-height, 0px);
    background: var(--bg-card, #ffffff);
    border-top: 1px solid var(--border-light, #e9ecef);
    z-index: 3000;
}

.product-sticky-buy__inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    flex-wrap: nowrap;
}

.product-sticky-buy__price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    white-space: nowrap;
}

.product-sticky-buy__price-current {
    font-size: 1.05rem;
    line-height: 1.1;
}

.product-sticky-buy__price-old {
    margin-left: 0;
    font-weight: 600;
    color: var(--text-muted, #606669);
    text-decoration: line-through;
    font-size: 0.8rem;
}

.product-sticky-buy__discount {
    margin-left: 0;
    display: inline-block;
    padding: 0.08rem 0.3rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.78rem;
    background: var(--primary, var(--accent-primary, #6366f1));
    color: var(--text-light, #ffffff);
}

.quantity-selector--sticky {
    border-radius: 10px;
    height: 2.35rem;
    border-width: 1px;
    border-color: var(--border-light, #e9ecef);
}

.quantity-selector--sticky .quantity-btn {
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.quantity-selector--sticky .quantity-value {
    min-width: 2.35rem;
    height: 2.35rem;
    line-height: 2.35rem;
    font-size: 0.95rem;
    padding: 0;
}

.add-to-cart-btn--sticky {
    flex: 1;
    justify-content: center;
    height: 2.35rem;
    padding: 0 0.75rem;
    font-size: 0.95rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #718096;
}

.breadcrumbs a,
.breadcrumbs span {
    white-space: nowrap;
}

.breadcrumbs a {
    color: #4a5568;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary, var(--accent-primary, #6366f1));
}

.breadcrumb-separator {
    color: #cbd5e0;
    white-space: nowrap;
}

.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 3rem;
}

@media (min-width: 769px) {
    .product-page .product-container {
        grid-template-rows: auto minmax(0, 1fr);
        column-gap: clamp(2rem, 5vw, 5.5rem);
        row-gap: 1rem;
        align-items: start;
    }

    .product-page .product-intro {
        grid-column: 2;
        grid-row: 1;
    }

    .product-page .product-gallery {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .product-page .product-details {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (max-width: 768px) {
    .product-page .product-container {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
    }
}

.product-intro .product-categories {
    margin-bottom: 0;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Product page (desktop): thumbnails column on the left */
@media (min-width: 992px) {
    .product-page .product-gallery {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 0.75rem;
        align-items: start;
    }

    .product-page .product-gallery-slider {
        grid-column: 2;
        grid-row: 1;
    }

    .product-page .thumbnail-gallery {
        grid-column: 1;
        grid-row: 1;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        align-content: start;
        max-height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
    }

    .product-page .thumbnail-gallery::-webkit-scrollbar {
        display: none;
    }

    .product-page .thumbnail {
        width: 100%;
    }
}



.main-image {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1/1;
    border-radius: 12px;
    overflow: hidden;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.main-image::after {
    content: '🔍';
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.main-image:hover::after {
    opacity: 1;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.thumbnail {
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: var(--bg-card, #ffffff);
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary, var(--accent-primary, #6366f1));
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Product gallery slider (product.php) */
.product-gallery-slider {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    background: #f7fafc;
    position: relative;
}

.product-swipe-hint {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.product-swipe-hint.active {
    opacity: 1;
}

.product-swipe-hint__inner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.70);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.product-swipe-hint__inner i {
    font-size: 1.05rem;
    animation: productSwipeHintNudge 1.2s ease-in-out infinite;
}

@keyframes productSwipeHintNudge {
    0% {
        transform: translateX(0);
        opacity: 0.85;
    }

    30% {
        transform: translateX(-10px);
        opacity: 1;
    }

    60% {
        transform: translateX(10px);
        opacity: 1;
    }

    100% {
        transform: translateX(0);
        opacity: 0.85;
    }
}

.product-gallery-track {
    height: 100%;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.product-gallery-track::-webkit-scrollbar {
    display: none;
}

.product-gallery-slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    box-sizing: border-box;
}

.product-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
}

.product-gallery-nav.prev {
    left: 10px;
}

.product-gallery-nav.next {
    right: 10px;
}

@media (max-width: 768px) {
    /* Product gallery: mobile tweaks */
    .product-page .product-swipe-hint__inner {
        white-space: nowrap;
        font-size: 0.85rem;
        min-width: 190px;
        justify-content: center;
        gap: 0.65rem;
        padding: 7px 14px;
    }

    /* Чуть ниже по высоте (~-10%) на мобилке */
    .product-page .product-gallery-slider {
        aspect-ratio: 7/9;
    }

    /* Показываем край соседних слайдов (только если фото > 1) */
    .product-page .product-gallery-slider.has-multiple .product-gallery-track {
        gap: 8px;
        padding-left: 3%;
        padding-right: 3%;
        scroll-padding-left: 3%;
        scroll-padding-right: 3%;
        box-sizing: border-box;
    }

    .product-page .product-gallery-slider.has-multiple .product-gallery-slide {
        flex: 0 0 94%;
    }

    /* Превью других изображений меньше примерно в 1.5 раза */
    .product-page .thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
        gap: 0.4rem;
    }

    /* На мобилке уменьшаем амплитуду анимации иконки (чтобы не наезжало на текст) */
    .product-page .product-swipe-hint__inner i {
        animation-name: productSwipeHintNudgeMobile;
    }

    @keyframes productSwipeHintNudgeMobile {
        0% { transform: translateX(0); opacity: 0.85; }
        30% { transform: translateX(-7px); opacity: 1; }
        60% { transform: translateX(7px); opacity: 1; }
        100% { transform: translateX(0); opacity: 0.85; }
    }

    .product-gallery-track {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .product-gallery-slide {
        flex: 0 0 100%;
        scroll-snap-align: center;
    }

    /* На мобилке не обрезаем края изображения */
    .product-gallery-slide img {
        object-fit: contain;
        object-position: center;
    }

    .product-gallery-nav {
        display: none;
    }

    .product-swipe-hint {
        display: block;
    }
}

@media (min-width: 769px) {
    .product-swipe-hint {
        display: none;
    }
}

@media (max-width: 768px) {
    .product-sticky-buy {
        display: block;
    }

    /* 2-row layout: price on first row, controls on second */
    .product-sticky-buy__inner {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        column-gap: 0.5rem;
        row-gap: 0.35rem;
        align-items: stretch;
    }

    .product-sticky-buy__price {
        grid-column: 1;
        grid-row: 1;
    }


    /* Account (ЛК): на мобильных меню не должно превращаться в плитки из общего .nav-link */
    .account-nav .nav-link {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 0.5rem;
        width: 100%;
        max-width: none;
        white-space: nowrap;
        flex-wrap: nowrap;
    }

    .account-nav .nav-link i {
        flex: 0 0 auto;
        width: 1.25rem;
        text-align: center;
    }

    @media (max-width: 479px) {
        .account-nav .nav-link {
            flex-direction: row;
            text-align: left;
            padding: 0.6rem 0.75rem;
        }
    }

    .quantity-selector--sticky {
        grid-column: 1;
        grid-row: 2;
        align-self: stretch;
    }

    .add-to-cart-btn--sticky {
        grid-column: 2;
        grid-row: 1 / span 2;
        width: 100%;
        max-width: 220px;
        min-width: 0;
        height: 100%;
        justify-self: end;
        align-self: stretch;
    }

    /* Override generic mobile rule `.quantity-selector { width: 100%; }` */
    .quantity-selector.quantity-selector--sticky {
        width: auto;
        justify-content: center;
    }

    /* Give space for sticky bar */
    .product-page {
        padding-bottom: 6.25rem;
    }

    /* Move purchase controls to sticky bar */
    .price-section .add-to-cart-section {
        display: none;
    }

    /* Price is shown in sticky bar */
    .price-section {
        display: none;
    }

    /* Smaller thumbnails under gallery */
    .thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    }
}

@media (max-width: 360px) {
    .product-sticky-buy__price-current {
        font-size: 0.98rem;
    }

    .quantity-selector--sticky,
    .quantity-selector--sticky .quantity-btn,
    .quantity-selector--sticky .quantity-value {
        height: 2.15rem;
    }

    .quantity-selector--sticky .quantity-btn {
        width: 2.15rem;
    }

    .quantity-selector--sticky .quantity-value {
        min-width: 2.15rem;
        line-height: 2.15rem;
        padding: 0;
    }

    .add-to-cart-btn--sticky {
        padding: 0 0.6rem;
        font-size: 0.9rem;
    }
}

.product-intro h1,
.product-details h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.product-primary-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    color: var(--text-secondary, #5f6966);
    font-size: 0.85rem;
}

.product-primary-facts li {
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(28, 53, 45, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
}

.product-brand {
    color: #718096;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.product-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #edf2f7;
    color: #4a5568;
    border-radius: 12px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.category-badge:hover {
    background: var(--primary, var(--accent-primary, #6366f1));
    color: white;
}

.price-section {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.product-trust-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.75rem;
    margin: 0.75rem 0 1.5rem;
}

.product-trust-strip__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid rgba(28, 53, 45, 0.1);
    border-radius: 14px;
    background: var(--bg-card, #fff);
    box-shadow: 0 8px 22px rgba(44, 52, 48, 0.035);
}

.product-trust-strip__item > i {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border-radius: 9px;
    color: var(--accent-primary, #6366f1);
    background: color-mix(in srgb, var(--premium-accent, #14a3a8) 9%, #fff);
    font-size: 1.05rem;
    line-height: 1;
}

.product-trust-strip__item > span {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
}

.product-trust-strip__item strong {
    color: var(--text-primary, #1a1a1a);
    font-size: 0.78rem;
    line-height: 1.25;
}

.product-trust-strip__item small {
    color: var(--text-secondary, #5f6966);
    font-size: 0.74rem;
    line-height: 1.35;
    text-wrap: pretty;
}

@media (min-width: 768.02px) and (max-width: 1199.98px) {
    .product-trust-strip {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .product-trust-strip__item {
        align-items: center;
    }

    .product-trust-strip__item > span {
        grid-template-columns: 5rem minmax(0, 1fr);
        align-items: baseline;
        column-gap: 0.7rem;
    }

    .product-trust-strip__item strong {
        font-size: 0.8rem;
    }

    .product-trust-strip__item small {
        font-size: 0.76rem;
    }
}

@media (max-width: 768px) {
    .product-primary-facts {
        gap: 0.3rem;
        margin-bottom: 0.75rem;
        font-size: 0.76rem;
    }

    .product-primary-facts li {
        padding: 0.2rem 0.45rem;
    }

    .product-trust-strip {
        grid-template-columns: 1fr;
        gap: 0.45rem;
        margin: 0.65rem 0 1rem;
    }

    .product-trust-strip__item {
        align-items: center;
        padding: 0.65rem 0.75rem;
    }
}

.price-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.old-price {
    font-size: 1.5rem;
    color: #a0aec0;
    text-decoration: line-through;
}

.discount-badge {
    background: #f56565;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
}

.add-to-cart-section {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    background: #f7fafc;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    color: #4a5568;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #edf2f7;
}

.quantity-value {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.add-to-cart-btn {
    flex: 1;
    background: var(--gradient, linear-gradient(135deg, var(--accent-primary, #6366f1), var(--accent-secondary, #8b5cf6)));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
}

.product-description {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.product-description h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.product-description p {
    color: #4a5568;
    line-height: 1.7;
}

/* Collapsible description (mobile) */
.product-description__content {
    color: #4a5568;
    line-height: 1.7;
}

.product-description--collapsed .product-description__content {
    max-height: 220px;
    overflow: hidden;
}

.product-description__toggle {
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    font-size: 0.9rem;
    line-height: 1.15;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.product-description__toggle:hover {
    background: rgba(0, 0, 0, 0.03);
}

.product-description__toggle:active {
    transform: translateY(1px);
}

.product-specs {
    margin-top: 1.5rem;
}

.product-purchase-facts {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 12px;
    background: #f8fafc;
}

.product-purchase-facts h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: var(--text-primary, #0f172a);
}

.product-purchase-facts__list {
    margin: 0;
}

.product-purchase-facts__row {
    display: grid;
    grid-template-columns: minmax(7rem, 0.35fr) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.45rem 0;
}

.product-purchase-facts__row dt {
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.product-purchase-facts__row dd {
    margin: 0;
    color: var(--text-secondary, #475569);
}

.product-purchase-facts__documents {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-top: 0.65rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light, #e2e8f0);
    font-size: 0.9rem;
}

.product-purchase-facts__documents span {
    color: var(--text-secondary, #475569);
}

.product-ai-qa {
    margin-top: 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}


.product-ai-qa__summary {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.2rem;
    cursor: pointer;
    background: #f8fafc;
}

.product-ai-qa__summary::-webkit-details-marker {
    display: none;
}

.product-ai-qa__summary-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

.product-ai-qa__summary-hint {
    font-size: 0.9rem;
    color: #64748b;
}

.product-ai-qa__summary-note {
    font-size: 0.82rem;
    color: #94a3b8;
}

.product-ai-qa__badge {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1e3a8a;
    background: #e0f2fe;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.product-ai-qa__content {
    padding: 1rem 1.2rem 1.2rem;
}

.product-ai-qa__label {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.35rem;
    display: block;
}

.product-ai-qa__input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    resize: vertical;
    min-height: 96px;
    font-size: 0.98rem;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.product-ai-qa__input:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: #fff;
}

.product-ai-qa__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.product-ai-qa__btn.nav-link {
    border: 1px solid var(--border-light, #e9ecef);
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.product-ai-qa__captcha {
    margin-top: 0.75rem;
    min-width: 0;
    padding: 0;
    border: 0;
}

.product-ai-qa__captcha-visual {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.product-ai-qa__captcha img {
    width: 120px;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.product-ai-qa__captcha-refresh {
    min-height: 44px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-light, #cbd5e1);
    border-radius: 10px;
    background: #fff;
    color: var(--text-primary, #0f172a);
    cursor: pointer;
}

.product-ai-qa__captcha-refresh:focus-visible {
    outline: 3px solid var(--input-focus, #4f46e5);
    outline-offset: 2px;
}

.product-ai-qa__captcha-field {
    flex: 1 1 220px;
    min-width: 200px;
    margin-top: 0.75rem;
}

.product-ai-qa__captcha-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    background: #fff;
}

.product-ai-qa__captcha-hint {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}

.product-ai-qa__captcha-authenticated {
    margin: 0.75rem 0 0;
    color: var(--text-secondary, #475569);
    font-size: 0.9rem;
}

.product-ai-qa__status {
    font-size: 0.9rem;
    color: #64748b;
}

.product-ai-qa__status[data-state="loading"] {
    color: #2563eb;
}

.product-ai-qa__status[data-state="error"] {
    color: #dc2626;
}

.product-ai-qa__answer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.product-ai-qa__answer-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.product-ai-qa__answer-text {
    color: #111827;
    line-height: 1.6;
    white-space: pre-wrap;
}

.product-ai-qa__rating {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.product-ai-qa__rating-label {
    color: #64748b;
    font-size: 0.9rem;
}

.product-ai-qa__rating-stars {
    display: inline-flex;
    gap: 0.2rem;
}

.product-ai-qa__star {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: #cbd5f5;
    cursor: pointer;
    padding: 0.1rem 0.2rem;
}

.product-ai-qa__star:hover,
.product-ai-qa__star.is-selected {
    color: #f59e0b;
}

.product-ai-qa__rating-status {
    font-size: 0.85rem;
    color: #64748b;
}

.spec-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.spec-label {
    flex: 0 0 150px;
    color: #718096;
    font-weight: 500;
}

.spec-value {
    color: #1a1a1a;
}

.related-products {
    margin-top: 3rem;
}

.related-products h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.image-modal.active {
    display: flex;
}

.image-modal img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.image-modal-close:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .current-price {
        font-size: 2rem;
    }

    .add-to-cart-section {
        flex-direction: column;
    }

    .quantity-selector {
        width: 100%;
        justify-content: center;
    }
}

/* ===== CHECKOUT PAGE STYLES ===== */
body.checkout-page {
    background-color: var(--bg-primary, #f8f9fa);
}

.checkout-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.checkout-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary, #212529);
}

.delivery-option {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.delivery-option:hover {
    border-color: var(--accent-primary, #007bff);
}

.delivery-option.selected {
    border-color: var(--accent-primary, #007bff);
    background-color: rgba(var(--accent-primary-rgb, 0, 123, 255), 0.05);
}

.delivery-option input[type="radio"] {
    margin-right: 0.75rem;
}

.delivery-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delivery-name {
    font-weight: 500;
}

.delivery-period {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.delivery-price {
    font-weight: 600;
    color: var(--accent-primary, #007bff);
}

.order-summary {
    position: sticky;
    top: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
}

.checkout-page .cart-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.checkout-page .cart-item:last-child {
    border-bottom: none;
}

.checkout-page .cart-item-image {
    width: 72px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f3f5;
    flex: 0 0 auto;
}

.checkout-page .cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.checkout-page .cart-item-details {
    flex: 1;
}

.checkout-page .cart-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.checkout-page .cart-item-quantity {
    font-size: 0.875rem;
    color: #6c757d;
}

.checkout-page .cart-item-price {
    font-weight: 600;
    white-space: nowrap;
}

.checkout-page .btn-submit-order {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--accent-primary, #007bff);
    border: none;
    color: white;
}

.checkout-page .btn-submit-order:hover {
    background: var(--accent-secondary, #0056b3);
}

button.btn-checkout:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.checkout-page .city-search {
    position: relative;
}

.checkout-page .city-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 1rem;
}

@media (max-width: 991px) {
    .order-summary {
        position: static;
        margin-top: 2rem;
    }
}

/* ===== PRODUCT PAGE STYLES ===== */

.product-page {
    padding: 2rem 0;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #718096;
}

.breadcrumbs a,
.breadcrumbs span {
    white-space: nowrap;
}

.breadcrumbs a {
    color: #4a5568;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary, var(--accent-primary, #6366f1));
}

.breadcrumb-separator {
    color: #cbd5e0;
    white-space: nowrap;
}

.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 3rem;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}



.main-image {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.main-image::after {
    content: '🔍';
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.main-image:hover::after {
    opacity: 1;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.thumbnail {
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: var(--bg-card, #ffffff);
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary, var(--accent-primary, #6366f1));
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-intro h1,
.product-details h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.product-brand {
    color: #718096;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.product-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #edf2f7;
    color: #4a5568;
    border-radius: 12px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.category-badge:hover {
    background: var(--primary, var(--accent-primary, #6366f1));
    color: white;
}

.price-section {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.price-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.old-price {
    font-size: 1.5rem;
    color: #a0aec0;
    text-decoration: line-through;
}

.discount-badge {
    background: #f56565;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
}

.add-to-cart-section {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    background: #f7fafc;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    color: #4a5568;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #edf2f7;
}

.quantity-value {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.add-to-cart-btn {
    flex: 1;
    background: var(--gradient, linear-gradient(135deg, var(--accent-primary, #6366f1), var(--accent-secondary, #8b5cf6)));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
}

.product-description {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.product-description h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.product-description p {
    color: #4a5568;
    line-height: 1.7;
}

.product-specs {
    margin-top: 1.5rem;
}

.spec-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.spec-label {
    flex: 0 0 150px;
    color: #718096;
    font-weight: 500;
}

.spec-value {
    color: #1a1a1a;
}

.related-products {
    margin-top: 3rem;
}

.related-products h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.image-modal.active {
    display: flex;
}

.image-modal img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.image-modal-close:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .current-price {
        font-size: 2rem;
    }

    .add-to-cart-section {
        flex-direction: column;
    }

    .quantity-selector {
        width: 100%;
        justify-content: center;
    }
}

/* Account Button - в стиле корзины */
.account-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary, #5b5ede), var(--accent-secondary, #8b5cf6));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    margin-right: 0.75rem;
    white-space: nowrap;
}

.account-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.account-button i {
    font-size: 1.5rem;
}

.account-button .account-name {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Mobile: только иконка */
@media (max-width: 768px) {
    .account-button {
        width: 48px;
        padding: 0;
        justify-content: center;
    }

    .account-button .account-name {
        display: none;
    }
}

/* Product page: fullscreen image modal slider */
.image-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
}

.image-modal.active {
    display: flex;
}

.image-modal-track {
    width: 100%;
    height: 100%;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0;
    box-sizing: border-box;
}

.image-modal-track::-webkit-scrollbar {
    display: none;
}

.image-modal-slide {
    flex: 0 0 100%;
    height: 100%;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100vw;
    max-height: 100vh;
}

.image-modal-close {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 12px);
    right: calc(env(safe-area-inset-right) + 12px);
    z-index: 10010;
    pointer-events: auto;
}

.image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10005;
    pointer-events: auto;
}

.image-modal-nav.prev {
    left: 12px;
}

.image-modal-nav.next {
    right: 12px;
}

@media (max-width: 768px) {
    .image-modal-nav {
        display: none;
    }
}

/* Support Widget */
/*
 * Чат поддержки. Оформление — как у остальной витрины: белая шапка с иконкой
 * в тон акцента, лента на тёплом светлом фоне, пузыри без градиентов, поле ввода
 * с кнопкой внутри одной рамки. Прежняя версия (синяя плашка-шапка, квадратная
 * кнопка закрытия, три отдельных блока под полем ввода) выглядела как служебная
 * форма. Имена классов .support-widget / __toggle / __panel сохранены: на них
 * завязаны правила премиум-слоя и mobile-refine, прячущие кнопку на чекауте,
 * под баннером cookie и на карточке товара.
 *
 * Цвета берутся из переменных премиум-слоя с запасными значениями, чтобы виджет
 * выглядел одинаково и у магазина с пресетом default.
 */

.support-widget {
    --sw-accent: var(--premium-accent-dark, #0b5e86);
    --sw-ink: var(--premium-ink, #18201d);
    --sw-ink-soft: var(--premium-ink-soft, #4d5a54);
    --sw-muted: #8a938f;
    --sw-line: var(--premium-line, rgba(33, 48, 42, 0.12));
    --sw-thread: color-mix(in srgb, var(--premium-paper, #f7f4ec) 55%, #fff);
    --sw-ring: color-mix(in srgb, var(--sw-accent) 16%, transparent);
    position: fixed;
    right: 30px;
    bottom: calc(30px + var(--cookie-consent-height, 0px));
    z-index: 10020;
    font-family: inherit;
    pointer-events: none;
}

.support-widget * {
    pointer-events: auto;
}

/* ── кнопка вызова ───────────────────────────────────────────────────────── */

.support-widget__toggle {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    border: none;
    background: var(--sw-accent);
    color: #fff;
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 14px 30px color-mix(in srgb, var(--sw-accent) 30%, transparent),
        0 2px 6px rgba(24, 32, 29, 0.12);
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.support-widget__toggle:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow:
        0 20px 40px color-mix(in srgb, var(--sw-accent) 36%, transparent),
        0 3px 8px rgba(24, 32, 29, 0.14);
}

.support-widget__toggle:active {
    transform: translateY(0) scale(0.97);
}

.support-widget__toggle:focus-visible {
    outline: 3px solid var(--sw-ring);
    outline-offset: 3px;
}

/* Пульс вокруг кнопки: один раз при загрузке, чтобы её заметили */
.support-widget__toggle::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid color-mix(in srgb, var(--sw-accent) 50%, transparent);
    animation: support-pulse 2.6s cubic-bezier(0.22, 1, 0.36, 1) 1.2s 3;
    pointer-events: none;
}

@keyframes support-pulse {
    0% { opacity: 0.7; transform: scale(1); }
    70% { opacity: 0; transform: scale(1.45); }
    100% { opacity: 0; transform: scale(1.45); }
}

.support-widget.is-open .support-widget__toggle::after {
    animation: none;
    opacity: 0;
}

/* Метка непрочитанного ответа */
.support-widget__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e0533f;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 22px;
    box-shadow: 0 4px 12px rgba(224, 83, 63, 0.42);
}

.support-widget__badge[hidden] {
    display: none;
}

/* ── панель ──────────────────────────────────────────────────────────────── */

/* Высота фиксированная, а не «по содержимому»: окно не прыгает при каждом
   новом сообщении, лента прокручивается внутри, поле ввода всегда внизу.
   Отступ от кнопки считается от её высоты, а не жёстким числом. */
.support-widget__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 14px);
    width: min(380px, calc(100vw - 32px));
    height: min(580px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--sw-line);
    border-radius: 22px;
    box-shadow:
        0 28px 64px rgba(24, 32, 29, 0.18),
        0 4px 12px rgba(24, 32, 29, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.97);
    transform-origin: bottom right;
    transition:
        opacity 0.22s ease,
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.34s;
}

.support-widget__panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ── шапка панели ────────────────────────────────────────────────────────── */

.support-widget__head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 16px;
    background: #fff;
    border-bottom: 1px solid var(--sw-line);
    color: var(--sw-ink);
}

.support-widget__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--sw-accent) 12%, #fff);
    color: var(--sw-accent);
    display: grid;
    place-items: center;
    font-size: 1.15rem;
}

.support-widget__head-text {
    min-width: 0;
    flex: 1;
}

.support-widget__title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--sw-ink);
}

.support-widget__subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 12.5px;
    line-height: 1.3;
    color: var(--sw-ink-soft);
}

.support-widget__dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34c38f;
    box-shadow: 0 0 0 3px rgba(52, 195, 143, 0.18);
}

.support-widget__close {
    flex-shrink: 0;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--sw-ink-soft);
    font-size: 1rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.support-widget__close:hover,
.support-widget__close:focus-visible {
    background: rgba(24, 32, 29, 0.06);
    color: var(--sw-ink);
    outline: none;
}

/* ── лента переписки ─────────────────────────────────────────────────────── */

.support-widget__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 16px 10px;
    background: var(--sw-thread);
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(24, 32, 29, 0.18) transparent;
}

.support-widget__thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-widget__thread:empty {
    display: none;
}

/* Приветствие — как первый пузырь от поддержки */
.support-widget__intro {
    align-self: flex-start;
    max-width: 92%;
    background: #fff;
    border: 1px solid var(--sw-line);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--sw-ink);
}

.support-widget__intro p {
    margin: 0 0 0.5rem;
}

.support-widget__intro p:last-child {
    margin-bottom: 0;
}

/* Темы обращения — чипами вместо выпадающего списка */
.support-widget__topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.support-widget__topics:empty {
    display: none;
}

.support-widget__topic {
    min-width: 0;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--sw-accent) 30%, transparent);
    background: #fff;
    color: var(--sw-accent);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
        background-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.support-widget__topic:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--sw-accent) 16%, transparent);
}

.support-widget__topic.is-active {
    background: var(--sw-accent);
    border-color: var(--sw-accent);
    color: #fff;
}

/* Сообщения. Подряд идущие сообщения одного автора собираются в группу:
   между ними меньше воздуха, время — только под последним. */
.support-widget__msg {
    max-width: 84%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: support-msg-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes support-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.support-widget__msg--customer {
    align-self: flex-end;
    align-items: flex-end;
}

.support-widget__msg--manager {
    align-self: flex-start;
    align-items: flex-start;
}

.support-widget__msg--cont {
    margin-top: -6px;
}

.support-widget__bubble {
    padding: 9px 13px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.support-widget__msg--customer .support-widget__bubble {
    background: var(--sw-accent);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.support-widget__msg--manager .support-widget__bubble {
    background: #fff;
    color: var(--sw-ink);
    border: 1px solid var(--sw-line);
    border-bottom-left-radius: 6px;
}

.support-widget__msg--customer.support-widget__msg--cont .support-widget__bubble {
    border-top-right-radius: 6px;
}

.support-widget__msg--manager.support-widget__msg--cont .support-widget__bubble {
    border-top-left-radius: 6px;
}

.support-widget__time {
    padding: 0 4px;
    font-size: 11px;
    line-height: 1.3;
    color: var(--sw-muted);
}

/* Служебные события («менеджер подключился») — строкой по центру, а не
   пузырём от имени поддержки. */
.support-widget__msg--system {
    align-self: center;
    align-items: center;
    max-width: 100%;
    padding: 2px 8px;
    text-align: center;
    font-size: 12px;
    line-height: 1.4;
    color: var(--sw-muted);
}

/* Три точки, пока ждём ответ */
.support-widget__typing {
    align-self: flex-start;
    display: inline-flex;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--sw-line);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
}

.support-widget__typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9aa5a1;
    animation: support-typing 1.1s ease-in-out infinite;
}

.support-widget__typing span:nth-child(2) { animation-delay: 0.15s; }
.support-widget__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes support-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* ── форма ───────────────────────────────────────────────────────────────── */

.support-widget__composer {
    flex-shrink: 0;
    border-top: 1px solid var(--sw-line);
    background: #fff;
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.support-widget__composer[hidden] {
    display: none;
}

/* Поле контакта шире поля имени: «Телефон или email» в равных колонках
   обрезался на «emai». */
.support-widget__contacts {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 8px;
}

.support-widget__contacts[hidden] {
    display: none;
}

.support-widget__field {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--sw-line);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    color: var(--sw-ink);
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.support-widget__field:focus {
    outline: none;
    border-color: var(--sw-accent);
    box-shadow: 0 0 0 3px var(--sw-ring);
}

.support-widget__field::placeholder {
    color: #9aa5a1;
}

/* Поле вопроса и кнопка отправки — в одной рамке: раньше это были два
   отдельных элемента с разной высотой и своим кольцом фокуса у каждого.
   Высота однострочного поля задана явно (36 px = 20 px строки + отступы), а не
   выводится браузером из rows="1": у шрифта витрины большой межстрочный зазор,
   и «естественная» высота textarea получалась на 6–8 px выше кнопки. Скрипт
   autoGrow растит поле от этой же базы. */
.support-widget__row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 4px 4px 4px 8px;
    border: 1px solid var(--sw-line);
    border-radius: 16px;
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.support-widget__row:focus-within {
    border-color: var(--sw-accent);
    box-shadow: 0 0 0 3px var(--sw-ring);
}

.support-widget__row textarea.support-widget__field {
    flex: 1;
    box-sizing: border-box;
    min-width: 0;
    height: 36px;
    min-height: 36px;
    max-height: 120px;
    padding: 8px 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 14px;
    line-height: 20px;
    resize: none;
    overflow-y: auto;
}

/* Явные min-width/min-height: премиум-слой правилом с нулевой специфичностью
   ставит всем кнопкам и полям минимум 44 px, и без этого кнопка 36 px
   растягивалась до 44, а с ней и вся рамка поля. */
.support-widget__send {
    flex-shrink: 0;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 12px;
    border: none;
    background: var(--sw-accent);
    color: #fff;
    font-size: 1rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition:
        transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.24s ease,
        filter 0.18s ease;
}

.support-widget__send:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--sw-accent) 30%, transparent);
}

.support-widget__send:focus-visible {
    outline: 2px solid var(--sw-accent);
    outline-offset: 2px;
}

.support-widget__send:disabled {
    filter: grayscale(0.5);
    opacity: 0.55;
    cursor: default;
}

.support-widget__hint {
    font-size: 12px;
    color: var(--sw-muted);
    line-height: 1.4;
}

.support-widget__status {
    font-size: 13px;
    line-height: 1.35;
    padding: 8px 11px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--sw-accent) 9%, #fff);
    color: var(--sw-accent);
}

.support-widget__status--error {
    background: rgba(197, 61, 61, 0.09);
    color: #a83232;
}

.support-widget__status[hidden] {
    display: none;
}

/* Согласие на обработку данных: имя и контакт — персональные данные, без
   отметки первое сообщение не уходит. После начала переписки строка прячется:
   согласие уже дано, повторно спрашивать незачем. */
.support-widget__consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--sw-ink-soft);
    cursor: pointer;
}

.support-widget__consent[hidden] {
    display: none;
}

.support-widget__consent input {
    flex-shrink: 0;
    width: 16px;
    min-width: 0;
    height: 16px;
    min-height: 0;
    margin: 1px 0 0;
    accent-color: var(--sw-accent);
    cursor: pointer;
}

.support-widget__consent a {
    color: var(--sw-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Ловушка для роботов: поле не видно человеку и не попадает в фокус */
.support-widget__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.support-widget__offline {
    padding: 1rem;
    font-size: 14px;
    line-height: 1.45;
    color: var(--sw-ink-soft);
    text-align: center;
}

/* ── мобильная раскладка: панель на весь экран ───────────────────────────── */

@media (max-width: 575.98px) {
    .support-widget__panel {
        position: fixed;
        inset: 0;
        width: 100%;
        height: auto;
        max-height: none;
        border-radius: 0;
        border: none;
        transform: translateY(18px);
        transform-origin: center bottom;
    }

    .support-widget__panel.is-open {
        transform: none;
    }

    .support-widget__head {
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
    }

    .support-widget__composer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .support-widget__contacts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* The sticky buy bar and cookie notice already occupy the lower viewport.
       Keep support available through the non-floating footer button. */
    body.page-product .support-widget__toggle {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .support-widget__toggle,
    .support-widget__panel,
    .support-widget__topic,
    .support-widget__send,
    .support-widget__close {
        transition: none;
    }

    .support-widget__toggle::after,
    .support-widget__msg,
    .support-widget__typing span {
        animation: none;
    }

    .support-widget__toggle:hover,
    .support-widget__send:hover:not(:disabled) {
        transform: none;
    }
}

/* Theme variable applications (static and cacheable). */
/* === ПРИМЕНЕНИЕ ПЕРЕМЕННЫХ К ЭЛЕМЕНТАМ === */

/* Базовые стили */
body {
    background: var(--bg-body, #ffffff);
    color: var(--text-primary, #212529);
    font-family: var(--font-primary, Adekvat, sans-serif);
    font-size: var(--text-base, 1rem);
    line-height: var(--leading-normal, 1.5);
}

/* Заголовки */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading, Adekvat, sans-serif);
    font-weight: var(--font-bold, 700);
    color: var(--text-primary, #212529);
}

h1, .h1 { font-size: var(--text-5xl, 3rem); }
h2, .h2 { font-size: var(--text-4xl, 2.25rem); }
h3, .h3 { font-size: var(--text-3xl, 1.875rem); }
h4, .h4 { font-size: var(--text-2xl, 1.5rem); }
h5, .h5 { font-size: var(--text-xl, 1.25rem); }
h6, .h6 { font-size: var(--text-lg, 1.125rem); }

/* Контейнер */
.container {
    max-width: var(--container-max-width, 1400px);
    padding-left: var(--container-padding-x, 1rem);
    padding-right: var(--container-padding-x, 1rem);
}

/* Хедер */
.store-header {
    background: var(--bg-header, #ffffff);
    box-shadow: var(--header-shadow, 0 2px 8px rgba(0,0,0,0.05));
}

/* Карточки товаров */
.product-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--card-border, #dee2e6);
    border-radius: var(--card-radius, 0.5rem);
    box-shadow: var(--card-shadow, 0 1px 3px rgba(0,0,0,0.1));
    padding: var(--card-padding, 1.5rem);
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: var(--card-hover-shadow, 0 4px 12px rgba(0,0,0,0.15));
    transform: translateY(-2px);
}

/* Кнопки */
.btn-primary,
.btn-add-to-cart {
    background: var(--btn-primary-bg, #5b5ede);
    color: var(--btn-primary-text, #ffffff);
    border-radius: var(--button-radius, 0.5rem);
    padding: var(--button-padding-y, 0.75rem) var(--button-padding-x, 1.5rem);
    font-size: var(--button-font-size, 1rem);
    font-weight: var(--button-font-weight, 500);
    transition: var(--button-transition, all 0.3s ease);
    border: none;
}

.btn-primary:hover,
.btn-add-to-cart:hover {
    background: var(--btn-primary-hover, #4f46e5);
    color: var(--btn-primary-text, #ffffff);
}

.btn-secondary {
    background: var(--btn-secondary-bg, #8b5cf6);
    color: var(--btn-secondary-text, #ffffff);
    border-radius: var(--button-radius, 0.5rem);
    padding: var(--button-padding-y, 0.75rem) var(--button-padding-x, 1.5rem);
    transition: var(--button-transition, all 0.3s ease);
    border: none;
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover, #7c3aed);
    color: var(--btn-secondary-text, #ffffff);
}

.btn-outline {
    background: transparent;
    color: var(--btn-outline-text, #5b5ede);
    border: 2px solid var(--btn-outline-border, #6366f1);
    border-radius: var(--button-radius, 0.5rem);
    padding: var(--button-padding-y, 0.75rem) var(--button-padding-x, 1.5rem);
    transition: var(--button-transition, all 0.3s ease);
}

.btn-outline:hover {
    background: var(--btn-outline-hover-bg, #5b5ede);
    color: var(--btn-outline-hover-text, #ffffff);
    border-color: var(--btn-outline-hover-bg, #5b5ede);
}

/* Формы */
.form-control,
.search-input,
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    /* Запасные значения обязательны: переменные дизайна печатает
       components/design-vars.php, а на страницах входа и кабинета он намеренно
       не подключается (там своя оболочка, не зависящая от оформления магазина).
       Без fallback весь var() становится невалидным, и поля оставались вообще
       без внутренних отступов — текст прилипал к рамке. */
    background: var(--input-bg, #fff);
    border: 1px solid var(--input-border, #d3d9e0);
    border-radius: var(--input-radius, 0.75rem);
    padding: var(--input-padding-y, 0.75rem) var(--input-padding-x, 1rem);
    font-size: var(--input-font-size, 1rem);
    color: var(--text-primary, #1f2937);
    transition: all 0.3s ease;
}

.form-control:focus,
.search-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    border-color: var(--input-focus, #6366f1);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

/* Бейджи */
.badge,
.product-badge {
    background: var(--accent-primary, #5b5ede);
    color: var(--text-light, #ffffff);
    border-radius: var(--badge-radius, 0.25rem);
    padding: var(--badge-padding-y, 0.375rem) var(--badge-padding-x, 0.75rem);
    font-size: var(--badge-font-size, 0.875rem);
    font-weight: var(--badge-font-weight, 600);
}

.badge-success { background: var(--accent-success, #10b981); }
.badge-warning { background: var(--accent-warning, #f59e0b); }
.badge-danger { background: var(--accent-danger, #ef4444); }
.badge-info { background: var(--accent-info, #3b82f6); }

/* Футер */
.store-footer {
    background: var(--bg-footer, #f8f9fa);
    color: var(--text-secondary, #636c73);
    padding-top: var(--footer-padding-y, 3rem);
    padding-bottom: var(--footer-padding-y, 3rem);
    border-top: var(--footer-border-top, 1px solid #dee2e6);
}

.store-footer a {
    color: var(--text-secondary, #636c73);
    transition: color 0.3s ease;
}

.store-footer a:hover {
    color: var(--accent-primary, #5b5ede);
}

.footer-copyright {
    color: var(--text-muted, #606669);
    font-size: var(--text-sm, 0.875rem);
    margin-top: 1rem;
}

/* Навигация */
.store-nav {
    background: var(--bg-header, #ffffff);
    border-top: 1px solid var(--border-light, #e9ecef);
}

.nav-link {
    color: var(--text-secondary, #636c73);
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 1rem;
}

.nav-link:hover {
    color: var(--accent-primary, #5b5ede);
}

.nav-link.active {
    background: var(--nav-active-bg, #6366f1);
    color: var(--nav-active-text, #ffffff);
    font-weight: var(--font-medium, 500);
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
}

.nav-link.active::after {
    display: none;
}

/* Цены */
.product-price {
    color: var(--accent-primary, #5b5ede);
    font-weight: var(--font-bold, 700);
    font-size: var(--text-2xl, 1.5rem);
}

.product-old-price {
    color: var(--text-muted, #606669);
    text-decoration: line-through;
    font-size: var(--text-lg, 1.125rem);
}

/* Модальные окна */
.modal-content {
    background: var(--modal-bg, #ffffff);
    border-radius: var(--modal-radius, 0.75rem);
    box-shadow: var(--modal-shadow, 0 25px 50px -12px rgba(0,0,0,0.25));
    border: none;
}

.modal-backdrop {
    background: var(--modal-overlay, rgba(0,0,0,0.5));
}

/* Текст */
.text-muted { color: var(--text-muted, #606669); }
.text-secondary { color: var(--text-secondary, #636c73); }
.text-primary { color: var(--text-primary, #212529); }

/* Ссылки */
a {
    color: var(--accent-primary, #5b5ede);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--btn-primary-hover, #4f46e5);
}

/* Корзина */
.cart-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-primary, #5b5ede);
    color: var(--text-light, #ffffff);
    transition: all 0.3s ease;
}

.cart-button:hover {
    background: var(--btn-primary-hover, #4f46e5);
    color: var(--text-light, #ffffff);
    transform: scale(1.05);
}

.cart-button i {
    font-size: 1.5rem;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-danger, #ef4444);
    color: var(--text-light, #ffffff);
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: var(--font-bold, 700);
}

.btn-checkout {
    display: block;
    width: 100%;
    background: var(--accent-primary, #5b5ede);
    color: var(--text-light, #ffffff);
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: var(--button-radius, 0.5rem);
    font-weight: var(--font-medium, 500);
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    background: var(--btn-primary-hover, #4f46e5);
    color: var(--text-light, #ffffff);
    transform: translateY(-1px);
}

/* Категории */
.category-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-light, #e9ecef);
    border-radius: var(--card-radius, 0.5rem);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.category-card:hover {
    border-color: var(--accent-primary, #5b5ede);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.category-card i {
    font-size: 2.5rem;
    color: var(--accent-primary, #5b5ede);
    margin-bottom: 0.5rem;
}

/* Поиск */
.search-input-group i {
    color: var(--text-muted, #606669);
}

.search-input:focus ~ i,
.search-input-group:focus-within i {
    color: var(--accent-primary, #5b5ede);
}

/* Рекомендации */
.recommendation-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-primary, #5b5ede);
    color: var(--text-light, #ffffff);
    padding: 0.25rem 0.75rem;
    border-radius: var(--badge-radius, 0.25rem);
    font-size: var(--text-sm, 0.875rem);
    font-weight: var(--font-semibold, 600);
    z-index: 10;
}

/*
 * Скидки. Бейдж ставился абсолютно (top/right: 10px), хотя во всех трёх местах,
 * где он используется, он стоит в строке рядом с ценой: корзина (cart.php),
 * подсказки поиска (footer.php) и блок цены на странице товара. Позиционированного
 * предка ни у одного из них нет, поэтому бейдж улетал в правый верхний угол
 * страницы: в корзине два бейджа ложились друг на друга в точке 1370,10 под
 * шапкой, на карточке товара уезжал на 527px вправо от своего блока цены.
 * Делаем строчным — так, как он и задуман в разметке.
 */
.discount-badge {
    display: inline-block;
    vertical-align: middle;
    background: var(--accent-danger, #ef4444);
    color: var(--text-light, #ffffff);
    padding: 0.25rem 0.75rem;
    border-radius: var(--badge-radius, 0.25rem);
    font-size: var(--text-sm, 0.875rem);
    font-weight: var(--font-bold, 700);
}

/* Кнопка "Наверх" */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--accent-primary, #5b5ede);
    color: var(--text-light, #ffffff);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--btn-primary-hover, #4f46e5);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Утилиты для отступов */
.mb-xs { margin-bottom: var(--spacing-xs, 0.25rem); }
.mb-sm { margin-bottom: var(--spacing-sm, 0.5rem); }
.mb-md { margin-bottom: var(--spacing-md, 1rem); }
.mb-lg { margin-bottom: var(--spacing-lg, 1.5rem); }
.mb-xl { margin-bottom: var(--spacing-xl, 2rem); }
.mb-2xl { margin-bottom: var(--spacing-2xl, 3rem); }
.mb-3xl { margin-bottom: var(--spacing-3xl, 4rem); }
