/* Responsive Styles */

/* Tablet */
@media (max-width: 768px) {
    .main-header,
    .home-page .main-header {
        position: static !important;
        top: auto !important;
    }

    .container {
        padding: 0 14px;
    }

    .header-top {
        padding: 8px 0;
    }

    .header-top-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
        flex-wrap: wrap;
    }

    .logo-image {
        max-height: 86px;
        width: auto;
        max-width: 92%;
        margin: 0 auto;
    }

    .header-logo-banner {
        padding: 8px 0;
    }

    .logo-text {
        font-size: 32px;
    }

    .nav-content {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 10px;
        padding: 10px 0;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .nav-menu {
        order: 3;
        width: 100%;
        grid-column: 1 / -1;
    }
    
    .nav-search {
        order: 1;
        grid-column: 1 / -1;
        width: 100%;
        margin: 0;
        max-width: 100%;
        flex: 1 1 auto;
    }

    .nav-cart {
        order: 0;
        justify-self: start;
    }

    .search-input {
        font-size: 16px;
        min-height: 44px;
    }

    .search-btn {
        min-height: 44px;
        padding: 10px 14px;
    }
    
    .mega-menu {
        position: static !important;
        left: auto;
        right: auto;
        width: 100%;
    }

    /* Always show simple mobile nav links */
    .nav-menu-list {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        gap: 0;
        overflow: hidden;
        border: 1px solid #e7ebf0;
        border-radius: 8px;
        background: #fff;
    }

    .nav-menu-list > li {
        width: 100%;
        border-bottom: 1px solid #e9ecef;
    }

    .nav-menu-list > li:last-child {
        border-bottom: 0;
    }

    .nav-menu-list > li > a {
        padding: 13px 14px;
        display: block;
        font-size: 15px;
    }

    /* Hide desktop mega/dropdowns on mobile for clarity */
    .has-mega-menu .mega-menu,
    .has-dropdown .dropdown-menu {
        display: none !important;
    }
    
    .hero-content h1 {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .logo-image {
        max-height: 60px;
        max-width: 88%;
    }

    .header-logo-banner {
        padding: 6px 0;
    }

    .logo-text {
        font-size: 26px;
    }

    .site-logo-background img {
        width: 130vw;
        opacity: 0.17;
        filter: blur(8px);
    }

    .header-top-content {
        gap: 6px;
    }
    
    .nav-content {
        gap: 8px;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }

    .nav-menu-list {
        display: flex !important;
    }
    
    .nav-menu-list > li {
        width: 100%;
        border-bottom: 1px solid #e9ecef;
    }
    
    .nav-menu-list > li > a {
        padding: 15px 20px;
        display: block;
    }
    
    .mega-menu,
    .has-dropdown .dropdown-menu {
        display: none !important;
    }
    
    .hero-content h1 {
        font-size: 28px;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 12px;
    }
}

/* iPhone Safari stability + small-screen comfort */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-text-size-adjust: 100%;
    }

    .main-content {
        min-height: 100svh;
    }

    .hero-section,
    .products-page,
    .admin-dashboard {
        overflow-x: clip;
    }
}

@media (max-width: 390px) {
    .search-input,
    .search-btn {
        min-height: 42px;
    }

    .header-actions a,
    .header-action-button {
        font-size: 13px;
    }

    .hero-content h1 {
        font-size: 24px;
        line-height: 1.25;
    }

    .hero-subtitle {
        font-size: 14px;
    }
}
