/* style.css - Полный минималистичный дизайн Facon.store */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --white: #ffffff;
    --black: #000000;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --accent: #000000;
    --success: #000000;
    --error: #dc2626;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--black);
    background: var(--white);
    line-height: 1.5;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 32px;
}

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

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    padding: 20px 0;
    transition: all 0.3s ease;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--black);
    text-decoration: none;
    text-transform: uppercase;
}

.logo:hover {
    opacity: 0.8;
}

.main-nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

@media (max-width: 768px) {
    .main-nav {
        gap: 20px;
    }
}

.nav-link {
    color: var(--gray-800);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--black);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--black);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-icon {
    font-size: 18px;
    color: var(--gray-800);
    transition: color 0.2s ease;
}

.cart-link:hover .cart-icon {
    color: var(--black);
}

.cart-count {
    background: var(--black);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: -16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    min-width: 200px;
    display: none;
    z-index: 1000;
    padding: 8px 0;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-link {
    display: block;
    padding: 12px 24px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.dropdown-link:hover {
    color: var(--black);
    background: var(--gray-50);
}

/* Hero Section */
.hero-section {
    margin-top: 120px;
    margin-bottom: 80px;
    text-align: center;
}

@media (max-width: 768px) {
    .hero-section {
        margin-top: 100px;
        margin-bottom: 60px;
    }
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 24px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }
}

.hero-subtitle {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .hero-subtitle {
        font-size: 16px;
        margin-bottom: 40px;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid var(--black);
    background: var(--black);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.btn:hover {
    background: var(--white);
    color: var(--black);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--black);
}

.btn-outline:hover {
    background: var(--black);
    color: var(--white);
}

.btn-danger {
    background: var(--error);
    border-color: var(--error);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--white);
    color: var(--error);
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-800);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--black);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--black);
}

.form-input::placeholder {
    color: var(--gray-500);
}

/* Products Section */
.products-section {
    margin-bottom: 100px;
}

@media (max-width: 768px) {
    .products-section {
        margin-bottom: 60px;
    }
}

.section-header {
    margin-bottom: 48px;
    text-align: center;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 24px;
    }
}

.section-subtitle {
    color: var(--gray-600);
    font-size: 16px;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

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

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    border-color: var(--black);
    transform: translateY(-4px);
}

.product-image-container {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--gray-100);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--black);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.product-info {
    padding: 24px;
}

.product-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--black);
    text-decoration: none;
    margin-bottom: 12px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.product-name:hover {
    color: var(--gray-700);
}

.product-description {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 16px;
    line-height: 1.6;
    font-weight: 500;
}

.product-stock-container {
    margin-bottom: 20px;
}

.product-stock {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-stock.in-stock {
    color: var(--black);
}

.product-stock.out-of-stock {
    color: var(--gray-500);
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.product-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--black);
}

.add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--black);
    color: var(--white);
    border: 2px solid var(--black);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: var(--white);
    color: var(--black);
}

.add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-to-cart-btn i {
    font-size: 14px;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin: 40px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px;
    border-bottom: 2px solid var(--black);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 15px;
    font-weight: 500;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 4px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
}

.alert-success {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--black);
    color: var(--black);
}

.alert-error {
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-icon {
    font-size: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    border: 1px solid var(--gray-200);
    margin: 60px 0;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 24px;
    color: var(--gray-300);
}

.empty-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.empty-text {
    font-size: 16px;
    color: var(--gray-600);
    font-weight: 500;
    max-width: 400px;
    margin: 0 auto;
}

/* Discounts */
.discounts-section {
    margin-bottom: 100px;
    padding: 80px 0;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    text-align: center;
}

@media (max-width: 768px) {
    .discounts-section {
        margin-bottom: 60px;
        padding: 60px 0;
    }
}

.discounts-title {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: -1px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .discounts-title {
        font-size: 24px;
    }
}

.discounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .discounts-grid {
        grid-template-columns: 1fr;
    }
}

.discount-card {
    background: var(--white);
    border: 2px solid var(--black);
    padding: 32px;
    text-align: center;
    transition: transform 0.3s ease;
}

.discount-card:hover {
    transform: translateY(-4px);
}

.discount-code {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: var(--black);
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
    text-transform: uppercase;
}

.discount-value {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.discount-description {
    font-size: 16px;
    color: var(--gray-700);
    font-weight: 500;
    line-height: 1.6;
}

/* Floating Cart */
.floating-cart {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 100;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.floating-cart.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .floating-cart {
        bottom: 32px;
        right: 32px;
    }
}

@media (max-width: 480px) {
    .floating-cart {
        bottom: 24px;
        right: 24px;
    }
}

.floating-cart .btn {
    width: 60px;
    height: 60px;
    min-width: auto;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.floating-cart .btn .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--white);
    color: var(--black);
    border: 2px solid var(--black);
    font-size: 12px;
    font-weight: 800;
    padding: 2px 6px;
    min-width: 20px;
}

/* Footer */
.site-footer {
    border-top: 2px solid var(--black);
    padding: 80px 0 40px;
    background: var(--white);
}

@media (max-width: 768px) {
    .site-footer {
        padding: 60px 0 30px;
    }
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

.footer-brand .logo {
    font-size: 24px;
    margin-bottom: 20px;
    display: inline-block;
}

.footer-description {
    font-size: 16px;
    color: var(--gray-700);
    max-width: 400px;
    font-weight: 500;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--black);
}

.footer-social {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-link {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.social-link:hover {
    color: var(--black);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-600);
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Notification */
.notification {
    position: fixed;
    top: 120px;
    right: 40px;
    background: var(--black);
    color: var(--white);
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 1001;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .notification {
        top: 100px;
        right: 24px;
        left: 24px;
    }
}

.notification i {
    font-size: 16px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-24 {
    margin-bottom: 24px;
}

.mb-48 {
    margin-bottom: 48px;
}

.mt-24 {
    margin-top: 24px;
}

.mt-48 {
    margin-top: 48px;
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--black);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Product Page */
.product-detail {
    margin-top: 120px;
    margin-bottom: 80px;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

@media (max-width: 968px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

.product-image-main {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--gray-100);
}

.product-thumbnails {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.product-thumbnail:hover,
.product-thumbnail.active {
    border-color: var(--black);
}

.product-info-detail {
    padding: 0;
}

.product-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.product-price-detail {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--black);
}

.product-description-detail {
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-700);
    margin-bottom: 32px;
    font-weight: 500;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--black);
    background: var(--white);
    color: var(--black);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: var(--black);
    color: var(--white);
}

.quantity-input {
    width: 80px;
    height: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    border: 2px solid var(--black);
    color: var(--black);
}

.product-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.product-action-btn {
    padding: 16px 32px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid var(--black);
    background: var(--white);
    color: var(--black);
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.product-action-btn.primary {
    background: var(--black);
    color: var(--white);
}

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

.product-action-btn.primary:hover {
    background: var(--white);
    color: var(--black);
}

/* Login/Register Pages */
.auth-container {
    max-width: 480px;
    margin: 120px auto 80px;
    padding: 0 20px;
}

.auth-card {
    border: 1px solid var(--gray-200);
    padding: 48px 40px;
}

.auth-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 32px;
    text-align: center;
    letter-spacing: -0.5px;
}

.auth-link {
    text-align: center;
    margin-top: 32px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.auth-link a {
    color: var(--black);
    text-decoration: none;
    font-weight: 700;
}

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

/* Profile Page */
.profile-container {
    margin-top: 120px;
    margin-bottom: 80px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 48px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--black);
}

.profile-info h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.profile-info p {
    color: var(--gray-700);
    font-size: 16px;
    font-weight: 500;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

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

.profile-card {
    border: 1px solid var(--gray-200);
    padding: 32px;
}

.profile-card h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.order-number {
    font-weight: 700;
    color: var(--black);
}

.order-date {
    font-size: 14px;
    color: var(--gray-600);
}

.order-status {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 8px;
}

.order-status.pending {
    color: var(--gray-600);
}

.order-status.delivered {
    color: var(--black);
}

/* Checkout Page */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin: 120px 0 80px;
}

@media (max-width: 968px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
}

.checkout-summary {
    border: 1px solid var(--gray-200);
    padding: 32px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.summary-total {
    font-size: 24px;
    font-weight: 800;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--black);
}

/* Success Page */
.success-container {
    text-align: center;
    margin: 120px auto 80px;
    max-width: 600px;
    padding: 0 20px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 32px;
    color: var(--black);
}

.success-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.success-message {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 48px;
    line-height: 1.6;
    font-weight: 500;
}

.success-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
/* Оптимизация head для мобильных устройств */

/* Базовая оптимизация для всех экранов */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    padding: 20px 0;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: clamp(20px, 5vw, 24px); /* Адаптивный размер шрифта */
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--black);
    text-decoration: none;
    text-transform: uppercase;
    display: block;
    line-height: 1;
    padding: 8px 0;
    min-width: 0; /* Для правильного сжатия */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo:hover {
    opacity: 0.8;
}

/* Мобильное меню с бургер-иконкой */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 1002;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--black);
    position: relative;
    transition: all 0.3s ease;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--black);
    left: 0;
    transition: all 0.3s ease;
}

.menu-toggle-icon::before {
    top: -8px;
}

.menu-toggle-icon::after {
    bottom: -8px;
}

.menu-toggle.active .menu-toggle-icon {
    background: transparent;
}

.menu-toggle.active .menu-toggle-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle.active .menu-toggle-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Основная навигация */
.main-nav {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-link {
    color: var(--gray-800);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding: 8px 0;
    transition: color 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--black);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--black);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
}

.cart-icon {
    font-size: 18px;
    color: var(--gray-800);
    transition: color 0.2s ease;
}

.cart-link:hover .cart-icon {
    color: var(--black);
}

.cart-count {
    background: var(--black);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
    .site-header {
        padding: 16px 0;
        position: fixed;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.95);
        border-bottom: 1px solid var(--gray-200);
    }
    
    .container {
        padding: 0 16px;
    }
    
    .logo {
        font-size: clamp(18px, 4.5vw, 22px);
        letter-spacing: -0.3px;
        max-width: 70vw; /* Ограничиваем ширину логотипа */
    }
    
    /* Показываем бургер-меню на мобильных */
    .menu-toggle {
        display: block;
        order: 3;
    }
    
    /* Превращаем горизонтальное меню в вертикальное для мобильных */
    .main-nav {
        position: fixed;
        top: 72px; /* Высота header + отступ */
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--gray-200);
        flex-direction: column;
        align-items: stretch;
        padding: 20px 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        z-index: 999;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
    }
    
    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        display: block;
        padding: 16px 20px;
        font-size: 16px;
        border-bottom: 1px solid var(--gray-100);
        letter-spacing: 0.5px;
        margin: 0;
        text-align: left;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-link::after {
        display: none; /* Убираем подчеркивание на мобильных */
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: var(--gray-50);
        color: var(--black);
    }
    
    .cart-link {
        padding: 16px 20px;
        justify-content: flex-start;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .cart-icon {
        font-size: 20px;
    }
    
    .cart-count {
        font-size: 12px;
        padding: 4px 9px;
    }
    
    /* Улучшаем доступность для сенсорных экранов */
    .nav-link,
    .cart-link,
    .menu-toggle {
        min-height: 44px; /* Минимальный размер для сенсорных целей */
        cursor: pointer;
    }
    
    /* Анимация для мобильного меню */
    .main-nav {
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
    .logo {
        font-size: 16px;
        max-width: 60vw;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .main-nav {
        top: 64px;
    }
}

/* Для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-nav {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 13px;
        letter-spacing: 0.5px;
    }
    
    .logo {
        font-size: 22px;
    }
}

/* Улучшаем поддержку iOS Safari */
@supports (-webkit-touch-callout: none) {
    .site-header {
        padding: max(16px, constant(safe-area-inset-top)) 0 max(16px, constant(safe-area-inset-bottom));
        padding: max(16px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
    }
    
    .main-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Анимации для улучшения UX */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-nav.active .nav-link {
    animation: fadeInDown 0.3s ease forwards;
    opacity: 0;
}

.main-nav.active .nav-link:nth-child(1) { animation-delay: 0.1s; }
.main-nav.active .nav-link:nth-child(2) { animation-delay: 0.15s; }
.main-nav.active .nav-link:nth-child(3) { animation-delay: 0.2s; }
.main-nav.active .nav-link:nth-child(4) { animation-delay: 0.25s; }
.main-nav.active .cart-link { animation-delay: 0.3s; }

/* Улучшаем видимость активного состояния на мобильных */
@media (max-width: 768px) {
    .nav-link:active {
        background: var(--gray-100);
        transition: background 0.1s ease;
    }
}

/* Убираем outline для сенсорных устройств, но оставляем для клавиатуры */
.nav-link:focus:not(:focus-visible),
.cart-link:focus:not(:focus-visible) {
    outline: none;
}

.nav-link:focus-visible,
.cart-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Плавный скролл для всего документа на мобильных */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 72px; /* Высота header */
    }
}

/* Оптимизация для landscape режима на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .main-nav {
        max-height: 60vh;
        top: 60px;
    }
    
    .nav-link {
        padding: 12px 20px;
    }
}

/* Улучшение видимости при прокрутке */
.site-header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* JavaScript классы для управления меню */
.menu-open {
    overflow: hidden; /* Запрещаем скролл при открытом меню */
}

@media (max-width: 768px) {
    .menu-open body {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}