/* =========================================
   RESPONSIVE DESIGN - PROFESSIONAL MOBILE
   ========================================= */

/* Tablet and Below */
@media (max-width: 768px) {

    /* Global overflow fix */
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Container adjustments */
    .container {
        width: 100%;
        padding: 3rem 1.25rem;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Stack hero buttons vertically on mobile */
    .hero-buttons {
        flex-direction: column !important;
        align-items: center;
        gap: 0.75rem;
    }

    .hero-buttons .btn {
        width: auto;
        max-width: 280px;
        padding: 12px 24px;
        font-size: 0.9rem;
        text-align: center;
    }

    .nav-container {
        padding: 0.75rem 1.25rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        position: static !important;
        transform: none !important;
    }

    .nav-right {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .hamburger {
        display: block !important;
        order: 1;
        font-size: 1.5rem;
        position: static !important;
        z-index: 1002;
    }

    .lang-dropdown {
        display: block !important;
    }

    /* Mobile Language Dropdown (next to hamburger) */
    .mobile-lang-dropdown {
        display: block !important;
        order: 0;
        margin-right: 0.5rem;
    }

    .mobile-lang-dropdown .lang-btn {
        padding: 6px 10px !important;
        font-size: 0.85rem !important;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 0.35rem;
        color: var(--secondary);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-lang-dropdown .lang-btn:hover {
        background: #e2e8f0;
        border-color: #cbd5e1;
    }

    .mobile-lang-dropdown .lang-btn i {
        font-size: 0.9rem;
    }

    .mobile-lang-dropdown .lang-menu {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        bottom: auto !important;
        right: 0 !important;
        left: auto !important;
        width: 140px !important;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1003;
        padding: 0.5rem 0;

        /* Hidden by default, toggled via JS */
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.2s ease;
        display: block !important;
        /* Ensure it's not display:none from other rules, visibility handles hiding */
    }

    /* Disable hover effect for mobile dropdown - rely ONLY on .active class */
    .mobile-lang-dropdown:hover .lang-menu {
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
    }

    .mobile-lang-dropdown.active .lang-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }

    .mobile-lang-dropdown .lang-option {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.85rem !important;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .mobile-lang-dropdown .lang-option:hover {
        background: #f8fafc;
    }

    .mobile-lang-dropdown .lang-option span {
        font-size: 1rem !important;
    }

    .lang-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        left: auto;
        height: 100vh;
        width: 100%;
        max-width: 100%;
        background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 0;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
        transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        z-index: 1001;
        overflow-y: auto;
        gap: 0;
    }

    .nav-links.active {
        right: 0;
        left: auto;
        touch-action: pan-y;
    }

    .sidebar-header {
        display: flex !important;
        width: 100%;
        padding: 2rem 1.5rem;
        justify-content: space-between;
        align-items: center;
        background: #f8f9fa;
        border-bottom: 2px solid #e9ecef;
        margin-bottom: 0.5rem !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .close-menu {
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--secondary);
    }

    .nav-links li {
        width: 100%;
        margin-bottom: 0;
        text-align: left;
        border-bottom: 1px solid #f8f9fa;
    }

    /* Language dropdown in sidebar integration - HIDDEN on mobile (use header dropdown instead) */
    .nav-links .lang-dropdown {
        display: none !important;
    }





    .nav-links li a {
        font-size: 1.05rem !important;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1.25rem 1.5rem;
        color: var(--secondary);
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        border-left: 3px solid transparent;
    }

    /* Fixed logo size for mobile across all pages */
    .logo img {
        height: 22px !important;
    }

    .nav-links li a i {
        width: 22px;
        text-align: center;
        color: var(--primary);
        font-size: 1.1rem;
        transition: transform 0.3s ease;
    }

    .nav-links li a:hover i,
    .nav-links li a.active i {
        transform: scale(1.15);
    }

    .nav-links li a:hover,
    .nav-links li a.active {
        background: linear-gradient(90deg, rgba(230, 48, 46, 0.03) 0%, transparent 100%);
        color: var(--primary);
        border-left-color: var(--primary);
        padding-left: 1.75rem;
    }

    .nav-cta-desktop {
        padding: 1.5rem 1.25rem !important;
        margin-top: 0 !important;
        border-top: 2px solid #e9ecef;
        background: #f8f9fa;
    }

    .nav-cta-desktop .btn {
        width: 100%;
        padding: 1rem !important;
        font-weight: 700;
        letter-spacing: 0.5px;
        font-size: 1rem !important;
        box-shadow: 0 4px 12px rgba(230, 48, 46, 0.2);
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .nav-cta-desktop .btn:active {
        transform: scale(0.97);
        box-shadow: 0 2px 8px rgba(230, 48, 46, 0.3);
    }

    .lang-dropdown {
        margin: 1.5rem 1.25rem !important;
        display: block !important;
    }

    .lang-btn {
        padding: 8px 16px !important;
        font-size: 0.9rem !important;
        border-radius: 30px !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
    }

    .lang-menu {
        width: 150px !important;
        position: absolute !important;
        top: auto !important;
        bottom: 110% !important;
        left: 0 !important;
        right: auto !important;
    }

    .nav-links.active {
        right: 0;
    }


    .hamburger {
        display: block;
        position: relative;
        z-index: 1002;
    }

    /* Hero Section */
    .hero {
        padding: 5rem 1.25rem 3rem;
        min-height: auto;
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero h1 {
        font-size: 2rem !important;
        line-height: 1.3;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-content {
        padding-right: 0 !important;
        padding-left: 0 !important;
        text-align: center !important;
    }

    .hero-image {
        margin-top: 2rem;
    }

    .hero-truck-image {
        max-width: 85%;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.75rem;
        padding: 0 0.5rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
        margin-bottom: 2rem;
    }

    /* Cards Grid - Force Single Column */
    [style*="grid-template-columns: repeat(auto-fit, minmax(280px"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    [style*="grid-template-columns: repeat(auto-fit, minmax(200px"] {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    /* Cards */
    .card-premium {
        padding: 1.5rem 1.25rem;
        margin: 0;
    }

    .card-premium h3 {
        font-size: 1.1rem;
    }

    .card-premium p {
        font-size: 0.9rem;
    }

    .card-premium i:not(.fa-location-dot):not(.fa-chevron-down) {
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
    }

    .card-premium .fa-location-dot {
        font-size: 1rem !important;
        margin-bottom: 0 !important;
    }

    /* Solutions Section */
    #solutions {
        padding: 3rem 0 !important;
    }

    .solution-card {
        padding: 1.5rem !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
    }

    .solution-card i {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.25rem !important;
    }

    /* Coverage Section */
    #coverage {
        padding: 3rem 1.25rem;
    }

    .toggle-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .view-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .wilaya-item {
        padding: 10px 12px !important;
        margin-bottom: 0.5rem;
    }

    .wilaya-item div[style*="margin-bottom: 1rem"] {
        margin-bottom: 0.5rem !important;
    }

    .wilaya-item h3 {
        font-size: 0.95rem !important;
        margin: 0 !important;
    }

    .wilaya-item span {
        font-size: 0.8rem !important;
        opacity: 0.8;
    }

    .wilaya-item p {
        font-size: 0.75rem !important;
        margin-bottom: 4px !important;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .wilaya-item p i {
        font-size: 0.85rem !important;
        width: 14px !important;
        height: 14px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .wilaya-item p[style*="margin-bottom: 1.5rem"] {
        margin-bottom: 10px !important;
    }

    .wilaya-item .btn {
        padding: 6px 4px !important;
        font-size: 0.7rem !important;
        border-radius: 20px !important;
        height: 32px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .solutions-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Coverage Table */
    .table-responsive,
    #coverage-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #coverage-table table {
        min-width: 500px;
    }

    #coverage-table th,
    #coverage-table td {
        padding: 0.6rem 0.4rem !important;
        font-size: 0.75rem !important;
    }

    #coverage-table .btn {
        padding: 4px 6px !important;
        font-size: 0.65rem !important;
        white-space: nowrap !important;
    }

    .table-actions-flex {
        gap: 0.25rem !important;
    }

    /* Stats Section */
    .stats-counter {
        padding: 3rem 0;
        margin: 2rem 0;
    }

    .stat-item {
        padding: 1.5rem 1rem;
        text-align: center;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* CTA Section */
    section[style*="background: linear-gradient(135deg, #E6302E"] {
        margin: 2rem 1rem 4rem 1rem !important;
        padding: 2.5rem 1.25rem !important;
        border-radius: 16px !important;
        max-width: calc(100% - 2rem) !important;
    }

    section[style*="background: linear-gradient(135deg, #E6302E"] h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    section[style*="background: linear-gradient(135deg, #E6302E"] p {
        font-size: 1rem !important;
    }

    section[style*="background: linear-gradient(135deg, #E6302E"] .btn {
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }

    /* Footer */
    footer {
        padding: 3rem 0 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        padding: 0 1.25rem;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section h4 {
        justify-content: center;
    }

    .footer-section ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .company-info {
        align-items: center;
    }

    .info-item {
        justify-content: center;
        text-align: center;
    }

    .cert-badges {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.5rem 1rem;
    }

    .cert-badge {
        width: 100%;
        justify-content: center;
    }

    .socials {
        justify-content: center;
    }

    .footer-bottom {
        padding: 1.5rem 1rem;
        text-align: center;
    }

    .footer-bottom p {
        font-size: 0.8rem;
        line-height: 1.6;
    }
}

/* Mobile Only (Small Phones) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem !important;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .container {
        padding: 2.5rem 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
    }

    /* Stats - 2x2 grid on small phones */
    [style*="grid-template-columns: repeat(auto-fit, minmax(200px"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    .stat-item {
        padding: 1.25rem 0.75rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    /* CTA Section */
    section[style*="background: linear-gradient(135deg, #E6302E"] {
        margin: 1.5rem 0.75rem 3rem 0.75rem !important;
        padding: 2rem 1rem !important;
    }

    section[style*="background: linear-gradient(135deg, #E6302E"] h2 {
        font-size: 1.35rem !important;
    }

    /* Cards */
    .card-premium {
        padding: 1.25rem 1rem;
    }

    .card-premium h3 {
        font-size: 1rem;
    }

    /* Coverage Cards Compact */
    .wilaya-item {
        padding: 8px 10px !important;
    }

    .wilaya-item h3 {
        font-size: 0.85rem !important;
    }

    .wilaya-item span {
        font-size: 0.75rem !important;
    }

    .wilaya-item p {
        font-size: 0.7rem !important;
        margin-bottom: 2px !important;
    }

    .wilaya-item .btn {
        padding: 4px 6px !important;
        font-size: 0.65rem !important;
        height: 28px !important;
    }

    /* Form elements */
    .form-control {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    /* Toggle buttons */
    .toggle-container {
        gap: 0.4rem;
    }

    .view-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Custom select mobile adjustments */
    .select-trigger {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* Extra Small Devices */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.5rem !important;
    }

    .section-title {
        font-size: 1.35rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .card-premium {
        padding: 1rem 0.75rem;
    }
}