/* Подключаем локальный шрифт Marmelad */
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('/fonts/CormorantGaramond-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

/* Общие стили */
body {
    font-family: 'Manrope', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    letter-spacing: 0.5px;
    font-size: 1em;
    overflow-x: hidden;
    width: 100%;
}

a {
    color: #000000;
    text-decoration: none;
}

a:hover {
    color: #555555;
    text-decoration: underline;
}

/* Стили хедера */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    background: #f4f4f4;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.logo {
    font-family: 'Cormorant Garamond';
    font-size: 1.5rem;
    font-weight: 500;
}

.nav {
    display: flex;
    gap: 1rem;
    font-size: 16px;
}

.nav a {
    margin: 0 1rem;
    text-decoration: none;
    color: #333;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.digits {
    font-size: 16px;
    vertical-align: baseline;
    /* Или try: middle / text-top / -0.1em */
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .nav {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #f4f4f4;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .nav a {
        padding: 1rem;
        border-bottom: 1px solid #ddd;
    }

    .menu-toggle {
        display: block;
    }

    .nav.open {
        display: flex;
    }

    .header {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 60px;
        padding: 0 16px;
        border-bottom: 1px solid #eee;
    }

    .logo {
        font-size: 1.4rem;
        font-weight: 500;
    }

    .menu-toggle {
        position: absolute;
        left: 16px;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
    }

    .nav {
        position: absolute;
        right: 16px;
    }

    .menu-toggle {
        position: absolute;
        left: 16px;
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
        color: #222;
    }

    .menu-icon {
        display: block;
        width: 24px;
        height: 24px;
        stroke: #222;
        transition: stroke 0.3s;
    }

    .menu-toggle:hover .menu-icon {
        stroke: #777;
        /* легкое затемнение при наведении */
    }
}

.top-text {
    background-color: #333;
    color: white;
    text-align: center;
    font-size: 14px;
    font-weight: 300;
    padding: 2px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-text span {
    opacity: 0;
    animation: fadeIn 0.6s ease-in-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ===== Header actions ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
    text-decoration: none;
    color: inherit;
    border-radius: 50%;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.cart-icon-wrapper:hover {
    background: rgba(0, 0, 0, 0.05);
}

.cart-icon-wrapper:active {
    background: rgba(0, 0, 0, 0.08);
}

.cart-icon {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
}

.cart-icon-wrapper:hover .cart-icon {
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cart-badge:not(:empty) {
    display: flex;
}

/* Скрываем бейдж если 0 */
.cart-badge[data-count="0"],
.cart-badge:empty {
    display: none;
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 60px;
        padding: 0 16px;
        border-bottom: 1px solid #eee;
    }

    .logo {
        font-size: 1.4rem;
        font-weight: 500;
    }

    /* Меню слева */
    .menu-toggle {
        position: absolute;
        left: 16px;
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
        color: #222;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-icon {
        display: block;
        width: 24px;
        height: 24px;
        stroke: #222;
        transition: stroke 0.3s;
    }

    .menu-toggle:hover .menu-icon {
        stroke: #777;
    }

    /* Корзина справа */
    .header-actions {
        position: absolute;
        right: 16px;
        gap: 8px;
    }
    
    .cart-icon-wrapper {
        width: 40px;
        height: 40px;
    }
    
    .cart-icon {
        width: 20px;
        height: 20px;
    }
    
    .cart-badge {
        min-width: 16px;
        height: 16px;
        font-size: 11px;
        padding: 0 3px;
    }

    .nav {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: #f4f4f4;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .nav a {
        padding: 1rem;
        border-bottom: 1px solid #ddd;
        margin: 0;
    }

    .nav.open {
        display: flex;
    }
}


/* ===== Шапка страницы корзины ===== */
.cart-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 20px 0;
    background: #fff;
}

.cart-header__logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem; 
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: opacity 0.2s ease;
}

@media (max-width: 768px) {
    .cart-header__logo {
        font-size: 1.5rem;
    }
}

.cart-header__logo:hover {
    opacity: 0.7;
}

.cart-header__divider { 
    width: 100%;
    max-width: 600px;
    height: 1px;
    background: #d0d0d0;
    margin: 16px 0;
}

.cart-header__title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 600px;
    position: relative;
}

.cart-header__back {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease, background 0.2s ease;
}

.cart-header__back:hover {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.04);
}

.cart-header__back:active {
    background: rgba(0, 0, 0, 0.08);
}

.cart-header__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: 0.01em;
}

/* ===== Обновляем отступы страницы ===== */
.cart-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* Убираем старый заголовок, если был */
.cart-page__title {
    display: none;
}