/**
 * MOBILE RESPONSIVE STYLES - UNIFIED
 * Об'єднує mobile-app.css та mobile.min.css без дублювань
 * Оптимізовано для всіх пристроїв
 */

/* ============================================
   MOBILE BOTTOM NAVIGATION
============================================ */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-between;
    gap: 8px;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: #616161;
    transition: color 0.3s ease;
    position: relative;
    padding: 4px 0;
    background: transparent;
    border: none;
    min-height: 44px;
    min-width: 44px;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--color-brand-primary);
}

.mobile-bottom-nav .nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.mobile-bottom-nav .nav-label {
    font-size: 11px;
    font-weight: 500;
}

.mobile-bottom-nav .nav-badge {
    position: absolute;
    top: 0;
    right: calc(50% - 20px);
    background: var(--color-brand-primary);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.mobile-bottom-nav .nav-badge-hidden,
.nav-badge.hidden,
.badge.hidden {
    display: none;
}

/* ============================================
   MOBILE FOOTER
============================================ */

.mobile-footer {
    display: none;
    background: #2c2c2c;
    color: white;
    padding: 30px 20px calc(80px + env(safe-area-inset-bottom));
}

/* Subscribe Section */
.mobile-subscribe {
    margin-bottom: 30px;
}

.mobile-subscribe-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.5;
}

.subscribe-form .form-group {
    margin-bottom: 15px;
}

.subscribe-form label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: white;
}

.subscribe-form .required {
    color: var(--color-brand-primary);
}

.subscribe-form .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #1a1a1a;
    color: white;
    font-size: 14px;
}

.subscribe-form select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

.subscribe-form .form-privacy {
    font-size: 12px;
    color: #c9c9c9;
    margin-bottom: 15px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.subscribe-form .form-privacy input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-brand-primary);
    flex-shrink: 0;
}

.subscribe-form .form-privacy label {
    cursor: pointer;
    flex: 1;
}

.subscribe-form .form-privacy a {
    color: var(--color-brand-light, #5AACDE);
    text-decoration: underline;
}

.btn-subscribe {
    width: 100%;
    padding: 14px;
    background: var(--color-brand-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-subscribe:hover {
    background: var(--color-brand-accent);
}

/* Social Networks */
.mobile-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px 0;
    border-top: 1px solid #444;
    border-bottom: 1px solid #444;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--color-brand-primary);
    transform: scale(1.1);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Accordions */
.mobile-accordions {
    margin-bottom: 30px;
}

.accordion-item {
    border-bottom: 1px solid #444;
}

.accordion-header {
    width: 100%;
    padding: 18px 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
}

.accordion-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    stroke-width: 2;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.accordion-links li {
    margin-bottom: 10px;
}

.accordion-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.accordion-links a:hover {
    color: var(--color-brand-primary);
}

/* Contact Info */
.contact-info,
.mobile-contact-info {
    padding: 15px 0;
    font-size: 14px;
}

.contact-info p,
.mobile-contact-info p {
    margin-bottom: 8px;
    color: #ccc;
}

.contact-info strong,
.mobile-contact-info strong {
    color: white;
}

.contact-info .schedule {
    color: #999;
    font-size: 13px;
}

.contact-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 15px 0;
}

.contact-column p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #ccc;
}

.contact-column strong {
    color: white;
    font-size: 14px;
}

.schedule-column p {
    margin-bottom: 5px;
    font-size: 13px;
    line-height: 1.6;
    color: #999;
}

.mobile-schedule {
    padding: 15px 0 0;
    margin-top: 10px;
}

.mobile-schedule p {
    margin-bottom: 5px;
    font-size: 13px;
    line-height: 1.6;
    color: #ccc;
}

.mobile-schedule strong {
    color: white;
}

.mobile-address {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #444;
}

/* Copyright */
.mobile-copyright {
    padding-top: 20px;
    text-align: center;
}

.mobile-copyright .copyright-text {
    font-size: 13px;
    color: #ccc;
    line-height: 1.6;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.mobile-copyright .developer-link {
    font-size: 12px;
    color: #c9c9c9;
    line-height: 1.6;
    margin: 0;
}

.mobile-copyright .developer-link a {
    color: var(--color-brand-light, #5AACDE);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.mobile-copyright .developer-link a:hover {
    color: var(--color-brand-light);
}

/* ============================================
   MOBILE CATALOG BUTTON
============================================ */

.mobile-catalog-btn {
    display: none;
}

/* ============================================
   RESPONSIVE BREAKPOINTS - OPTIMIZED
============================================ */

/* Extra Small Devices - Mobile Portrait (max-width: 575.98px) */
@media (max-width: 575.98px) {
    :root {
        --spacing-xs: 0.25rem;
        --spacing-sm: 0.5rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-xxl: 2.5rem;
    }
    
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.75rem;
        text-align: center;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        text-align: center;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
        text-align: center;
        line-height: 1.3;
    }
    
    .btn {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 1rem;
        min-height: 48px;
        min-width: 48px;
        border-radius: var(--border-radius-md);
    }
    
    .form-control {
        padding: var(--spacing-md);
        font-size: 16px;
        min-height: 48px;
    }
    
    .contact-info-grid {
        gap: 12px;
    }
    
    .contact-column p,
    .schedule-column p {
        font-size: 12px;
    }
    
    .logo-img {
        max-width: 60px;
    }

    .header-content {
        gap: 8px;
        padding: 0 8px;
    }
    
    .search-input {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Tablet and Below (max-width: 991.98px) */
@media (max-width: 991.98px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    
    .section-padding {
        padding: var(--spacing-xl) 0;
    }
}

/* MOBILE ACTIVATION - Main Breakpoint */
@media (max-width: 768px) {
    .logo-text {
        font-size: 1.25rem;
    }

    /* Show mobile elements */
    .mobile-bottom-nav {
        display: flex;
    }
    
    .mobile-footer {
        display: block;
    }
    
    .mobile-catalog-btn {
        display: block;
        text-align: center;
        padding: 30px 15px;
        background: #f8f9fa;
        margin: 0;
    }
    
    .mobile-catalog-btn .btn {
        background: var(--color-brand-primary);
        color: white;
        border: none;
        padding: 15px 50px;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: 30px;
        box-shadow: 0 4px 15px rgba(30, 109, 180, 0.3);
        transition: all 0.3s ease;
    }
    
    .mobile-catalog-btn .btn:hover {
        background: var(--color-brand-accent);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(30, 109, 180, 0.4);
    }
    
    /* Hide desktop elements */
    .footer-main,
    .footer-bottom {
        display: none;
    }
    
    .top-bar,
    .main-nav,
    .desktop-nav {
        display: none;
    }
    
    /* Simplified header */
    .main-header {
        padding: 8px 0;
    }
    
    .header-content {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 10px;
    }
    
    .logo {
        flex: 0 0 auto;
    }
    
    .logo-img {
        max-width: 70px;
        height: auto;
    }
    
    .mobile-catalog {
        display: block;
    }
    
    .mobile-catalog-overlay {
        display: block;
    }
    
    .categories-section {
        display: none;
    }

    /* Фіксований хедер: завжди видимий при скролі (мобільний вигляд) */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }

    html {
        scroll-padding-top: calc(
            env(safe-area-inset-top, 0px) + var(--mobile-fixed-header-content-height)
        );
    }

    .main-content {
        padding-top: calc(
            env(safe-area-inset-top, 0px) + var(--mobile-fixed-header-content-height)
        );
    }
    
    /* Content padding */
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
    
    main {
        min-height: calc(
            100vh - 60px - env(safe-area-inset-bottom) - env(safe-area-inset-top, 0px) -
                var(--mobile-fixed-header-content-height)
        );
    }
}

/* Very Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .contact-info-grid {
        gap: 8px;
    }
}

/* ============================================
   IOS SAFARI OPTIMIZATIONS
============================================ */

@supports (-webkit-touch-callout: none) {
    .mobile-bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    .mobile-footer {
        padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    }
    
    .mobile-bottom-nav .nav-item {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* ============================================
   ACCESSIBILITY
============================================ */

@media (prefers-reduced-motion: reduce) {
    .mobile-bottom-nav .nav-item,
    .accordion-icon,
    .social-link {
        transition: none;
    }
}

.mobile-catalog {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.mobile-catalog.active {
    right: 0;
}

.mobile-catalog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-catalog-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-catalog-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.mobile-catalog-close {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.mobile-catalog-close:active {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-catalog-close svg {
    width: 24px;
    height: 24px;
    stroke: #333;
}

.mobile-catalog-content {
    padding: 8px 0;
    min-height: calc(100vh - 70px);
}

.mobile-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-bottom: 20px;
}

.mobile-category-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-category-item[data-category-type="women"],
.mobile-category-item[data-category-type="men"],
.mobile-category-item[data-category-type="couple"] {
    background: rgba(30, 109, 180, 0.04);
}

.mobile-category-toggle,
.mobile-category-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}

.mobile-category-toggle:active,
.mobile-category-link:active {
    background: rgba(30, 109, 180, 0.05);
}

.category-name {
    flex: 1;
}

.category-arrow {
    width: 20px;
    height: 20px;
    stroke: #999;
    transition: transform 0.3s ease;
}

.mobile-category-item.active .category-arrow {
    transform: rotate(90deg);
}

.mobile-subcategories-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    background: #fafafa;
    transition: max-height 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.mobile-category-item.active .mobile-subcategories-list {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
}

.mobile-subcategory-item {
    border-bottom: 1px solid #f0f0f0;
}

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

.mobile-subcategory-link {
    display: block;
    padding: 14px 20px 14px 40px;
    color: #555;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-subcategory-link:active {
    background: rgba(30, 109, 180, 0.08);
    color: var(--color-brand-primary);
    padding-left: 44px;
}

.mobile-category-item.info-menu .mobile-category-toggle {
    background: rgba(30, 109, 180, 0.1);
    border-left: 4px solid var(--color-brand-primary);
    color: var(--color-brand-primary);
    font-weight: 600;
}

.mobile-category-item.info-menu .mobile-category-toggle:active {
    background: rgba(30, 109, 180, 0.15);
}

.mobile-category-item.info-menu .category-arrow {
    stroke: var(--color-brand-primary);
}

.mobile-category-item.info-menu .mobile-subcategories-list {
    background: rgba(30, 109, 180, 0.05);
}

.mobile-category-item.info-menu .mobile-subcategory-link:active {
    color: var(--color-brand-primary);
}

@media (max-width: 767px) {
    .mobile-catalog {
        display: block;
    }
    
    .mobile-catalog-overlay {
        display: block;
    }
}

@media (min-width: 768px) {
    .mobile-catalog,
    .mobile-catalog-overlay {
        display: none;
    }
}

/* iOS Safari Specific Styles */
@supports (-webkit-touch-callout: none) {
    /* Viewport Height Fix */
    .vh-100 {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
    }
    
    /* Safe Area Support */
    .container {
        padding-left: max(var(--spacing-md), env(safe-area-inset-left));
        padding-right: max(var(--spacing-md), env(safe-area-inset-right));
    }
    
    .header {
        padding-top: env(safe-area-inset-top);
    }
    
    .footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* Touch Optimizations */
    .btn,
    .nav-link,
    .cart-link,
    .wishlist-link,
    .logo-img,
    .search-btn {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
    }
    
    /* Performance Optimizations */
    .logo-img {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .search-icon {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    /* Search Autocomplete */
    .search-autocomplete {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        will-change: transform, opacity;
    }
    
    .autocomplete-item {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
    }
    
    /* Form Elements */
    input,
    select,
    textarea {
        font-size: 16px;
    }
    
    /* Sliders */
    .categories-slider,
    .products-slider {
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
    }
    
    .categories-slider .category-card,
    .products-slider .product-card {
        scroll-snap-align: start;
        scroll-snap-stop: normal;
    }

    /* Не перебивати position: fixed для .header на мобільних (mobile-responsive.css) */
    @media (min-width: 769px) {
        .header {
            position: -webkit-sticky;
            position: sticky;
        }
    }
    
    /* Emoji Optimization */
    .category-emoji,
    .product-emoji,
    .cart-icon {
        font-family: "Apple Color Emoji", system-ui, sans-serif;
        font-variant-emoji: emoji;
        text-rendering: optimizeSpeed;
    }
    
    .categories-slider,
    .products-slider {
        overscroll-behavior: contain;
        scroll-snap-type: x mandatory;
    }
    
    /* Backdrop Filter Support */
    @supports (backdrop-filter: blur(10px)) {
        .mobile-menu {
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
    }
    
    .slider-btn,
    .cart-icon,
    .hamburger {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    .fade-in,
    .slide-in-up {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    body {
        -webkit-overflow-scrolling: touch;
        position: relative;
        min-height: 100vh;
    }
    
    .main-content {
        -webkit-overflow-scrolling: touch;
        position: relative;
        min-height: 100vh;
    }
    
    /* Form Element Styles */
    input[type="search"] {
        -webkit-appearance: none;
        appearance: none;
        border-radius: var(--border-radius-md);
    }
    
    .btn {
        -webkit-appearance: none;
        appearance: none;
        border-radius: var(--border-radius-md);
    }
    
    select {
        -webkit-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 16px;
        padding-right: 40px;
    }
    
    /* User Selection */
    .slider-btn,
    .hamburger,
    .nav-link,
    .btn {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .category-name,
    .product-name,
    .section-title {
        -webkit-user-select: text;
        user-select: text;
    }
    
    /* Grid Fallback */
    @supports not (display: grid) {
        .categories-grid,
        .products-grid {
            display: flex;
            flex-wrap: wrap;
            gap: var(--spacing-lg);
        }
        
        .category-card,
        .product-card {
            flex: 1 1 calc(50% - var(--spacing-lg));
            max-width: calc(50% - var(--spacing-lg));
        }
    }
    
    /* Landscape Orientation */
    @media (orientation: landscape) and (max-height: 500px) {
        .hero-section {
            height: auto;
            min-height: 100vh;
            min-height: calc(var(--vh, 1vh) * 100);
        }
        
        .section-padding {
            padding: var(--spacing-lg) 0;
        }
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a1a;
        --text-color: #ffffff;
        --border-color: #333333;
    }
    
    @supports (-webkit-touch-callout: none) {
        .card {
            background: #2a2a2a;
            border-color: #333333;
        }
        
        .category-placeholder,
        .product-placeholder {
            background: #333333;
            color: #666666;
        }
    }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    @supports (-webkit-touch-callout: none) {
        .btn,
        .card,
        .nav-link {
            border: 2px solid currentColor;
        }
        
        .slider-btn {
            border: 3px solid currentColor;
        }
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    @supports (-webkit-touch-callout: none) {
        .categories-slider,
        .products-slider {
            scroll-behavior: auto;
        }
        
        .fade-in,
        .slide-in-up,
        .slider-btn,
        .cart-icon {
            animation: none;
            transition: none;
        }
    }
}

/* Tablet Layout */
@media (max-width: 991.98px) {
    .main-header {
        padding: var(--spacing-md) 0;
    }
    
    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: var(--spacing-md);
    }
    
    .logo {
        flex-shrink: 0;
    }
    
    .search-container {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
}

/* Mobile Layout */
@media (max-width: 767.98px) {
    .main-header {
        padding: var(--spacing-sm) 0;
    }
    
    .header-content {
        gap: var(--spacing-sm);
    }
    
    .logo-img {
        height: 50px;
        max-width: 170px;
        width: auto;
    }
    
    .cart-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: var(--spacing-xs);
        border-radius: var(--border-radius-md);
    }
    
    .cart-icon {
        font-size: 24px;
    }
    
    .cart-link .badge {
        top: -2px;
        right: -2px;
        font-size: 11px;
        min-width: 16px;
        height: 16px;
        padding: 1px 4px;
    }
    
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        padding: var(--spacing-xs);
        background: transparent;
        border: none;
    }
    
    .hamburger span {
        width: 24px;
        height: 2px;
        background: var(--neutral-dark);
        margin: 2px 0;
        transition: all var(--transition-normal);
    }
}

/* Small Mobile Layout */
@media (max-width: 575.98px) {
    .main-header {
        padding: var(--spacing-xs) 0;
    }
    
    .header-content {
        gap: var(--spacing-xs);
    }
    
    .logo-img {
        height: 42px;
        max-width: 140px;
    }
    
    .cart-link {
        width: 40px;
        height: 40px;
    }
    
    .hamburger {
        width: 40px;
        height: 40px;
    }
    
    .hamburger span {
        width: 22px;
        height: 2px;
        margin: 1.5px 0;
    }
    
    .cart-icon {
        font-size: 22px;
    }
}

/* Very Small Mobile Layout */
@media (max-width: 400px) {
    .logo-img {
        height: 38px;
        max-width: 120px;
    }
    
    .cart-link {
        width: 36px;
        height: 36px;
    }
    
    .hamburger {
        width: 36px;
        height: 36px;
    }
    
    .hamburger span {
        width: 20px;
        height: 2px;
    }
    
    .cart-icon {
        font-size: 20px;
    }
    
    .cart-link .badge {
        font-size: 10px;
        min-width: 14px;
        height: 14px;
    }
}

/* iOS Safari Touch Optimizations */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 767.98px) {
        /* safe-area зверху лише на .header — без дубля тут */
        .main-header {
            padding: var(--spacing-sm) 0 var(--spacing-md);
        }
        
        .header-content {
            -webkit-tap-highlight-color: transparent;
            min-height: 60px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        
        .logo-img {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            -webkit-user-select: none;
            user-select: none;
            height: 48px;
            max-width: 160px;
        }
        
        .cart-link,
        .hamburger {
            -webkit-tap-highlight-color: rgba(255, 20, 147, 0.15);
            touch-action: manipulation;
            min-height: 48px;
            min-width: 48px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .hamburger span {
            border-radius: 1px;
        }
        
        .cart-link {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .hamburger {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .cart-icon {
            font-size: 28px;
            line-height: 1;
        }
    }
    
    /* Mobile Menu Optimizations */
    .mobile-menu {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
    }
    
    .mobile-catalog {
        -webkit-overflow-scrolling: touch;
        position: fixed;
    }
    
    .mobile-catalog-content {
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-menu-nav a {
        -webkit-tap-highlight-color: rgba(255, 20, 147, 0.1);
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: var(--spacing-md);
        text-decoration: none;
    }
    
    .category-card,
    .product-card {
        -webkit-tap-highlight-color: rgba(255, 20, 147, 0.1);
        display: flex;
        flex-direction: column;
        text-align: center;
    }
    
    .catalog-container,
    .catalog-main,
    .products-grid {
        -webkit-overflow-scrolling: touch;
    }
    
    .btn {
        -webkit-tap-highlight-color: rgba(255, 20, 147, 0.2);
        min-height: 48px;
        min-width: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
    }
    
    .category-name,
    .product-name {
        text-align: center;
        -webkit-user-select: text;
        user-select: text;
        word-break: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
    }
    
    .category-emoji,
    .product-emoji {
        font-size: 3rem;
        line-height: 1;
        display: block;
        text-align: center;
        width: 100%;
    }
    
    /* Contact Page iOS Optimizations */
    .contacts-main {
        padding: env(safe-area-inset-top, var(--spacing-lg)) 
                env(safe-area-inset-right, var(--spacing-md)) 
                env(safe-area-inset-bottom, var(--spacing-lg)) 
                env(safe-area-inset-left, var(--spacing-md));
    }
    
    .contacts-main .container {
        padding-left: max(var(--spacing-md), env(safe-area-inset-left));
        padding-right: max(var(--spacing-md), env(safe-area-inset-right));
    }
    
    .contact-info-section {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .contact-form .form-control {
        -webkit-appearance: none;
        appearance: none;
        border-radius: var(--border-radius-md);
    }
    
    .contact-form .btn {
        -webkit-tap-highlight-color: rgba(255, 20, 147, 0.2);
        touch-action: manipulation;
        min-height: 48px;
        min-width: 48px;
    }
    
    .contact-item-icon {
        font-family: "Apple Color Emoji", system-ui, sans-serif;
        font-variant-emoji: emoji;
        text-rendering: optimizeSpeed;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .schedule-icon i,
    .contact-item-icon {
        -webkit-user-select: none;
        user-select: none;
    }
    
    .contact-form textarea {
        resize: vertical;
        min-height: 120px;
    }
    
    /* Portrait Orientation */
    @media (max-width: 767.98px) and (orientation: portrait) {
        .contacts-main {
            padding-top: max(var(--spacing-md), env(safe-area-inset-top));
            padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
        }
    }
    
    /* Footer iOS Optimizations */
    .footer-main {
        padding-bottom: env(safe-area-inset-bottom, var(--spacing-md));
    }
    
    .footer-main .container {
        padding-left: max(var(--spacing-sm), env(safe-area-inset-left));
        padding-right: max(var(--spacing-sm), env(safe-area-inset-right));
    }
    
    .footer-section {
        -webkit-tap-highlight-color: transparent;
    }
    
    .footer-links a {
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.1);
        touch-action: manipulation;
    }
    
    .footer-contact {
        -webkit-user-select: text;
        user-select: text;
    }
    
    .copyright,
    .footer-dev {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Small Mobile iOS */
    @media (max-width: 575.98px) {
        .footer-main .row {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .footer-section {
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }
    }
    
    /* Retina Display Optimizations */
    @media (max-width: 400px) and (-webkit-min-device-pixel-ratio: 2) {
        .footer-main {
            padding: max(2px, env(safe-area-inset-bottom, 2px)) 0;
        }
        
        .footer-section {
            padding: 2px;
        }
        
        .footer-title {
            font-size: 0.75rem;
            margin-bottom: 2px;
        }
        
        .footer-links a {
            font-size: 0.7rem;
        }
        
        .footer-contact p {
            font-size: 0.65rem;
        }
        
        .footer-bottom {
            background: var(--neutral-dark);
            padding: max(2px, env(safe-area-inset-bottom, 2px)) 0;
            border-top: none;
        }
        
        .copyright {
            font-size: 0.6rem;
            color: rgba(255, 255, 255, 0.4);
        }
        
        .footer-dev {
            font-size: 0.55rem;
        }
    }
}
/* Мобільний пошук - стилі для функціоналу пошуку в хедері */

/* Десктопні дії - показувати тільки на великих екранах */
.header-actions.desktop-actions {
    display: flex;
}

/* Мобільні дії - приховати на десктопі */
.header-actions.mobile-actions {
    display: none;
}

/* Мобільна версія - приховати десктопні дії, показати мобільні */
@media (max-width: 767.98px) {
    .header-actions.desktop-actions {
        display: none;
    }
    
    .header-actions.mobile-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        flex-shrink: 0;
    }

    /*
     * ios-safari.min.css задає width/height лише для .cart-link — порівняння та обране лишаються
     * «різними». Фіксована клітинка для всіх трьох + однакові бейджі (специфічність вища за .cart-link).
     */
    .header-actions.mobile-actions .cart-link,
    .header-actions.mobile-actions .compare-link,
    .header-actions.mobile-actions .wishlist-link {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        max-width: 44px;
        max-height: 44px;
        padding: 0;
        gap: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 0;
    }

    .header-actions.mobile-actions .cart-link .action-icon,
    .header-actions.mobile-actions .compare-link .action-icon,
    .header-actions.mobile-actions .wishlist-link .action-icon {
        width: 18px;
        height: 18px;
        display: block;
        flex-shrink: 0;
    }

    /* Оптичне вирівнювання різних гліфів у спільному 18×18 */
    .header-actions.mobile-actions .cart-link .action-icon {
        transform: scale(0.9);
        transform-origin: center;
    }

    .header-actions.mobile-actions .compare-link .action-icon {
        transform: scale(0.88);
        transform-origin: center;
    }

    .header-actions.mobile-actions .wishlist-link .action-icon {
        transform: translateY(-1px) scale(0.92);
        transform-origin: center;
    }

    .header-actions.mobile-actions .cart-link .badge,
    .header-actions.mobile-actions .compare-link .badge,
    .header-actions.mobile-actions .wishlist-link .badge {
        top: 3px;
        right: 3px;
        left: auto;
    }

    /* Активне порівняння: бейдж лишається, контур як у кошика та обраного */
    .header-actions.mobile-actions .compare-link.compare-link--active,
    .header-actions.mobile-actions .compare-link.compare-link--active:hover {
        color: var(--color-text-primary);
    }
    
    .search-container {
        display: none;
    }
}

/* Ті самі три іконки на вузьких екранах — як у ios-safari для cart, але для всіх */
@media (max-width: 575.98px) {
    .header-actions.mobile-actions .cart-link,
    .header-actions.mobile-actions .compare-link,
    .header-actions.mobile-actions .wishlist-link {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        max-height: 40px;
    }
}

@media (max-width: 400px) {
    .header-actions.mobile-actions .cart-link,
    .header-actions.mobile-actions .compare-link,
    .header-actions.mobile-actions .wishlist-link {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        max-width: 36px;
        max-height: 36px;
    }

    .header-actions.mobile-actions .cart-link .badge,
    .header-actions.mobile-actions .compare-link .badge,
    .header-actions.mobile-actions .wishlist-link .badge {
        top: 1px;
        right: 1px;
        font-size: 10px;
        min-width: 15px;
        height: 15px;
        padding: 0 4px;
    }
}

/* Кнопка мобільного пошуку */
.mobile-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(30, 109, 180, 0.15);
    border: none;
    border-radius: 10px;
    color: var(--color-cta-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: var(--spacing-sm);
    font-size: 1.5rem;
}

.mobile-search-btn:hover,
.mobile-search-btn:focus {
    background: rgba(30, 109, 180, 0.25);
    color: var(--color-brand-primary);
}

.mobile-search-btn .search-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Приховування кнопки пошуку при активному режимі */
.mobile-search-btn.search-btn-hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* Контейнер форми мобільного пошуку */
.mobile-search-form-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-md);
}

/* Показ форми пошуку */
.mobile-search-form-container.search-form-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Форма мобільного пошуку */
.mobile-search-form {
    width: 100%;
}

.mobile-search-input-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
}

/* Поле вводу мобільного пошуку */
.mobile-search-input {
    flex: 1;
    border: 2px solid var(--color-cta-primary);
    background: var(--white);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px; /* Запобігання зуму на iOS */
    color: var(--neutral-dark);
    outline: none;
}

.mobile-search-input::placeholder {
    color: var(--gray-medium);
}

/* Кнопки форми пошуку */
.mobile-search-close,
.mobile-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 8px;
}

.mobile-search-close {
    background: var(--white);
    border: 2px solid var(--color-cta-primary);
    color: var(--color-cta-primary);
}

.mobile-search-close:hover,
.mobile-search-close:focus {
    background: rgba(30, 109, 180, 0.1);
}

.mobile-search-submit {
    background: var(--color-cta-primary);
    border: 2px solid var(--color-cta-primary);
    color: var(--white);
}

.mobile-search-submit:hover,
.mobile-search-submit:focus {
    background: var(--color-brand-accent);
    border-color: var(--color-brand-accent);
}

.mobile-search-close svg,
.mobile-search-submit svg {
    width: 18px;
    height: 18px;
}

/* Анімація приховування логотипу */
@media (max-width: 768px) {
    .logo {
        transition: all 0.3s ease;
    }
    
    .logo.logo-hidden {
        opacity: 0;
        transform: translateX(-50px);
        pointer-events: none;
    }
}

/* Режим пошуку для хедера */
@media (max-width: 768px) {
    .header-content {
        position: relative;
        transition: all 0.3s ease;
    }
    
    .header-content.search-mode {
        overflow: hidden;
    }
    
    /* Приховування елементів у режимі пошуку */
    .header-content.search-mode .search-container {
        display: none;
    }
}

/* Покращення для дуже маленьких екранів */
@media (max-width: 375px) {
    .mobile-search-btn .search-icon {
        width: 26px;
        height: 26px;
    }
    
    .mobile-search-input-group {
        padding: 4px;
    }
    
    .mobile-search-input {
        padding: 8px;
        font-size: 16px;
    }
    
    .mobile-search-close,
    .mobile-search-submit {
        width: 32px;
        height: 32px;
    }
    
    .mobile-search-close svg,
    .mobile-search-submit svg {
        width: 16px;
        height: 16px;
    }
}

/* iOS Safari оптимізації */
@supports (-webkit-touch-callout: none) {
    .mobile-search-input {
        -webkit-appearance: none;
        border-radius: 0;
    }
    
    .mobile-search-form-container {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .mobile-search-btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* Accessibility покращення */
@media (prefers-reduced-motion: reduce) {
    .mobile-search-form-container,
    .logo,
    .mobile-search-btn,
    .header-content {
        transition: none;
    }
}

/* Фокус стилі для клавіатурної навігації */
.mobile-search-btn:focus-visible {
    outline: 2px solid var(--color-brand-primary);
    outline-offset: 2px;
}

.mobile-search-input:focus {
    outline: none;
}

.mobile-search-close:focus-visible,
.mobile-search-submit:focus-visible {
    outline: 2px solid var(--color-brand-primary);
    outline-offset: 1px;
}
/* ============================================
   MOBILE BURGER MENU
   Drawer + overlay + burger button
============================================ */

/* Група: іконка бургера + підпис «Каталог» при відкритому меню */
.burger-btn-group {
    display: none;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
}

.burger-btn__catalog-label {
    display: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-brand-accent, #112244);
    line-height: 1;
    white-space: nowrap;
}

.burger-btn-group--open .burger-btn__catalog-label {
    display: block;
}

/* Кнопка бургера — тільки мобільний */
.burger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-primary);
    flex-shrink: 0;
}

/* Overlay */
.burger-drawer__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1199;
}

.burger-drawer__overlay.is-active {
    display: block;
}

/* Drawer */
.burger-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    z-index: 1200;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
}

.burger-drawer[hidden] {
    /* hidden attr ховає елемент, але нам потрібна анімація — перезаписуємо */
    display: flex;
}

.burger-drawer.is-open {
    transform: translateX(0);
}

/* Шапка drawer-а */
.burger-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-bg-secondary, #e0e0e0);
    flex-shrink: 0;
}

.burger-drawer__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-brand-accent, #112244);
}

.burger-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary, #6B6B6B);
    border-radius: 6px;
    transition: background 0.2s;
}

.burger-drawer__close:hover {
    background: var(--color-bg-primary, #EEF5FC);
}

/* Навігація */
.burger-drawer__nav {
    flex: 1;
    padding: 12px 0 24px;
}

/* Пряме посилання (Каталог) */
.burger-drawer__link--primary {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-brand-primary, #1E6DB4);
    text-decoration: none;
    border-bottom: 1px solid var(--color-bg-secondary, #e0e0e0);
    transition: background 0.2s;
}

.burger-drawer__link--primary:hover {
    background: var(--color-bg-primary, #EEF5FC);
}

.burger-drawer__link--primary svg {
    flex-shrink: 0;
    display: block;
}

.burger-drawer__catalog-label {
    line-height: 1;
}

/* Секції */
.burger-drawer__section {
    margin-top: 4px;
    border-bottom: 1px solid var(--color-bg-secondary, #e0e0e0);
}

.burger-drawer__section-label {
    display: block;
    padding: 12px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-gray-700, #616161);
}

.burger-drawer__section-links {
    list-style: none;
    margin: 0;
    padding: 0 0 8px;
}

.burger-drawer__section-links .burger-drawer__link {
    display: block;
    padding: 9px 20px;
    font-size: 14px;
    color: var(--color-text-primary, #2C2C2C);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.burger-drawer__section-links .burger-drawer__link:hover {
    background: var(--color-bg-primary, #EEF5FC);
    color: var(--color-brand-primary, #1E6DB4);
}

/* Блок дій (Вподобання, Порівняння, Корзина) */
.burger-drawer__actions {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
}

.burger-drawer__action-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary, #2C2C2C);
    text-decoration: none;
    position: relative;
    transition: background 0.2s, color 0.2s;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.burger-drawer__action-link.wishlist-link,
.burger-drawer__action-link.compare-link,
.burger-drawer__action-link--cart {
    width: 100%;
    height: auto;
    min-height: 0;
    justify-content: flex-start;
    border-radius: 0;
}

.burger-drawer__action-link:hover {
    background: var(--color-bg-primary, #EEF5FC);
    color: var(--color-brand-primary, #1E6DB4);
}

.burger-drawer__action-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.burger-drawer__action-label {
    flex: 1;
}

/* Бейдж у drawer (використовує глобальні .badge-класи + точкова позиція) */
.burger-drawer__action-link .badge {
    position: static;
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    line-height: 20px;
    border-radius: 10px;
    background: var(--color-brand-primary, #1E6DB4);
    color: #fff;
    font-weight: 700;
    text-align: center;
}

/* ============================================
   RESPONSIVE: показуємо бургер лише на мобільних
============================================ */
@media (max-width: 768px) {
    .burger-btn-group {
        display: flex;
    }

    .burger-btn {
        display: flex;
    }
}
