/* Fonts */
@font-face {
    font-family: 'Sansation';
    src: url('../fonts/Sansation-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sansation';
    src: url('../fonts/Sansation-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
} 

@font-face {
    font-family: 'Sansation';
    src: url('../fonts/Sansation-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AGOpt Cyrillic';
    src: url('../fonts/agopt-cyrillic-normal.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AGOpt Cyrillic';
    src: url('../fonts/agopt-cyrillic-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables: Global Color Palette */
:root {
    /* Base */
    --mm-color-bg: #ffffff;
    --mm-color-text: #333333;
    --mm-color-text-muted: #666666;
    --mm-color-text-light: #999999;

    /* Primary / Accent */
    --mm-color-primary: #000000;
    --mm-color-primary-hover: #333333;
    --mm-color-accent: #ff4500;

    /* Border / Surfaces */
    --mm-color-border: #e0e0e0;
    --mm-color-border-soft: #f5f5f5;
    --mm-color-surface: #ffffff;
    --mm-color-surface-muted: #f8f8f8;
    --mm-color-surface-alt: #fafafa;

    /* State */
    --mm-color-error: #d32f2f;

    /* Specials */
    --mm-color-blue: #2563eb;
    --mm-color-blue-hover: #1d4ed8;
    --mm-color-placeholder: #9ca3af;

     /* Small flat button */
     --mm-color-flat-btn-text-active: #333333;
     --mm-color-flat-btn-bg-active: #f5f5f5;
     --mm-color-flat-btn-text-disabled: #BBBBBB;
     --mm-color-flat-btn-bg-disabled: #f8f8f8;

     /* Buttons */
     --mm-color-btn-text-fade-active: #666666;
     --mm-color-btn-text-fade-hover: #000000;


body {
    font-family: 'Sansation', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    letter-spacing: 0.2px;
    color: var(--mm-color-text);
    background-color: var(--mm-color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 80px; /* Компенсация для fixed header */
}

/* Header Styles */
.site-header {
    background-color: var(--mm-color-bg);
    box-shadow: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    transition: transform 0.3s ease-out, box-shadow 0.3s ease;
    transform: translateY(0);
}

.glass {
    /* “стекло” */
    background: rgba(255, 255, 255, 0.5); /* подберите под дизайн */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* Safari */

    /* чтобы читалось на светлом/темном фоне */
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.glass-dark {
    /* “стекло” */
    background: rgba(0, 0, 0, 0.5); /* подберите под дизайн */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* Safari */

    /* чтобы читалось на светлом/темном фоне */
    border-bottom: 1px solid rgba(0,0,0,0.2);
}

.site-header.scrolled {
    box-shadow: rgba(0, 0, 0, 0.08) 0 2px 5px;
}

.site-header.hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease-in;
}

.header-container {
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.header-logo {
    flex-shrink: 0;
}

.logo-link {
    /* display: inline-block; */
    text-decoration: none;
}

.logo-image {
    height: 21px;
    width: auto;
    max-width: 181px;
    display: block;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.icon-img {
    width: 25px;
    height: 25px;
    display: block;
}

/* Burger menu icon */
.burger-icon {
    display: none;
}

/* Показываем бургер на мобильных на всех страницах */
@media (max-width: 768px) {
    .burger-icon {
        display: flex;
    }
}

/* На странице товара бургер показываем всегда (и на десктопе) */
body:has(.product-detail-page) .burger-icon {
    display: flex;
}

.popup-menu-overlay {
    position: fixed;
    inset: 0;
    /* Фон вокруг панели — прозрачный, чтобы на product detail
       белым был только сам блок меню, а не вся страница */
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
    z-index: 900;
}

.popup-menu-panel {
    background-color: #ffffff;
    height: 100%;
    width: 100vw;
    max-width: 100vw;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    padding: 100px 40px 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

.popup-menu-header {
    margin-bottom: 40px;
}

.popup-menu-logo {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

.popup-menu-logo .logo-image {
    height: 21px;
}

.popup-menu-nav {
    width: 100%;
    margin-top: 20%;
}

.popup-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.popup-menu-item {
    text-align: left;
    margin-bottom: 15px;
}

.popup-menu-separator {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--mm-color-border-soft);
}

.popup-menu-separator-info a {
    color: var(--mm-color-text-muted); 
    font-size: 16px;
}

.btn-popup-menu {
    display: inline-block;
    width: 100%;
    background: none;
    border: none;
    color: var(--mm-color-text);
    font-size: 20px;
    line-height: 1.3;
    cursor: pointer;
    padding: 4px 0;
    text-align: left;
    text-decoration: none;
    transition: color 0.2s ease-out;
}

.btn-popup-menu:hover {
    color: var(--mm-color-text-muted);
}

body.popup-menu-open {
    overflow: hidden;
}

body.popup-menu-open .popup-menu-overlay {
    opacity: 1;
    visibility: visible;
}

body.popup-menu-open .popup-menu-panel {
    transform: translateX(0);
}

body.popup-menu-open .popup-menu-logo {
    opacity: 1;
}

.size-guide-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
    z-index: 950;
}

.size-guide-container {
    margin: auto;
}

.size-guide-panel {
    background-color: #ffffff;
    height: 100%;
    width: 100vw;
    max-width: 100vw;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    padding: 90px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* Для container queries по ширине панели */
    container-type: inline-size;
    container-name: size-guide-panel;
}

.size-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.size-guide-title {
    font-size: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.size-guide-close {
    background: none;
    border: none;
    cursor: pointer;
    appearance: none;
    outline: none;
}

.size-guide-close-icon {
    width: 25px;
    height: 25px;
    display: block;
}

.size-guide-subtitle {
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.size-guide-content {
    overflow-y: auto;
}

.size-guide-section + .size-guide-section {
    margin-top: 24px;
}

.size-guide-section-title {
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.size-guide-table-wrapper {
    overflow-x: auto;
}

.size-guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.size-guide-table th,
.size-guide-table td {
    border: 1px solid #e5e5e5;
    padding: 8px 10px;
    text-align: center;
}

.size-guide-table th {
    background-color: #f8f8f8;
    font-weight: 400;
}

/* Скрытие колонок в узкой панели размерной сетки (container queries) */
@container size-guide-panel (max-width: 768px) {
    .size-guide-table th.hide-on-mobile,
    .size-guide-table td.hide-on-mobile {
        display: none;
    }
}

.product-size-guide-link-wrapper {
    display: flex;
    justify-content: center;
    /* margin-top: -20px; */
    margin-bottom: 50px;
}

.btn-size-guide {
    font-size: 10px!important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* color: var(--mm-color-text)!important; */
}

.btn-size-guide-icon {
    flex-shrink: 0;
    display: block;
}

body.size-guide-open {
    overflow: hidden;
}

body.size-guide-open .size-guide-overlay {
    opacity: 1;
    visibility: visible;
}

body.size-guide-open .size-guide-panel {
    transform: translateX(0);
}

/* Страница товара: на десктопе панель на 50% ширины */
@media (min-width: 769px) {
    body:has(.product-detail-page) .popup-menu-panel {
        width: 50vw;
        max-width: 50vw;
    }

    .size-guide-panel {
        width: 50vw;
        max-width: 50vw;
        padding: 100px 40px 40px;
    }
}

/* На мобильных всегда 100% ширины */
@media (max-width: 768px) {
    .popup-menu-panel {
        padding: 90px 24px 32px;
    }

    .btn-popup-menu {
        font-size: 22px;
    }
}

.cart-badge {
    position: absolute;
    top: -11px;
    right: -11px;
    background-color: var(--mm-color-accent);
    color: #fff;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 11px;
    padding: 4px;
}

.cart-badge:empty {
    display: none;
}

.account-icon {
    position: relative;
}

.account-menu {
    position: absolute;
    top: calc(100% + 19px);
    right: -16px;
    background: #fafafa;
    border-radius: 6px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 1001;
    pointer-events: none;
}

.account-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-arrow {
    position: absolute;
    top: -10px;
    right: 17px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid #fafafa;
}

.menu-list {
    list-style: none;
}

.menu-list li {
    margin: 0;
}

/* Ссылки используют базовые стили из common.css */
.menu-list a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
    color: var(--mm-color-text-muted);
}

.menu-list a:hover {
    background-color: var(--mm-color-bg);
    color: var(--mm-color-primary);
}

/* Main Content */
.site-main {
    flex: 1;
    /* padding: 40px 0; */
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.page-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
}

.home-page {
    text-align: center;
    padding: 0 0 80px 0;
} 

.home-page .page-container {
    max-width: initial;
    margin: 0 auto;
    padding: 0;
} 

.page-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--mm-color-text);
}

.page-description {
    font-size: 1.2rem;
    color: var(--mm-color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Footer Styles */
.site-footer {
    background-color: var(--mm-color-surface-muted);
    margin-top: auto;
    padding: 50px 0 20px;
}

.footer-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    flex-direction: row;
    gap: 50px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-brand {
    gap: 15px;
    flex: 1 1 250px;
    min-width: 250px;
}

.footer-logo {
    margin-bottom: 10px;
}

.footer-logo .logo-image {
    height: 21px;
}

.footer-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    max-width: 300px;
}

.footer-links {
    display: flex;
    flex-direction: row;
    gap: 50px;
    flex: 2 1 600px;
    flex-wrap: wrap;
}

.footer-column {
    display: flex;
    flex-direction: column;
    flex: 1 1 150px;
    min-width: 150px;
}

.footer-title {
    font-size: 1rem;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: #333;
    letter-spacing: 0.5px;
}

.footer-list {
    list-style: none;
}

.footer-list li {
    margin-bottom: 10px;
}

/* Ссылки используют базовые стили из common.css */
.footer-list a {
    font-size: 0.9rem;
    transition: color 0.2s;
}

/* .footer-list a:hover - color убран, наследует цвет от родителя */

.footer-bottom {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 40px 0;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.footer-copyright {
    font-size: 0.85rem;
    color: #999;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .footer-container {
        gap: 40px;
    }
    
    .footer-brand {
        flex: 1 1 100%;
    }
    
    .footer-links {
        flex: 1 1 100%;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .modal-content {
        max-height: inherit!important;
    }

    .header-container {
        padding: 0 20px;
        height: 70px;
    }
    
    .header-nav {
        gap: 20px;
    }
    
    .page-container {
        padding: 0 40px;
    }
    
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-description {
        font-size: 1rem;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 30px;
        padding: 0 20px;
    }
    
    .footer-brand {
        flex: 1 1 100%;
    }
    
    .footer-links {
        flex-direction: column;
        flex: 1 1 100%;
        gap: 30px;
    }
    
    .footer-column {
        flex: 1 1 100%;
    }
    
    .footer-bottom {
        padding: 20px 20px 0;
    }

    form .half-width,
    form .third-width,
    form .quarter-width {
        max-width: initial!important;
    }
}

@media (max-width: 480px) { 

    
    .page-title {
        font-size: 1.75rem;
    }
}
