/* ============================================
   RESPONSIVE DESIGN - COMPLETE OVERHAUL
   ============================================ */

/* ============================================
   BREAKPOINTS
   ============================================
   Mobile: < 640px
   Tablet: 640px - 768px
   Desktop: > 768px
   Large Desktop: > 1024px
   ============================================ */

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

@media (max-width: 768px) {
    body {
        padding-top: 80px !important; /* Compense la hauteur du header fixe sur mobile + marge */
    }
    
    header {
        padding: 0.75rem 1rem !important;
        min-height: 73px;
        height: 73px;
    }
    
    .logo img {
        height: 2.5rem !important;
        max-width: 100%;
    }
    
    nav {
        position: relative;
    }
    
    /* Force l'icône hamburger à être visible sur mobile */
    .mobile-toggle {
        display: block !important;
        font-size: 1.5rem;
        padding: 0.5rem;
        z-index: 1001;
        background: transparent;
        border: none;
        color: #D4AF37;
        cursor: pointer;
    }
    
    .mobile-toggle:hover {
        color: #F1E5AC;
    }
    
    /* Force le menu à être caché par défaut sur mobile */
    .mobile-menu {
        display: none !important; /* Caché par défaut sur mobile - Override Tailwind md:flex */
        position: fixed !important;
        top: 73px;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem 1.5rem;
        gap: 0;
        text-align: left;
        transform: translateX(-100%);
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        border-bottom: 2px solid rgba(212, 175, 55, 0.2);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        max-height: calc(100vh - 73px);
        overflow-y: auto;
        z-index: 1000;
        visibility: hidden;
        opacity: 0;
    }
    
    /* Menu visible quand actif sur mobile */
    .mobile-menu.active {
        display: flex !important; /* Visible quand actif */
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Desktop - Menu visible normalement */
@media (min-width: 768px) {
    .mobile-menu {
        display: flex !important; /* Visible sur desktop */
        position: static !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: transparent !important;
        backdrop-filter: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-bottom: none !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    .mobile-menu.active {
        transform: none !important;
    }
    
    .mobile-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0;
    }
    
    .mobile-menu li:last-child {
        border-bottom: none;
    }
    
    .mobile-menu a {
        display: block;
        width: 100%;
        padding: 1rem 0;
        font-size: 0.9rem;
        color: #ffffff;
        transition: color 0.3s ease;
    }
    
    .mobile-menu a:hover {
        color: #D4AF37;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

@media (max-width: 768px) {
    .hero-adaptive {
        min-height: 60vh !important;
        padding: 5rem 0.75rem 3rem !important; /* Padding-top important pour éviter la superposition */
        margin-top: 0 !important;
    }
    
    .hero-adaptive > div {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        margin-top: 0 !important;
    }
    
    .hero-adaptive .container-narrow {
        padding: 0 0.5rem !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
        margin-top: 0 !important;
    }
    
    .responsive-heading-xl {
        font-size: clamp(1.5rem, 7vw, 2.5rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0 0.25rem;
    }
    
    .hero-adaptive p {
        font-size: 0.875rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-adaptive .flex {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .hero-adaptive a {
        width: 100%;
        padding: 0.875rem 1.5rem !important;
        font-size: 0.875rem !important;
    }
}

@media (max-width: 640px) {
    .hero-adaptive {
        min-height: 50vh !important;
        padding: 5rem 0.5rem 2rem !important;
    }
    
    .hero-adaptive > div {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    .hero-adaptive .container-narrow {
        padding: 0 0.25rem !important;
    }
    
    .responsive-heading-xl {
        font-size: clamp(1.25rem, 8vw, 2rem) !important;
        padding: 0 0.5rem;
    }
}

@media (max-width: 375px) {
    .hero-adaptive {
        padding: 5rem 0.25rem 2rem !important;
    }
    
    .hero-adaptive > div {
        padding-left: 0.125rem !important;
        padding-right: 0.125rem !important;
    }
    
    .hero-adaptive .container-narrow {
        padding: 0 0.125rem !important;
    }
    
    .responsive-heading-xl {
        font-size: clamp(1.125rem, 9vw, 1.75rem) !important;
        padding: 0 0.25rem;
    }
}

/* ============================================
   PHILOSOPHY / TWO COLUMN SECTIONS
   ============================================ */

@media (max-width: 768px) {
    .philosophy-section,
    .flexible-section {
        padding: 3rem 1rem !important;
    }
    
    .philosophy-container-enhanced {
        flex-direction: column !important;
        gap: 2rem !important;
        padding: 0 1rem !important;
    }
    
    .philosophy-image-enhanced {
        flex: 0 0 100% !important;
        width: 100% !important;
        position: relative !important;
        top: auto !important;
        order: 1 !important;
    }
    
    .philosophy-image-enhanced .philosophy-image-glow {
        display: none;
    }
    
    .philosophy-image {
        width: 100% !important;
        height: auto !important;
        max-height: 400px !important;
        object-fit: cover;
        border-radius: 0.5rem;
    }
    
    .philosophy-text-enhanced {
        flex: 0 0 100% !important;
        width: 100% !important;
        order: 2 !important;
    }
    
    .philosophy-text-enhanced.order-2.md\:order-1 {
        order: 2 !important;
    }
    
    .philosophy-text-enhanced.order-1.md\:order-2 {
        order: 2 !important;
    }
    
    .philosophy-image-enhanced.order-1.md\:order-2 {
        order: 1 !important;
    }
    
    .responsive-heading-md {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
        margin-bottom: 1.5rem !important;
    }
    
    .text-container {
        font-size: 0.9375rem;
        line-height: 1.75;
    }
    
    .text-container p {
        margin-bottom: 1rem;
    }
    
    .philosophy-link-wrapper {
        margin-top: 1.5rem;
    }
}

@media (max-width: 640px) {
    .philosophy-section,
    .flexible-section {
        padding: 2rem 0.75rem !important;
    }
    
    .philosophy-container-enhanced {
        gap: 1.5rem !important;
        padding: 0 0.75rem !important;
    }
    
    .philosophy-image {
        max-height: 300px !important;
    }
}

/* ============================================
   CARDS & GRIDS
   ============================================ */

@media (max-width: 768px) {
    .grid-auto-fit {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .card-adaptive {
        padding: 1.5rem !important;
        min-height: auto;
    }
    
    .card-adaptive-content {
        gap: 1rem;
    }
    
    .card-adaptive-text {
        font-size: 0.875rem;
    }
    
    /* Services cards */
    .grid.grid-cols-1.md\:grid-cols-3,
    .grid.grid-cols-1.md\:grid-cols-2,
    .grid.md\:grid-cols-2,
    .grid.md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 640px) {
    .grid-auto-fit {
        gap: 1rem !important;
    }
    
    .card-adaptive {
        padding: 1.25rem !important;
    }
}

/* ============================================
   CONTACT PAGE
   ============================================ */

@media (max-width: 768px) {
    /* Les sections avec pt-* doivent tenir compte du padding-top du body */
    .pt-24,
    .pt-36 {
        padding-top: 2rem !important; /* Réduit car body a déjà padding-top */
    }
    
    .pb-10,
    .pb-20 {
        padding-bottom: 2rem !important;
    }
    
    .px-4,
    .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Hero section - doit avoir un padding-top suffisant pour éviter la superposition */
    .hero-adaptive {
        padding-top: 5rem !important; /* Espace suffisant après le header (73px + marge) */
        margin-top: 0 !important;
    }
    
    /* S'assurer que le contenu ne se superpose pas */
    section:first-of-type,
    .hero-adaptive:first-of-type {
        margin-top: 0 !important;
        padding-top: 5rem !important; /* Espace suffisant après le header de 73px */
    }
    
    /* Le contenu de la section hero doit commencer après le header */
    .hero-adaptive > div {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    /* S'assurer que le titre n'est pas coupé */
    .hero-adaptive h1,
    .hero-adaptive .responsive-heading-xl {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Contact page grid */
    .grid.grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .md\:col-span-1,
    .md\:col-span-2 {
        grid-column: span 1 !important;
    }
    
    /* Contact info */
    .md\:col-span-1 {
        text-align: center !important;
    }
    
    .md\:col-span-1 .flex {
        justify-content: center !important;
    }
    
    /* Form */
    .md\:col-span-2 {
        padding: 1.5rem !important;
    }
    
    form .grid.md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Success/Error messages */
    #success-message,
    #error-message {
        padding: 1.25rem !important;
        font-size: 0.875rem;
    }
    
    #success-message .w-12,
    #error-message .w-12 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    #success-message .text-xl,
    #error-message .text-xl {
        font-size: 1.125rem !important;
    }
}

@media (max-width: 640px) {
    .px-4,
    .px-6 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    form .space-y-6 > * {
        margin-bottom: 1rem;
    }
    
    input,
    textarea,
    select {
        padding: 0.75rem !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* ============================================
   RESERVATION PAGE
   ============================================ */

@media (max-width: 768px) {
    /* Session cards */
    .grid.grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Card image height */
    .h-64 {
        height: 200px !important;
    }
    
    /* Card padding */
    .p-8 {
        padding: 1.5rem !important;
    }
    
    /* Subscription cards */
    .grid.grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Subscription card content */
    .text-5xl {
        font-size: 2.5rem !important;
    }
    
    .text-4xl {
        font-size: 2rem !important;
    }
    
    .text-3xl {
        font-size: 1.75rem !important;
    }
    
    /* Info section */
    .grid.md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* CTA button */
    .py-4.px-12 {
        padding: 0.875rem 2rem !important;
        font-size: 0.875rem !important;
    }
}

@media (max-width: 640px) {
    .h-64 {
        height: 180px !important;
    }
    
    .p-8 {
        padding: 1.25rem !important;
    }
    
    .text-5xl {
        font-size: 2rem !important;
    }
    
    .text-4xl {
        font-size: 1.75rem !important;
    }
    
    .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .text-2xl {
        font-size: 1.25rem !important;
    }
}

/* ============================================
   ABOUT PAGE
   ============================================ */

@media (max-width: 768px) {
    /* Hero section on about page */
    section.hero-adaptive[style*="min-height: 60vh"] {
        min-height: 50vh !important;
        padding: 5rem 1rem 2rem !important;
    }
    
    .subtitle {
        font-size: 0.875rem !important;
    }
    
    /* Section spacing */
    .mb-12,
    .mb-16 {
        margin-bottom: 2rem !important;
    }
    
    /* CTA section */
    .container-narrow {
        padding: 0 1rem;
    }
    
    .container-narrow .flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .container-narrow a {
        width: 100%;
    }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

@media (max-width: 768px) {
    h1 {
        font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
    }
    
    h2 {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
        margin-bottom: 1.5rem !important;
    }
    
    h3 {
        font-size: clamp(1.25rem, 5vw, 1.5rem) !important;
    }
    
    .text-5xl {
        font-size: clamp(2rem, 8vw, 2.5rem) !important;
    }
    
    .text-4xl {
        font-size: clamp(1.75rem, 7vw, 2rem) !important;
    }
    
    .text-3xl {
        font-size: clamp(1.5rem, 6vw, 1.75rem) !important;
    }
    
    .text-2xl {
        font-size: clamp(1.25rem, 5vw, 1.5rem) !important;
    }
    
    .text-xl {
        font-size: clamp(1.125rem, 4vw, 1.25rem) !important;
    }
    
    .text-lg {
        font-size: 1rem !important;
    }
    
    .text-base {
        font-size: 0.9375rem !important;
    }
    
    .text-sm {
        font-size: 0.875rem !important;
    }
    
    .text-xs {
        font-size: 0.75rem !important;
    }
}

/* ============================================
   BUTTONS & LINKS
   ============================================ */

@media (max-width: 768px) {
    .flex.gap-4 {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .flex.gap-4 a,
    .flex.gap-4 button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    a[class*="bg-amber"],
    button[class*="bg-amber"],
    a[class*="bg-white"],
    button[class*="bg-white"] {
        width: 100%;
        display: block;
        text-align: center;
    }
    
    .rounded-full {
        border-radius: 0.5rem !important;
    }
}

/* ============================================
   CONTAINERS & SPACING
   ============================================ */

@media (max-width: 768px) {
    .container,
    .container-wide,
    .container-narrow,
    .container-full {
        padding-left: 1rem;
        padding-right: 1rem;
        max-width: 100%;
    }
    
    .max-w-2xl,
    .max-w-3xl,
    .max-w-4xl,
    .max-w-6xl,
    .max-w-7xl {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .pt-36 {
        padding-top: 5rem !important;
    }
    
    .pt-32 {
        padding-top: 4.5rem !important;
    }
    
    .pt-24 {
        padding-top: 4rem !important;
    }
    
    .mb-16 {
        margin-bottom: 3rem !important;
    }
    
    .mb-12 {
        margin-bottom: 2rem !important;
    }
    
    .mb-8 {
        margin-bottom: 1.5rem !important;
    }
}

@media (max-width: 640px) {
    .container,
    .container-wide,
    .container-narrow,
    .container-full {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .max-w-2xl,
    .max-w-3xl,
    .max-w-4xl,
    .max-w-6xl,
    .max-w-7xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .px-4,
    .px-6 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* ============================================
   FORMS
   ============================================ */

@media (max-width: 768px) {
    form .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="date"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 0.875rem !important;
        width: 100%;
    }
    
    label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    button[type="submit"] {
        width: 100%;
        padding: 0.875rem !important;
        font-size: 0.875rem !important;
    }
}

/* ============================================
   FOOTER
   ============================================ */

@media (max-width: 768px) {
    footer {
        padding: 2rem 1rem !important;
        font-size: 0.875rem;
    }
    
    footer .space-x-4 {
        display: flex;
        flex-direction: row;
        gap: 1.5rem;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    footer a {
        display: inline-block;
        padding: 0.5rem 0;
        text-align: center;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

@media (max-width: 768px) {
    /* Hide on mobile */
    .hidden-mobile {
        display: none !important;
    }
    
    /* Show on mobile */
    .show-mobile {
        display: block !important;
    }
    
    /* Text alignment */
    .text-center {
        text-align: center !important;
    }
    
    /* Flex direction */
    .flex {
        flex-wrap: wrap;
    }
    
    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Overflow */
    .overflow-hidden {
        overflow: hidden;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
    }
}

/* ============================================
   TABLET SPECIFIC (640px - 768px)
   ============================================ */

@media (min-width: 640px) and (max-width: 768px) {
    .grid-auto-fit {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .grid.grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .philosophy-container-enhanced {
        gap: 2.5rem !important;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */

@media (max-width: 768px) and (orientation: landscape) {
    .hero-adaptive {
        min-height: 70vh !important;
        padding: 4rem 1rem 2rem !important;
    }
    
    header {
        padding: 0.5rem 1rem !important;
        min-height: 60px;
    }
    
    .logo img {
        height: 2rem !important;
    }
    
    .mobile-menu {
        top: 60px;
        max-height: calc(100vh - 60px);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    header,
    footer,
    .mobile-toggle,
    .mobile-menu {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .hero-adaptive,
    .flexible-section {
        page-break-inside: avoid;
    }
}
