/* Mobile & WAP Optimizations */

/* Touch targets - minimum 44px */
@media (max-width: 768px) {
    /* Ensure touch targets are large enough */
    .btn-primary,
    .btn-outline,
    .btn-whatsapp,
    .btn-contact,
    .btn-inquiry,
    .btn-detail,
    .read-more,
    .bottom-message-toggle,
    .whatsapp-btn,
    .back-to-top {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Navigation */
    .mobile-menu-brand {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 0 0 16px;
        margin: 0 0 8px;
        border-bottom: 1px solid var(--border);
    }

    .mobile-menu-logo {
        display: inline-flex;
        align-items: center;
        order: 1;
        flex-shrink: 0;
        max-width: 70%;
    }

    .mobile-menu-logo img {
        display: block;
        max-width: 180px;
        max-height: 46px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .mobile-menu-title {
        order: 2;
        color: var(--primary);
        font-size: 20px;
        font-weight: 700;
        line-height: 1.2;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .main-navigation .nav-menu li a {
        padding: 15px 0;
        font-size: 16px;
    }

    .main-navigation .nav-menu > li > .mega-menu-panel {
        position: static;
        width: auto;
        min-width: 0;
        max-width: none;
        min-height: 0;
        padding: 0 0 0 20px !important;
        overflow: visible;
        box-shadow: none;
        border-radius: 0;
    }

    .mega-menu-panel::before,
    .mega-menu-panel::after,
    .menu-item-preview {
        display: none !important;
    }

    .mega-menu-list {
        position: static;
        min-width: 0;
        width: auto;
        max-width: none;
        max-height: none;
        overflow-y: visible;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .mega-menu-list > li > a {
        padding: 12px 0;
    }

    .mega-menu-list > li > a {
        width: auto;
        min-height: 44px;
        margin: 0;
        padding: 12px 0;
    }

    .menu-item-thumb {
        display: block;
    }
    
    /* Form inputs */
    .contact-form input,
    .contact-form textarea,
    .inquiry-form input,
    .search-form input {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 14px 15px;
    }
    
    /* Product cards */
    .product-card h3 {
        font-size: 14px;
    }

    /* Product specs on mobile */
    .product-specs {
        font-size: 12px;
    }

    .product-specs li em {
        min-width: 70px;
    }

    /* Featured products on products page */
    .featured-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .featured-item img {
        height: 120px;
    }

    .featured-item h3 {
        font-size: 13px;
    }

    .featured-promo {
        font-size: 11px;
        padding: 6px 8px;
    }
    
    /* Blog cards */
    .blog-content h3 {
        font-size: 16px;
    }
    
    /* Section titles */
    .section-title {
        font-size: 24px;
    }
    
    /* Hero banner */
    .banner-placeholder h2 {
        font-size: 28px;
    }

    .hero-banner-actions {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        justify-content: flex-start;
        max-width: none;
        overflow-x: auto;
        padding: 8px;
        border-radius: 999px;
        scrollbar-width: none;
    }

    .hero-banner-actions::-webkit-scrollbar {
        display: none;
    }

    .banner-action-item {
        min-height: 38px;
        padding: 9px 15px;
        font-size: 13px;
    }

    .banner-slide-action.position-bottom-left,
    .banner-slide-action.position-middle-left {
        left: calc(18px + var(--banner-button-offset-x, 0px));
    }

    .banner-slide-action.position-bottom-right,
    .banner-slide-action.position-middle-right {
        right: calc(18px + var(--banner-button-offset-x, 0px));
    }

    .banner-slide-action.position-bottom-left,
    .banner-slide-action.position-bottom-center,
    .banner-slide-action.position-bottom-right {
        bottom: calc(24px + var(--banner-button-offset-y, 0px));
    }

    .hide-banner-actions-mobile .hero-banner-actions,
    .hide-banner-actions-mobile .banner-slide-action {
        display: none;
    }
    
    /* Footer */
    .footer-col h4 {
        font-size: 16px;
    }
    
    /* Bottom message widget */
    .bottom-message-widget {
        right: 8px;
        width: min(336px, calc(100vw - 76px));
    }

    .bottom-message-panel {
        padding: 16px 10px 10px;
    }

    .bottom-message-form {
        gap: 10px;
    }
    
    /* WhatsApp float */
    .whatsapp-float {
        bottom: 74px !important;
        right: 12px !important;
    }
    
    .whatsapp-float .whatsapp-btn {
        width: 55px;
        height: 55px;
    }
    
    /* Back to top */
    .back-to-top {
        bottom: 85px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    /* Cookie notice */
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    /* Product detail */
    .product-detail {
        gap: 20px;
    }
    
    .product-detail-info h1 {
        font-size: 22px;
    }
    
    /* Contact layout */
    .contact-layout {
        gap: 30px;
    }

    /* Catalog download */
    .catalog-download-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .catalog-download-info {
        padding: 18px;
    }

    .catalog-download-modal {
        padding: 14px;
    }
}

/* Small phones */
@media (max-width: 375px) {
    .header-container {
        padding: 0 15px;
    }
    
    .logo img {
        height: 40px;
    }
    
    .site-title {
        font-size: 20px;
    }
    
    .hero-banner .swiper {
        height: 250px;
    }
    
    .advantages-grid {
        gap: 15px;
    }
    
    .advantage-item {
        padding: 15px 10px;
    }
    
    .advantage-icon {
        width: 40px;
        height: 40px;
    }
    
    .advantage-item h3 {
        font-size: 12px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .error-code {
        font-size: 80px;
    }
    
    .error-title {
        font-size: 24px;
    }

    .catalog-download-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .advantages-grid {
        gap: 20px;
    }
    
    .advantage-item {
        padding: 15px;
    }
    
    .product-card img {
        height: 200px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-banner .swiper {
        height: 250px;
    }
    
    .page-banner {
        height: 200px;
    }
    
    .error-404 {
        min-height: auto;
        padding: 60px 0;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .bottom-message-widget,
    .whatsapp-float,
    .back-to-top,
    .sidebar-contact,
    .inquiry-modal,
    .cookie-notice,
    .page-transition,
    .top-progress {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
    }
    
    a {
        text-decoration: underline;
    }
    
    .container {
        max-width: 100%;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --text: #000;
        --text-light: #333;
        --border: #000;
    }
    
    .btn-primary,
    .btn-outline {
        border: 2px solid currentColor;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .swiper-wrapper {
        transition: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Optional: enable if dark mode is desired */
    /*
    :root {
        --text: #e0e0e0;
        --text-light: #b0b0b0;
        --bg: #1a1a1a;
        --bg-light: #2a2a2a;
        --border: #404040;
    }
    
    .site-header,
    .sub-menu,
    .modal-content {
        background: #2a2a2a;
    }
    */
}
