/**
 * NexoPack - Mobile Specific Styles
 * Aggressive mobile-first approach for guaranteed mobile compatibility
 */

/* ===== Force Mobile Menu Button Visibility ===== */
@media screen and (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        padding: 8px !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        z-index: 1002 !important;
        position: relative !important;
    }

    .mobile-menu-btn span {
        width: 24px !important;
        height: 2px !important;
        background: var(--gray-700, #424242) !important;
        display: block !important;
        transition: all 0.3s ease !important;
    }

    /* Desktop navigation hidden on mobile */
    .nav-main {
        display: none !important;
    }

    /* Header adjustments */
    .header {
        height: 70px !important;
    }

    .header-container {
        gap: 8px !important;
    }

    .logo {
        gap: 8px !important;
    }

    .logo-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.125rem !important;
    }

    .logo-text {
        font-size: 1.125rem !important;
    }

    .header-actions {
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }

    .header-actions .btn {
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
    }

    .header-actions .btn-ghost {
        display: none !important;
    }

    .lang-selector {
        padding: 4px 8px !important;
        gap: 2px !important;
    }

    .lang-selector a {
        font-size: 0.75rem !important;
        padding: 2px 4px !important;
    }
}

/* ===== Extra Small Mobile (480px and below) ===== */
@media screen and (max-width: 480px) {
    .header {
        height: 60px !important;
    }

    .logo-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    .logo-text {
        font-size: 1rem !important;
    }

    .header-actions {
        gap: 4px !important;
    }

    .header-actions .btn-primary.btn-sm {
        padding: 8px !important;
        font-size: 0 !important;
    }

    .header-actions .btn-primary.btn-sm::before {
        content: '🛒' !important;
        font-size: 1rem !important;
    }

    .lang-selector {
        padding: 4px 6px !important;
    }

    .lang-selector a {
        font-size: 11px !important;
        padding: 2px 4px !important;
    }
}

/* ===== Mobile Navigation Enhanced ===== */
@media screen and (max-width: 768px) {
    .mobile-nav {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 280px !important;
        height: 100vh !important;
        background: white !important;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1) !important;
        z-index: 1001 !important;
        transition: right 0.3s ease !important;
        overflow-y: auto !important;
    }

    .mobile-nav.active {
        right: 0 !important;
    }

    .mobile-nav-content {
        padding: calc(70px + 1rem) 1.5rem 1.5rem !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.25rem !important;
    }

    .mobile-nav-content a {
        padding: 1rem !important;
        font-size: 1rem !important;
        font-weight: 500 !important;
        color: var(--gray-700, #424242) !important;
        border-radius: 8px !important;
        transition: all 0.15s ease !important;
        display: block !important;
    }

    .mobile-nav-content a:hover {
        background: var(--gray-100, #f5f5f5) !important;
        color: var(--primary, #0F2A47) !important;
    }

    .mobile-nav-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 999 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease !important;
    }

    .mobile-nav-backdrop.active {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

/* ===== Touch-Friendly Elements ===== */
@media screen and (max-width: 768px) {
    .btn {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 16px !important;
    }

    .btn-sm {
        min-height: 36px !important;
        min-width: 36px !important;
    }

    /* Forms */
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px !important;
        /* Prevents zoom on iOS */
        min-height: 44px !important;
        padding: 12px !important;
    }

    /* Links */
    a {
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
    }
}

/* ===== Responsive Grids ===== */
@media screen and (max-width: 768px) {
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

@media screen and (max-width: 480px) {

    .benefits-grid,
    .categories-grid,
    .products-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Hero Section Mobile ===== */
@media screen and (max-width: 768px) {
    .hero {
        min-height: auto !important;
        padding: calc(70px + 3rem) 0 3rem !important;
    }

    .hero-title {
        font-size: 2.25rem !important;
    }

    .hero-subtitle {
        font-size: 1.125rem !important;
    }

    .hero-stats {
        flex-wrap: wrap !important;
        gap: 1.5rem !important;
    }

    .hero-buttons {
        flex-direction: column !important;
    }

    .hero-buttons .btn {
        width: 100% !important;
    }
}

/* ===== Content Sections Mobile ===== */
@media screen and (max-width: 768px) {
    .page-header {
        padding: calc(70px + 3rem) 0 3rem !important;
    }

    .page-title {
        font-size: 1.875rem !important;
    }

    .section-title {
        font-size: 1.5rem !important;
    }

    .cta-box {
        padding: 2.5rem !important;
    }
}

/* ===== Tables Mobile (Horizontal Scroll) ===== */
@media screen and (max-width: 768px) {
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    table {
        min-width: 600px !important;
    }
}

/* ===== Prevent Horizontal Scroll ===== */
@media screen and (max-width: 768px) {
    body {
        overflow-x: hidden !important;
    }

    .container {
        padding: 0 1rem !important;
        max-width: 100% !important;
    }

    img {
        max-width: 100% !important;
        height: auto !important;
    }
}