/* ===== Переменные ===== */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', serif;
}

.product-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-color-main);
}

body,
button,
input,
select,
textarea,
a,
p,
span,
div,
li,
blockquote,
cite,
figcaption {
    font-family: 'Manrope', sans-serif;
}

:root {
    --bg-color: #f5f2ea;
    --white: #ffffff;
    --text-main: #3c3631;
    --text-muted: #8a8581;
    --accent-color: #d9bca3;
    --btn-dark: #3c3531;
    --shadow: 0 4px 20px rgba(60, 54, 49, 0.08);
    --transition: 0.3s ease;
    --radius: 16px;
}

/* ===== Сброс ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition), background var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Шапка ===== */
.header {
    padding: 16px 0;
    background: var(--bg-color);
    border-bottom: 1px solid #ece9e2;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Кроссбраузерный backdrop-filter */
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    /* Фолбэк для старых браузеров */
    background-color: rgba(245, 242, 234, 0.92);
}

.header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-main);
    transition: opacity var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

.logo svg {
    color: var(--accent-color);
    flex-shrink: 0;
}

/* Навигация */
.nav {
    justify-self: center;
}

.nav__list {
    display: flex;
    gap: 32px;
}

.nav__link {
    font-size: 14px;
    font-weight: 500;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}

.nav__link.active {
    border-bottom-color: var(--text-main);
}

.nav__link:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Действия справа */
.header__actions {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-self: end;
}

.phone {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.phone:hover {
    color: var(--accent-color);
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
}

.cart-btn:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.cart-btn__count {
    background: var(--btn-dark);
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

/* Бургер (скрыт на десктопе) */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
}

.burger__line {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--text-main);
    border-radius: 4px;
    transition: all var(--transition);
    transform-origin: center;
}

.burger[aria-expanded="true"] .burger__line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.burger[aria-expanded="true"] .burger__line:nth-child(2) {
    opacity: 0;
}
.burger[aria-expanded="true"] .burger__line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Основной контент ===== */
.main {
    min-height: 60vh;
    padding: 30px 0;
}

/* ===== Футер ===== */
.footer {
    background: #ece9e2;
    padding: 50px 0 20px;
    margin-top: 40px;
}

.footer__inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e0dbd2;
}

.footer__brand {
    max-width: 280px;
}

.footer__brand .logo {
    margin-bottom: 14px;
}

.footer__brand p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer__col h4 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.footer__col ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__col ul li a {
    font-size: 13px;
    color: var(--text-muted);
    transition: color var(--transition);
}

.footer__col ul li a:hover {
    color: var(--text-main);
}

.social {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.social a {
    width: 34px;
    height: 34px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform var(--transition), box-shadow var(--transition);
}

.social a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.footer__bottom {
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 10px;
}

/* ===== Адаптивность ===== */

/* Планшеты и мелкие ноутбуки */
@media (max-width: 1024px) {
    .footer__inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .header__inner {
        grid-template-columns: 1fr auto;
        gap: 12px;
    }

    /* Навигация скрывается, бургер показывается */
    .nav {
        display: block; /* Показываем для анимации, но скрываем через max-height */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 0 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        border-radius: 0 0 var(--radius) var(--radius);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition), padding var(--transition);
        pointer-events: none;
    }

    .nav.open {
        max-height: 300px; /* Достаточно для пунктов меню */
        padding: 20px;
        pointer-events: auto;
    }

    .nav__list {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .nav__link {
        font-size: 16px;
    }

    .burger {
        display: flex;
    }

    .phone {
        display: none; /* скрываем телефон на маленьких экранах */
    }

    .cart-btn {
        padding: 8px 12px;
        font-size: 0;  /* скрываем текст, оставляем иконку */
        line-height: 0;
    }

    .cart-btn svg {
        width: 20px;
        height: 20px;
    }

    .cart-btn__count {
        font-size: 11px; /* Возвращаем размер шрифта для счётчика */
        line-height: normal;
    }

    .footer__inner {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer__brand {
        max-width: 100%;
    }

    .footer__bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .header {
        padding: 12px 0;
    }
    .logo {
        font-size: 18px;
    }
    .logo svg {
        width: 22px;
        height: 22px;
    }
    .cart-btn {
        padding: 6px 10px;
    }
}

/* ===== Улучшения для устройств с вырезом (iPhone notch) ===== */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* ===== Уважение к настройкам уменьшенного движения ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Доступность: фокус ===== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}