/* ============================================
   RESPONSIVE CSS - ABDESAMIECAR
   Breakpoints cohérents pour Mobile, Tablette et Desktop
   ============================================ */

/* ============================================
   BREAKPOINTS STANDARDS
   ============================================
   Mobile:     320px - 480px   (phones portrait)
   Mobile L:   481px - 640px   (phones landscape, small tablets)
   Tablette:   641px - 768px   (tablets portrait)
   Tablette L: 769px - 1024px  (tablets landscape, small laptops)
   Desktop:    1025px - 1280px (laptops, desktops)
   Desktop L:  1281px+         (large desktops)
   ============================================ */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    --primary-color: #9f211b;
    --primary-dark: #7a1a15;
    --primary-light: #c42d26;
    --text-color: #333;
    --text-light: #666;
    --bg-white: #ffffff;
    --bg-gray: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* ============================================
   BASE RESPONSIVE
   ============================================ */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   CONTAINER RESPONSIVE
   ============================================ */
.site-container {
    width: 100%;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ============================================
   NAVIGATION RESPONSIVE
   ============================================ */

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .site-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Navbar */
    #navbar {
        padding: 0.5rem 0 !important;
        background-color: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }

    #navbar .site-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    #navbar .site-container > div {
        padding: 0.5rem 0 !important;
    }

    #navbar .logo img,
    #navbar img[alt*="logo"] {
        height: 3rem !important;
        max-height: 3rem !important;
        width: auto !important;
    }

    /* Mobile menu button */
    #menuToggle {
        padding: 0.5rem !important;
        font-size: 1.125rem !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 0.5rem !important;
        background-color: transparent !important;
        color: #1f2937 !important;
    }

    #menuToggle:hover,
    #menuToggle:focus {
        background-color: rgba(0, 0, 0, 0.05) !important;
        color: #111827 !important;
    }

    /* Desktop menu - toujours caché sur mobile */
    .desktop-menu {
        display: none !important;
    }

    /* Right side actions desktop - caché sur mobile */
    #navbar .hidden.md\\:flex {
        display: none !important;
    }

    /* Mobile header buttons (MAD, FR) */
    .mobile-header-btn {
        color: #1f2937 !important;
        font-size: 0.875rem !important;
        font-weight: 500 !important;
        padding: 0.375rem 0.5rem !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }

    .mobile-header-btn:hover {
        color: #111827 !important;
        background-color: rgba(0, 0, 0, 0.03) !important;
    }

    .mobile-header-btn svg {
        width: 12px !important;
        height: 12px !important;
        margin-left: 0.25rem !important;
    }

    /* Mobile menu sidebar (left side) */
    .mobile-menu-sidebar {
        width: 320px;
        max-width: 85vw;
    }

    .mobile-menu-overlay {
        display: block;
    }

    .mobile-menu-sidebar nav a {
        padding: 0.875rem 1rem !important;
        font-size: 0.9375rem !important;
        min-height: 48px;
    }

    /* Fix navbar positioning */
    #navbar.fixed {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }
}

    /* Hero Section Mobile Fixes */
    .hero-section {
        min-height: auto !important;
        padding: 2rem 0.75rem !important;
        -mt-[70px] !important;
    }

    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }

    .hero-title span {
        display: block;
        line-height: 1.2;
    }

    .hero-description {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.5rem !important;
    }

    /* Search Form Mobile Fixes */
    .search-form,
    form[action*="search"] {
        padding: 1rem !important;
        margin: 1rem 0 !important;
    }

    form[action*="search"] .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    form[action*="search"] label {
        font-size: 0.8125rem !important;
        margin-bottom: 0.5rem !important;
    }

    form[action*="search"] label .w-7,
    form[action*="search"] label .w-8 {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    form[action*="search"] input[type="date"],
    form[action*="search"] input[type="time"] {
        padding: 0.75rem !important;
        font-size: 0.875rem !important;
        min-height: 44px;
    }

    form[action*="search"] button[type="submit"] {
        width: 100% !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 0.875rem !important;
        min-height: 44px;
        margin-top: 0.5rem;
    }

    /* Hero Buttons Mobile */
    .hero-buttons,
    .flex.flex-col.sm\\:flex-row {
        flex-direction: column !important;
        width: 100%;
        gap: 0.75rem !important;
    }

    .hero-buttons a,
    .hero-buttons button,
    .flex.flex-col.sm\\:flex-row a {
        width: 100% !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 0.875rem !important;
        min-height: 44px;
        text-align: center;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }

    * {
        max-width: 100%;
    }

    /* Fix for images */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Mobile Landscape & Small Tablets (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .site-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Navbar */
    #navbar {
        background-color: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
    }

    #navbar .site-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    #navbar .logo img,
    #navbar img[alt*="logo"] {
        height: 3.5rem !important;
    }

    #menuToggle {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    .mobile-menu nav a {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    /* Hero Section */
    .hero-section {
        min-height: 70vh;
        padding: 3rem 1rem;
    }

    .hero-title {
        font-size: 2rem !important;
    }

    .hero-description {
        font-size: 1rem !important;
    }

    /* Search Form */
    form[action*="search"] .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    form[action*="search"] button[type="submit"] {
        grid-column: 1 / -1;
    }

    /* Hero Buttons */
    .hero-buttons,
    .flex.flex-col.sm\\:flex-row {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 1rem !important;
    }

    .hero-buttons a,
    .flex.flex-col.sm\\:flex-row a {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
    }
}

/* Tablets (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .site-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    #navbar {
        padding: 0.75rem 0;
    }

    #navbar .logo img {
        height: 4rem;
    }

    .desktop-menu {
        gap: 1rem !important;
    }

    .desktop-menu a {
        font-size: 0.875rem !important;
        padding: 0.5rem 0.75rem;
    }
}

/* Tablets Landscape & Small Laptops (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .site-container {
        padding-left: 2rem;
        padding-right: 2rem;
        max-width: 1024px;
    }

    #navbar {
        padding: 1rem 0;
    }

    .desktop-menu {
        gap: 1.25rem !important;
    }

    .desktop-menu a {
        font-size: 0.9375rem !important;
    }

    .language-btn,
    .auth-btn,
    .auth-btn-filled {
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
    }
}

/* Desktop (1025px - 1280px) */
@media (min-width: 1025px) and (max-width: 1280px) {
    .site-container {
        max-width: 1200px;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .desktop-menu {
        gap: 1.5rem !important;
    }

    .desktop-menu a {
        font-size: 1rem !important;
    }
}

/* Large Desktop (1281px+) */
@media (min-width: 1281px) {
    .site-container {
        max-width: 1400px;
        padding-left: 3rem;
        padding-right: 3rem;
    }

    .desktop-menu {
        gap: 2rem !important;
    }
}

/* ============================================
   HERO SECTION RESPONSIVE
   ============================================ */

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .hero-section {
        min-height: auto !important;
        padding: 2rem 0.75rem !important;
    }

    .hero-title {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }

    .hero-description {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.5rem !important;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .hero-buttons a,
    .hero-buttons button {
        width: 100%;
        padding: 0.875rem 1.5rem !important;
        font-size: 0.875rem !important;
        min-height: 44px;
    }
}

/* Mobile Landscape (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .hero-section {
        min-height: 70vh;
        padding: 3rem 1rem;
    }

    .hero-title {
        font-size: 1.75rem !important;
    }

    .hero-description {
        font-size: 1rem !important;
    }

    .hero-buttons {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .hero-buttons a,
    .hero-buttons button {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
    }
}

/* Tablets (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .hero-section {
        min-height: 75vh;
        padding: 4rem 1.5rem;
    }

    .hero-title {
        font-size: 2rem !important;
    }

    .hero-description {
        font-size: 1.125rem !important;
    }
}

/* Tablets Landscape (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-section {
        min-height: 80vh;
        padding: 5rem 2rem;
    }

    .hero-title {
        font-size: 2.5rem !important;
    }

    .hero-description {
        font-size: 1.25rem !important;
    }
}

/* ============================================
   SEARCH FORM RESPONSIVE
   ============================================ */

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .search-form {
        padding: 1rem !important;
        margin: 1rem 0;
    }

    .search-form .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .search-form input,
    .search-form select {
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
        min-height: 44px;
    }

    .search-form button {
        width: 100%;
        padding: 0.875rem 1.5rem !important;
        font-size: 0.875rem !important;
        min-height: 44px;
        margin-top: 0.5rem;
    }
}

/* Mobile Landscape (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .search-form {
        padding: 1.25rem !important;
    }

    .search-form .form-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .search-form button {
        grid-column: 1 / -1;
    }
}

/* Tablets (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .search-form {
        padding: 1.5rem !important;
    }

    .search-form .form-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
}

/* Tablets Landscape (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .search-form {
        padding: 2rem !important;
    }

    .search-form .form-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.25rem !important;
    }
}

/* ============================================
   CARDS RESPONSIVE
   ============================================ */

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .car-card,
    .service-card,
    .process-card {
        margin-bottom: 1.5rem;
        padding: 1rem !important;
    }

    .car-card img {
        height: 180px !important;
        object-fit: cover;
    }

    .car-card h3 {
        font-size: 1.125rem !important;
    }

    .car-card p {
        font-size: 0.875rem !important;
    }

    .car-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* Mobile Landscape (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .car-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }

    .car-card img {
        height: 200px;
    }
}

/* Tablets (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .car-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }

    .car-card img {
        height: 220px;
    }
}

/* Tablets Landscape (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .car-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
    }
}

/* Desktop (1025px+) */
@media (min-width: 1025px) {
    .car-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 2rem !important;
    }
}

/* ============================================
   FOOTER RESPONSIVE
   ============================================ */

/* Mobile (≤480px) */
@media (max-width: 480px) {
    footer {
        padding: 2rem 0.75rem !important;
    }

    footer .grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    footer h4 {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }

    footer ul {
        font-size: 0.875rem !important;
    }

    footer ul li {
        margin-bottom: 0.5rem !important;
    }

    footer .logo img {
        height: 3rem !important;
    }
}

/* Tablets (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    footer .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
}

/* Tablets Landscape (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    footer .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Desktop (1025px+) */
@media (min-width: 1025px) {
    footer .grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ============================================
   BUTTONS RESPONSIVE
   ============================================ */

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .auth-btn,
    .auth-btn-filled,
    .language-btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
        min-width: auto !important;
        min-height: 44px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.875rem !important;
        min-height: 44px;
        width: 100%;
    }
}

/* Mobile Landscape (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .auth-btn,
    .auth-btn-filled {
        padding: 0.625rem 1rem !important;
        font-size: 0.8125rem !important;
    }
}

/* Tablets (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .auth-btn,
    .auth-btn-filled {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.875rem !important;
    }
}

/* ============================================
   FLOATING BUTTONS RESPONSIVE
   ============================================ */

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .back-to-top-btn {
        right: 0.875rem !important;
        bottom: 5.5rem !important;
        width: 2.75rem !important;
        height: 2.75rem !important;
        font-size: 0.875rem !important;
    }

    .whatsapp-float {
        right: 0.875rem !important;
        bottom: 1.25rem !important;
        width: 3.25rem !important;
        height: 3.25rem !important;
    }

}

/* Mobile Landscape (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .back-to-top-btn {
        bottom: 6rem;
        width: 3rem;
        height: 3rem;
    }

    .whatsapp-float {
        bottom: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
    }

}

/* Tablets (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .back-to-top-btn {
        bottom: 6.5rem;
    }

    .whatsapp-float {
        bottom: 1.5rem;
    }

}

/* ============================================
   FORMS RESPONSIVE
   ============================================ */

/* Mobile (≤480px) */
@media (max-width: 480px) {
    form input,
    form select,
    form textarea {
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
        min-height: 44px;
    }

    form label {
        font-size: 0.875rem !important;
        margin-bottom: 0.5rem !important;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* Tablets (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on tablet and below */
@media (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block !important;
    }
}

/* Show only on tablet */
.show-tablet {
    display: none !important;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .show-tablet {
        display: block !important;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto !important;
        padding: 2rem 0 !important;
    }

    .hero-title {
        font-size: 1.5rem !important;
    }

    .hero-description {
        font-size: 0.875rem !important;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects */
    .car-card:hover,
    .service-card:hover,
    .process-card:hover {
        transform: none;
    }

    /* Better tap feedback */
    button:active,
    a:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .back-to-top-btn,
    .whatsapp-float,
    .mobile-menu,
    #menuToggle {
        display: none !important;
    }
}

