/* Шрифты подключаются через <link> в HTML (без @import) */

:root {
    /* Благородная палитра — чуть насыщеннее, без неона */
    --primary-color: #3f6f94; /* Насыщенный стальной синий */
    --primary-hover: #335a78;
    --primary-rgb: 63, 111, 148;
    --accent-color: #c45f5f; /* Более живая пыльная роза */
    --accent-hover: #a84c4c;
    --accent-rgb: 196, 95, 95;
    --secondary-color: #1f2933;
    --text-color: #3d4654;
    --light-bg: #f7f8fa;
    --border-color: #d8dee6;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(31, 41, 51, 0.07);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --container-max-width: 1250px;
    --surface-radius: 24px;
    --surface-shadow: 0 10px 28px rgba(31, 41, 51, 0.05);
}

/* Базовые стили */
* {
    box-sizing: border-box;
}

body {
    font-size: 15px;
    font-family: "Inter", sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background: #f2f3f5;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    min-height: 100dvh;
    height: auto;
}

html {
    overflow-x: hidden;
    max-width: 100%;
    height: auto;
    min-height: 100%;
}

/* Единый контейнер для всех страниц */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

main {
    flex: 1;
}

/* Global notifications */
.notification-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}

.notification {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #e3eaf5;
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
    transform: translateX(115%);
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.notification.success {
    border-left-color: #32b26d;
}

.notification.info {
    border-left-color: var(--primary-color);
}

.notification.removing {
    transform: translateX(115%);
    opacity: 0;
}

.notification-icon {
    font-size: 18px;
    line-height: 1.2;
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-title {
    font-size: 13px;
    font-weight: 800;
    color: #2d3d54;
}

.notification-message {
    font-size: 13px;
    line-height: 1.35;
    color: #53637d;
}

/* Плашка «сайт в разработке» — на весь экран */
.dev-banner {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 18, 22, 0.92);
    color: #f5f5f5;
    box-sizing: border-box;
    font-family: inherit;
}

.dev-banner-card {
    width: min(520px, 100%);
    padding: 36px 28px 28px;
    border-radius: 16px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
    position: relative;
}

.dev-banner-label {
    display: inline-block;
    margin-bottom: 14px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #e2e8f0;
}

.dev-banner-title {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
}

.dev-banner-text {
    margin: 0 0 24px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.55;
    color: #cbd5e1;
}

.dev-banner-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    height: 44px;
    padding: 0 22px;
    border: none;
    border-radius: 10px;
    background: #fff;
    color: #111;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.dev-banner-close:hover {
    background: #e8e8e8;
    transform: scale(1.03);
}

@media (max-width: 768px) {
    .dev-banner {
        padding: 16px;
    }

    .dev-banner-card {
        padding: 28px 20px 22px;
    }

    .dev-banner-title {
        font-size: 20px;
    }

    .dev-banner-text {
        font-size: 14px;
    }
}

body.dev-banner-open {
    overflow: hidden;
}

.cookie-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 10050;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

body.modal-open .cookie-banner,
body.dev-banner-open .cookie-banner {
    display: none !important;
}

.cookie-banner.is-hiding {
    opacity: 0;
    transform: translateY(10px);
}

.cookie-banner-inner {
    pointer-events: auto;
    max-width: 820px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.28);
    box-sizing: border-box;
}

.cookie-banner-text {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #cbd5e1;
}

.cookie-banner-text a {
    color: #93c5fd;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner-btn {
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    background: var(--primary-color, #3f6f94);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
}

.cookie-banner-btn:hover {
    filter: brightness(1.06);
}

@media (max-width: 640px) {
    .cookie-banner {
        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
    }

    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
    }

    .cookie-banner-text {
        font-size: 13px;
    }

    .cookie-banner-btn {
        width: 100%;
        min-height: 44px;
    }

    .privacy-consent-label {
        font-size: 12px !important;
        gap: 12px;
        line-height: 1.4;
    }

    .privacy-consent-input,
    .modal input.privacy-consent-input,
    .auth-modal input.privacy-consent-input,
    .modal input[type="checkbox"],
    .auth-modal input[type="checkbox"] {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        margin-top: 1px !important;
    }

    .modal-overlay,
    #complaintModalOverlay,
    #authModalOverlay {
        align-items: center !important;
        justify-content: center !important;
        padding: 16px !important;
        padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
        -webkit-overflow-scrolling: touch;
    }

    .modal,
    .auth-modal {
        width: 100%;
        max-width: 400px;
        margin: auto;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cookie-banner-btn {
        width: 100%;
        min-height: 44px;
    }

    .cookie-banner-text {
        font-size: 13px;
    }

    .close-btn,
    .catalog-close-btn {
        width: 44px;
        height: 44px;
    }
}

/* --- Хедер ПК --- */
header {
    width: 100%;
    background: var(--white);
    z-index: 1000;
}

/* Breadcrumbs (global unified style) */
.breadcrumbs,
.breadcrumb {
    padding: 16px 0;
    font-size: 14px;
    color: #a0aec0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-weight: 600;
    margin: 0;
}

.breadcrumbs a,
.breadcrumb a {
    color: #a0aec0;
    text-decoration: none;
    transition: var(--transition);
    padding: 4px 0;
}

.breadcrumbs a:hover,
.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumbs span,
.breadcrumb span {
    color: var(--secondary-color);
    font-weight: 800;
}

.header-top {
    padding: 5px 0;
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.header-top-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.header-inf {
    display: flex;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-inf a {
    color: #666;
    text-decoration: none;
    transition: var(--transition);
}

.header-inf a:hover {
    color: var(--primary-color);
}

.header-contact {
    display: flex;
    align-items: center;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-contact a, .header-contact button {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: color 0.2s ease;
}

.header-contact a:hover {
    color: var(--primary-hover);
}

.order {
    background: var(--accent-color) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: 12px;
    padding: 9px 16px;
    font-weight: 700 !important;
    font-size: 12px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(196, 95, 95, 0.2);
}

.order .phone-icon {
    width: 14px;
    height: 14px;
    opacity: 0.95;
}

.header-contact img {
    width: 16px;
    height: 16px;
}

/* Единый стиль анимации кнопок хедера */
.search-button,
.catalog-button,
.cart-button,
.auth-btn,
.action-item,
.order,
.header-menu-btn {
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease !important;
}

.header-menu-btn {
    display: none !important;
}

/* Основная часть хедера */
.header-main {
    padding: 5px 0 0 0;
    background: var(--white);
    border-bottom: none;
    position: relative;
    z-index: 1001; /* Выше overlay (998) */
}

.header-main-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-logo-catalog {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-shrink: 0;
}

.header-logo {
    display: block;
}

.header-logo img {
    height: 95px;
    width: auto;
    max-width: 400px;
    object-fit: contain;
    display: block;
    transform: translateY(-8px);
}

.catalog-button {
    background: var(--accent-color);
    color: var(--white);
    height: 42px;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.catalog-button:hover {
    background: var(--accent-hover) !important;
}

.catalog-button.active {
    background: var(--accent-hover) !important;
    transform: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.search-container {
    flex: 1;
    max-width: 600px;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 0;
    border: 2px solid #e5e7eb;
    transition: var(--transition);
    margin: 0;
    height: 42px;
    box-sizing: border-box;
}

.search-container:focus-within {
    border-color: var(--primary-color);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 16px;
    height: 100%;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    color: var(--secondary-color);
}

.search-input::placeholder {
    color: #99a;
}

.search-button {
    background: transparent;
    color: var(--primary-color);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.search-button:hover {
    color: var(--primary-hover);
}

.header-sub-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #111111;
    text-decoration: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.25s ease, transform 0.25s ease;
    padding: 0;
    font-family: inherit;
    transform-origin: center bottom;
}

.action-item:hover {
    color: var(--primary-color);
    transform: scale(1.12);
}

.action-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: color 0.25s ease, transform 0.25s ease;
}

.action-item:hover .action-icon-wrapper {
    color: inherit;
    transform: scale(1.06);
}

.action-item:hover .action-text {
    color: inherit;
}

.action-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
}

.header-icon-item {
    display: none;
}

.viewed-badge {
    display: none;
}

.icon-btn {
    display: none;
}



.order:hover {
    background: var(--accent-hover) !important;
    color: var(--white) !important;
    transform: scale(1.03);
}

.order:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px rgba(196, 95, 95, 0.24);
}

/* Панель навигации */
.header-bar {
    background: linear-gradient(180deg, #5a8aad 0%, #3f6f94 55%, #335a78 100%);
    max-width: var(--container-max-width);
    width: calc(100% - 40px);
    margin: 2px auto 15px auto;
    border-radius: 16px;
    position: sticky;
    top: 10px;
    z-index: 999;
    border: 1px solid rgba(255,255,255,0.32);
    box-shadow: 0 8px 18px rgba(63, 111, 148, 0.2);
    overflow: hidden;
}

.header-bar-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
}

.header-bar-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 6px 15px;
}

.header-bar-list-text a {
    color: rgba(255,255,255,0.96);
    padding: 6px 10px;
    display: block;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    text-decoration: none;
    transition: var(--transition);
    border-radius: 10px;
}

.header-bar-list-text a:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(76, 87, 112, 0.2);
}

.mobile-only-link {
    display: none;
}

.mobile-menu-toggle, .menu-overlay {
    display: none;
}

@media (max-width: 480px) {
    .modal {
        padding: 22px 18px 18px;
        border-radius: 14px;
    }

    .auth-tabs {
        margin-bottom: 16px;
    }

    .auth-tab {
        padding: 8px 10px;
        font-size: 13px;
    }
}
@media (max-width: 1200px) {
    .header-main-container { gap: 15px; }
    .header-logo img { height: 80px; }
    .search-container { max-width: 300px; margin: 0; }
    .header-bar-list-text a { padding: 9px 10px; font-size: 12px; }
    .header-sub-actions { gap: 15px; }
}

@media (max-width: 1024px) {
    .header-logo img { height: 70px; }
    .catalog-button { padding: 8px 12px; font-size: 13px; }
    .search-container { max-width: 250px; }
    .action-text { display: none; } /* Hide text, show only icons on tablet */
    .header-sub-actions { gap: 20px; }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-top { display: none; }
    
    .header-main {
        padding: 8px 0;
        position: relative;
        z-index: 1001;
        box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    }

    .header-main-container { 
        padding: 0 15px; 
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .header-logo-catalog {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .header-logo {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .header-logo img { 
        height: 60px;
        width: auto;
        transform: translateY(0);
    }

    .catalog-button {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
        font-size: 14px;
        min-height: 44px;
        height: auto;
    }

    .search-container { 
        width: 100%;
        max-width: 100%;
        margin: 0;
        min-height: 44px;
        height: auto;
    }

    .search-input {
        padding: 10px 14px;
        font-size: 16px; /* avoid iOS zoom */
    }

    .search-button {
        padding: 0 12px;
        min-width: 44px;
    }

    .search-button svg {
        width: 18px;
        height: 18px;
    }

    .header-sub-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        gap: 6px;
        padding-top: 4px;
    }

    .action-item {
        gap: 4px;
        min-width: 0;
        max-width: 25%;
        padding: 6px 2px;
        flex: 1 1 0;
        align-items: center;
        overflow: hidden;
    }

    .action-icon-wrapper {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .action-icon-wrapper svg {
        width: 22px;
        height: 22px;
    }

    .action-text {
        font-size: 11px;
        display: block;
        line-height: 1.2;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-menu-btn {
        display: flex !important;
    }


    .header-bar {
        background: none;
        height: 0;
        border: none;
        box-shadow: none;
        position: static;
    }

    .header-bar-list {
        position: fixed;
        bottom: -100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 30px 20px 80px;
        border-radius: 30px 30px 0 0;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
        transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2000;
        max-height: 85vh;
        overflow-y: auto;
        display: flex; /* Ensure it's flex when active */
    }

    .header-bar-list.active { 
        bottom: 0; 
    }

    .mobile-only-link {
        display: block;
    }

    .header-bar-list-text a {
        color: var(--secondary-color);
        text-align: center;
        padding: 18px 0;
        font-size: 18px;
        border-bottom: 1px solid #f5f5f5;
        background: none !important;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        z-index: 1999;
        display: none;
    }

    .menu-overlay.active { display: block; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
}

/* Модальные окна */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 16px;
    overflow-y: auto;
}

body.modal-open {
    overflow: hidden;
}

.catalog-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    /* без backdrop-filter — иначе каталог «плывёт» и выглядит размытым */
    justify-content: center;
    align-items: flex-start;
    padding-top: 185px; /* Под header-bar */
    z-index: 998; /* Ниже header-bar (999) и header-main (1001) */
    animation: overlayFadeIn 0.18s ease-out forwards;
}

#complaintModalOverlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 18px 44px rgba(17, 24, 39, 0.14);
    position: relative;
    animation: modalFadeIn 0.28s ease-out;
    margin: auto;
    padding: 28px 24px 22px;
    box-sizing: border-box;
}

.catalog-modal {
    background: #fff;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 185px); /* Фиксированная высота на весь оставшийся экран */
    border-radius: 0;
    border: none;
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
    position: relative;
    /* только opacity — translate/scale дают нечёткий текст на многих экранах */
    animation: catalogFadeIn 0.18s ease-out;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    backface-visibility: hidden;
}

.catalog-modal-header {
    display: none; /* Hide on desktop */
}

@media (max-width: 768px) {
    .catalog-modal-overlay {
        padding: 0;
        align-items: flex-end; /* Чтобы выезжало снизу */
        z-index: 3000;
        animation: overlayFadeIn 0.18s ease-out forwards;
    }
    .catalog-modal {
        border-radius: 20px 20px 0 0;
        height: 90%; /* Занимает 90% экрана на мобилке */
        max-height: 90%;
        animation: catalogSlideUpMobile 0.28s ease-out both;
    }
    .catalog-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 18px 20px;
        border-bottom: 1px solid #f1f5f9;
        background: #fff;
        border-radius: 20px 20px 0 0;
        position: relative;
        flex-shrink: 0;
        z-index: 10;
    }

    .catalog-close-btn {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
}

.catalog-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.catalog-close-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.catalog-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.catalog-categories {
    display: flex;
    position: relative;
    flex: 1;
    height: 100%; /* Занимает всю высоту модального окна */
    background: #fff;
    overflow: hidden;
}

.desktop-mega-menu {
    display: flex;
    width: 100%;
    height: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
}

.mobile-category-tree {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .desktop-mega-menu {
        display: none;
    }
    .mobile-category-tree {
        display: block;
    }
}

/* Стили для десктопного мега-меню (JS рендер) */
.mega-level-1 {
    width: 300px;
    height: 100%; /* На всю высоту */
    background: #f4f6f9; /* Чуть темнее для контраста */
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow-y: auto; /* Своя прокрутка */
    padding: 15px 0 15px 0; /* Отступ сверху как между лого и баром */
}

.mega-item-l1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 24px 15px 21px; /* Сдвигаем из-за border-left */
    color: #334155;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
    position: relative;
}

.mega-item-l1 .arrow {
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.mega-item-l1:hover .arrow, .mega-item-l1.active .arrow {
    opacity: 1;
}

.mega-item-l1:hover, .mega-item-l1.active {
    background: #fff;
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.mega-item-l1.active::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #fff;
}

.mega-level-content {
    flex-grow: 1;
    height: 100%; /* На всю высоту */
    background: #fff;
    padding: 40px 45px 80px; /* 40px сверху чтобы выровнять текст заголовка с текстом левого блока */
    overflow-y: auto; /* Своя прокрутка */
}

.mega-content-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
    margin-bottom: 28px;
}

.mega-content-header h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.mega-content-header h2 a {
    color: inherit;
    text-decoration: none;
}

.mega-content-header h2 a:hover {
    color: var(--primary-color);
}

.mega-content-body {
    display: flex;
    align-items: flex-start;
    gap: 36px;
}

.mega-content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 40px;
    flex: 1;
    min-width: 0;
}

.mega-cat-icons {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
}

.mega-cat-icons-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mega-cat-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 96px;
    padding: 12px 10px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #f8fafc;
    text-decoration: none;
    color: #334155;
    box-sizing: border-box;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mega-cat-icon-card:hover {
    border-color: #cbd5e1;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    color: var(--primary-color);
}

.mega-cat-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: invert(38%) sepia(22%) saturate(720%) hue-rotate(170deg) brightness(93%) contrast(90%);
    opacity: 0.95;
}

.mega-cat-icon-name {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mega-l2-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    filter: invert(38%) sepia(22%) saturate(720%) hue-rotate(170deg) brightness(93%) contrast(90%);
    opacity: 0.95;
}

@media (max-width: 1200px) {
    .mega-content-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mega-cat-icons {
        width: 220px;
    }
}

@media (max-width: 980px) {
    .mega-content-body {
        flex-direction: column;
    }

    .mega-cat-icons {
        width: 100%;
        position: static;
    }

    .mega-cat-icons-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.mega-l2-group {
    /* break-inside: avoid; */
    /* margin-bottom: 32px; */
}

.mega-l2-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 14px;
    text-decoration: none;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
}

.mega-l2-title:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.mega-l3-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-l3-list li {
    margin-bottom: 6px;
}

.mega-l3-link {
    display: inline-block;
    font-size: 13px;
    color: #334155;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.mega-l3-link:hover {
    color: var(--primary-color);
}

/* Сброс списков (для мобильной версии) */
.cat-level-1, .cat-level-2, .cat-level-3 {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Стили ссылок (для мобильной версии) */
.cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.cat-link:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.cat-link.has-children .arrow {
    opacity: 0.4;
    transition: transform 0.2s, opacity 0.2s;
}

/* Мобильная версия (аккордеон) */
@media (max-width: 768px) {
    .catalog-categories {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        padding-bottom: 0;
        overflow: hidden; /* Чтобы скролл был только внутри дерева */
    }
    
    .mobile-category-tree {
        display: block;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding-top: 8px;
        padding-bottom: 30px;
        -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
    }
    
    .cat-level-1 {
        width: 100%;
        border-right: none;
        height: auto;
        overflow: visible;
    }
    
    .cat-level-2, .cat-level-3 {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        box-shadow: none;
        padding-left: 0;
        display: none; /* Скрыто по умолчанию */
    }
    
    .cat-item.active > .cat-level-2,
    .cat-item.active > .cat-level-3 {
        display: block;
        animation: accordionFadeIn 0.3s ease-out forwards;
    }
    
    .cat-item.active > .cat-link.has-children .arrow {
        transform: rotate(90deg);
    }
    
    /* Улучшенные стили для мобильных ссылок */
    .cat-link {
        padding: 16px 20px;
        border-bottom: 1px solid #f1f5f9;
        font-size: 16px;
        font-weight: 600;
        color: #0f172a;
    }
    
    .cat-link.has-children .arrow {
        background: #f1f5f9;
        border-radius: 50%;
        padding: 4px;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #64748b;
        opacity: 1;
    }
    
    .cat-item.active > .cat-link {
        color: var(--primary-color);
        background: #f8fafc;
    }
    
    .cat-item.active > .cat-link.has-children .arrow {
        background: var(--primary-color);
        color: #fff;
    }
    
    /* Стили для 2 уровня на мобилке */
    .cat-level-2 .cat-link {
        padding-left: 30px;
        font-size: 15px;
        font-weight: 500;
        background: #f8fafc;
        color: #334155;
        border-bottom: 1px solid #e2e8f0;
    }
    
    /* Стили для 3 уровня на мобилке */
    .cat-level-3 .cat-link {
        padding-left: 45px;
        font-size: 14px;
        font-weight: 400;
        background: #f1f5f9;
        color: #475569;
        border-bottom: 1px solid #e2e8f0;
    }
}

@keyframes accordionFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.catalog-category-item {
    padding: 12px 14px;
    background: #f5f5f7;
    border-radius: 12px;
    font-weight: 500;
    font-size: 12px;
    color: #334155;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.catalog-category-item:hover {
    background: #fff;
    border-color: rgba(63, 111, 148, 0.45);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.06);
}

.catalog-category-item.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.modal h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 28px 18px 0;
    text-align: left;
    color: #1e293b;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.modal label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    text-align: left;
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#orderFormFields,
#checkoutOnlyFields,
#complaintForm {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.form-group,
.form-group-checkout {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.privacy-consent {
    margin: 4px 0 2px;
}

.privacy-consent-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.45;
    color: #475569 !important;
    cursor: pointer;
    margin: 0 !important;
    text-align: left !important;
}

.privacy-consent-input,
.modal input.privacy-consent-input,
.auth-modal input.privacy-consent-input,
.modal input[type="checkbox"],
.auth-modal input[type="checkbox"] {
    /* Native checkbox — custom border/bg hides the tick in WebKit */
    -webkit-appearance: auto !important;
    appearance: auto !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    accent-color: var(--primary-color, #3f6f94);
    transform: none !important;
    color: inherit !important;
}

.privacy-consent-label a {
    color: var(--primary-color, #3f6f94);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.privacy-consent-label a:hover {
    color: #2f5675;
}

.modal input:not([type="checkbox"]):not([type="radio"]),
.modal textarea,
.modal select,
.form-control-checkout {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: #1e293b;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    background: #f8f9fb;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.modal textarea {
    min-height: 96px;
    resize: vertical;
}

.modal input:not([type="checkbox"]):not([type="radio"])::placeholder,
.modal textarea::placeholder {
    color: #94a3b8;
}

.modal input:not([type="checkbox"]):not([type="radio"]):focus,
.modal textarea:focus,
.modal select:focus,
.form-control-checkout:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(63, 111, 148, 0.16);
}

.modal button[type="submit"] {
    background: var(--accent-color);
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    margin-top: 4px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    width: 100%;
    font-family: inherit;
}

.modal button[type="submit"]:hover {
    background: var(--accent-hover);
    transform: scale(1.03);
}

.modal-footer-text {
    display: none;
}

.modal button[type="submit"]:active {
    transform: translateY(0);
}

.success-message {
    display: none;
    background: #ecfdf5;
    color: #047857;
    padding: 12px 14px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    margin-top: 4px;
    border: 1px solid #a7f3d0;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Auth Modal */
.auth-modal {
    padding: 48px 22px 20px;
    max-width: 420px;
}

.auth-modal .close-btn {
    top: 10px;
    right: 10px;
}

.auth-modal .auth-title {
    color: #1e293b !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    text-align: center !important;
    display: block !important;
    letter-spacing: -0.02em !important;
    line-height: 1.25 !important;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    background: #f3f4f6;
    padding: 3px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.auth-tab {
    flex: 1;
    padding: 9px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #64748b;
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-tab.active {
    background: #fff;
    color: #1e293b;
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.06);
}

.auth-modal form {
    display: none;
    flex-direction: column;
}

.auth-modal form.auth-form-visible {
    display: flex;
}

.auth-modal input:not([type="checkbox"]):not([type="radio"]) {
    width: 100% !important;
    background: #f8f9fb !important;
    border: 1px solid #e5e7eb !important;
    padding: 12px 14px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    box-shadow: none !important;
    transform: none !important;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    color: #1e293b !important;
    margin-bottom: 14px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.auth-modal input:not([type="checkbox"]):not([type="radio"]):focus {
    border-color: var(--primary-color) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(63, 111, 148, 0.16) !important;
}

.auth-modal .privacy-consent {
    margin: 2px 0 10px;
}

.auth-modal .privacy-consent-label {
    margin-bottom: 0 !important;
}

.auth-modal button[type="submit"] {
    width: 100% !important;
    background: var(--accent-color) !important;
    color: #fff !important;
    padding: 12px 16px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-top: 4px !important;
    margin-bottom: 14px !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    border: none !important;
    cursor: pointer !important;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
    font-family: inherit !important;
}

.auth-modal button[type="submit"]:hover {
    background: var(--accent-hover) !important;
    transform: scale(1.03) !important;
}

.auth-warning {
    font-size: 12px;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    text-align: left;
    line-height: 1.45;
    font-weight: 500;
}

.auth-notice {
    text-align: left;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 14px;
}

.auth-notice-success {
    text-align: left;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 10px 12px;
    line-height: 1.45;
    margin-bottom: 14px;
}

.auth-error-message {
    font-size: 12px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    line-height: 1.4;
    font-weight: 500;
    margin-bottom: 14px;
}

.auth-switch-text {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
    line-height: 1.45;
}

.auth-switch-text:last-child {
    margin-bottom: 0;
}

.auth-switch-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch-text a:hover {
    text-decoration: underline;
}

.password-strength-meter {
    height: 4px;
    background: #e5e7eb;
    border-radius: 999px;
    margin-top: -8px;
    margin-bottom: 14px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
    border-radius: inherit;
}

.strength-weak { background: #ef4444; width: 33.33%; }
.strength-medium { background: #f59e0b; width: 66.66%; }
.strength-strong { background: #10b981; width: 100%; }

.strength-text {
    font-size: 11px;
    margin-top: -10px;
    margin-bottom: 14px;
    font-weight: 500;
    color: #64748b;
}

.strength-text:empty {
    display: none;
}

.user-greeting {
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    margin: 0 0 20px;
    color: #334155;
}

.profile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.profile-menu li a:hover {
    background: #fff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.04);
}

.close-btn,
.catalog-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: #f5f5f7;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: #64748b;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.04);
    z-index: 10;
    padding: 0;
}

.catalog-modal-header .catalog-close-btn {
    position: static;
    flex-shrink: 0;
}

.close-btn:hover,
.catalog-close-btn:hover {
    background: #e8eaed;
    color: #1e293b;
    transform: none;
}

.close-btn-icon {
    display: block;
    line-height: 1;
    margin-top: -1px;
}

@keyframes modalFadeIn {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes catalogFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes catalogSlideUpMobile {
    from { transform: translate3d(0, 100%, 0); }
    to { transform: translate3d(0, 0, 0); }
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .modal-overlay,
    #complaintModalOverlay,
    #authModalOverlay {
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

    .modal {
        padding: 18px 14px 16px;
        border-radius: 12px;
        margin: auto;
        max-width: min(400px, 100%);
        width: 100%;
        box-sizing: border-box;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .auth-modal {
        padding: 44px 14px 16px;
        max-width: min(420px, 100%);
    }

    .modal h2,
    .auth-modal .auth-title {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    .modal form,
    #complaintForm,
    #orderFormFields {
        gap: 14px;
    }

    .modal label:not(.privacy-consent-label) {
        margin-bottom: 6px;
    }

    .modal input:not([type="checkbox"]):not([type="radio"]),
    .modal textarea,
    .modal select {
        font-size: 16px; /* iOS zoom prevention */
        padding: 12px 12px;
    }

    .auth-modal input:not([type="checkbox"]):not([type="radio"]) {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }

    .modal button[type="submit"],
    .auth-modal button[type="submit"] {
        min-height: 44px;
        width: 100%;
    }

    .auth-tabs { margin-bottom: 10px; }
    .auth-tab { padding: 10px 8px; font-size: 13px; min-height: 44px; }
    .breadcrumbs, .breadcrumb { padding: 10px 0; font-size: 13px; }

    .privacy-consent {
        margin: 2px 0 4px;
    }
}

/* Стили для иконок категорий */
.cat-name-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cat-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
    /* Стальной оттенок под --primary-color */
    filter: invert(38%) sepia(22%) saturate(720%) hue-rotate(170deg) brightness(93%) contrast(90%);
    opacity: 0.95;
}

/* Модалка: товар добавлен + «С этим товаром покупают» */
.cart-added-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3200;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow-y: auto;
    box-sizing: border-box;
}

.cart-added-overlay.is-open {
    display: flex;
}

.cart-added-modal {
    width: min(960px, 100%);
    margin: auto;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    padding: 22px 22px 18px;
    position: relative;
    box-sizing: border-box;
}

.cart-added-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.cart-added-close:hover {
    background: #e2e8f0;
}

.cart-added-success {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-right: 36px;
    margin-bottom: 8px;
}

.cart-added-success-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.cart-added-success-text h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.cart-added-success-text p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}

.cart-added-related {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef2f7;
}

.cart-added-related[hidden] {
    display: none !important;
}

.cart-added-related-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.cart-added-slider-wrap {
    position: relative;
}

.cart-added-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 2px 2px 10px;
}

.cart-added-slider::-webkit-scrollbar {
    height: 6px;
}

.cart-added-slider::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.cart-added-slide {
    flex: 0 0 calc((100% - 48px) / 5);
    max-width: calc((100% - 48px) / 5);
    scroll-snap-align: start;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
    box-sizing: border-box;
}

.cart-added-slide-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 10px 10px 6px;
    text-decoration: none;
    color: inherit;
}

.cart-added-slide-image {
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    margin-bottom: 8px;
}

.cart-added-slide-image img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

.cart-added-slide-name {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.cart-added-slide-price {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.cart-added-slide-cart {
    margin: 0 10px 10px;
    padding: 8px 10px;
    border: none;
    border-radius: 9px;
    background: #3f6f94;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.cart-added-slide-cart:hover {
    background: #335c7c;
}

.cart-added-nav {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    background: #fff;
    color: #334155;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
    cursor: pointer;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.cart-added-slider-wrap.has-overflow .cart-added-nav {
    display: flex;
}

.cart-added-nav.prev { left: -6px; }
.cart-added-nav.next { right: -6px; }

.cart-added-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.cart-added-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 16px;
    border-radius: 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    box-sizing: border-box;
}

.cart-added-btn-primary {
    background: var(--accent-color, #c45f5f);
    color: #fff;
}

.cart-added-btn-primary:hover {
    background: var(--accent-hover, #b04f4f);
    color: #fff;
}

.cart-added-btn-secondary {
    background: #fff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.cart-added-btn-secondary:hover {
    background: #f8fafc;
}

@media (max-width: 900px) {
    .cart-added-slide {
        flex-basis: calc((100% - 36px) / 4);
        max-width: calc((100% - 36px) / 4);
    }
}

@media (max-width: 700px) {
    .cart-added-slide {
        flex-basis: calc((100% - 24px) / 3);
        max-width: calc((100% - 24px) / 3);
    }
}

@media (max-width: 520px) {
    .cart-added-modal {
        padding: 18px 14px 14px;
    }

    .cart-added-slide {
        flex-basis: calc((100% - 12px) / 2);
        max-width: calc((100% - 12px) / 2);
    }

    .cart-added-actions {
        grid-template-columns: 1fr;
    }

    .cart-added-nav {
        display: none !important;
    }
}
