/**
 * RESPONSIVE MOBILE GLOBAL
 * Corrections complètes pour mobile (smartphone & tablette)
 */

/* ============================================
   BREAKPOINTS STANDARDS
   ============================================ */
/* 
   - Mobile portrait: < 480px
   - Mobile landscape: 480px - 767px
   - Tablette: 768px - 1024px
   - Desktop: > 1024px
*/

/* ============================================
   HEADER & NAVIGATION - MOBILE
   ============================================ */
@media (max-width: 1024px) {
    /* Header mobile */
    .header {
        position: sticky !important;
    }
    
    .navbar {
        height: 60px !important;
        gap: 1rem !important;
    }
    
    /* Logo plus petit */
    .logo-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }
    
    .logo-text {
        font-size: 1rem !important;
    }
    
    .logo-slogan {
        font-size: 0.55rem !important;
    }
    
    /* Navigation mobile */
    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch !important;
        padding: 1rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 9999;
    }
    
    .nav-links.active {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start !important;
        padding: 0.875rem 1rem !important;
        font-size: 0.95rem !important;
    }
    
    .nav-link i {
        font-size: 1rem !important;
        width: 24px;
    }
    
    /* Menu hamburger visible */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
        z-index: 10000;
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 24px;
        height: 3px;
        background: #1e40af;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translateY(8px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(-8px);
    }
    
    /* Dropdowns en mobile */
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between !important;
        padding: 0.875rem 1rem !important;
    }
    
    .nav-dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        background: #f8fafc !important;
        border-radius: 8px !important;
        margin-top: 0.5rem !important;
        display: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    .nav-dropdown.open .nav-dropdown-menu {
        display: block !important;
        max-height: 600px !important;
        overflow-y: auto !important;
    }
    
    /* Bouton Mon Espace en mobile */
    .nav-link-highlight {
        width: 100%;
        justify-content: center !important;
        margin: 0.5rem 0 !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .navbar {
        height: 56px !important;
    }
    
    .nav-links {
        top: 56px;
        padding: 0.75rem;
    }
    
    .logo-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }
    
    .logo-text {
        font-size: 0.9rem !important;
    }
    
    .logo-slogan {
        font-size: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    .navbar {
        height: 52px !important;
        gap: 0.5rem !important;
    }
    
    .nav-links {
        top: 52px;
        padding: 0.5rem;
    }
    
    .logo-content {
        gap: 0;
    }
    
    .logo-text {
        font-size: 0.85rem !important;
    }
    
    .logo-slogan {
        display: none;
    }
}

/* ============================================
   MENU TEASER "MON ESPACE" - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .mon-espace-teaser-menu {
        min-width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0.5rem !important;
        transform: none !important;
        border-radius: 12px !important;
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
    }
    
    .teaser-header {
        padding: 16px 18px !important;
    }
    
    .teaser-header h3 {
        font-size: 15px !important;
        line-height: 1.3 !important;
        margin-bottom: 6px !important;
    }
    
    .teaser-header p {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }
    
    .teaser-divider {
        margin: 10px 0 !important;
    }
    
    .teaser-item {
        padding: 12px 16px !important;
        gap: 14px !important;
        min-height: auto !important;
    }
    
    .teaser-item:hover {
        padding-left: 20px !important;
    }
    
    /* Icônes des items teaser */
    .teaser-item > i:first-child {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        font-size: 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f1f5f9 !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
    }
    
    /* Container du texte */
    .teaser-item > div {
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }
    
    .nav-dropdown-title {
        font-size: 14px !important;
        line-height: 1.3 !important;
        font-weight: 600 !important;
    }
    
    .nav-dropdown-desc {
        font-size: 12px !important;
        line-height: 1.4 !important;
        margin-top: 0 !important;
    }
    
    /* Lock icon */
    .teaser-lock {
        font-size: 14px !important;
        flex-shrink: 0 !important;
    }
    
    /* Featured item */
    .featured-item {
        padding: 12px 16px !important;
    }
    
    .featured-item::before {
        font-size: 14px !important;
        left: -2px !important;
    }
    
    .nav-dropdown-cta {
        font-size: 14px !important;
        padding: 14px 16px !important;
        margin: 12px 14px !important;
        border-radius: 8px !important;
    }
    
    .nav-dropdown-cta i {
        font-size: 16px !important;
    }
    
    .teaser-footer {
        font-size: 12px !important;
        padding: 12px 16px !important;
        line-height: 1.4 !important;
    }
    
    .teaser-footer i {
        font-size: 12px !important;
    }
    
    .badge-free,
    .badge-new,
    .badge-feature {
        font-size: 9px !important;
        padding: 3px 7px !important;
        margin-left: 5px !important;
    }
}

@media (max-width: 480px) {
    .mon-espace-teaser-menu {
        margin: 0.25rem !important;
    }
    
    .teaser-header {
        padding: 10px 12px !important;
    }
    
    .teaser-header h3 {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }
    
    .teaser-header p {
        font-size: 9px !important;
    }
    
    .teaser-item {
        padding: 7px 10px !important;
        gap: 8px !important;
    }
    
    .teaser-item:hover {
        padding-left: 14px !important;
    }
    
    .teaser-item > i:first-child {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        font-size: 13px !important;
    }
    
    .nav-dropdown-title {
        font-size: 11px !important;
    }
    
    .nav-dropdown-desc {
        font-size: 9px !important;
    }
    
    .nav-dropdown-cta {
        font-size: 11px !important;
        padding: 9px 10px !important;
        margin: 6px 8px !important;
    }
    
    .teaser-footer {
        padding: 7px 10px !important;
        font-size: 9px !important;
    }
    
    .badge-free,
    .badge-new,
    .badge-feature {
        font-size: 6px !important;
        padding: 2px 4px !important;
    }
}

/* ============================================
   BOUTONS FLOTTANTS - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .floating-buttons-group {
        bottom: 15px !important;
        right: 15px !important;
        gap: 10px !important;
    }
    
    .floating-action-btn {
        width: 52px !important;
        height: 52px !important;
        box-shadow: 0 3px 15px rgba(0, 0, 0, 0.25) !important;
    }
    
    .floating-action-btn i {
        font-size: 20px !important;
    }
    
    /* Masquer les tooltips sur mobile */
    .btn-tooltip {
        display: none !important;
    }
    
    .btn-badge {
        top: -3px !important;
        right: -3px !important;
        font-size: 8px !important;
        padding: 2px 5px !important;
    }
}

@media (max-width: 480px) {
    .floating-buttons-group {
        bottom: 12px !important;
        right: 12px !important;
        gap: 8px !important;
    }
    
    .floating-action-btn {
        width: 48px !important;
        height: 48px !important;
    }
    
    .floating-action-btn i {
        font-size: 18px !important;
    }
    
    .btn-badge {
        font-size: 7px !important;
        padding: 2px 4px !important;
    }
}

/* ============================================
   FOOTER - MOBILE
   ============================================ */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2.5rem 2rem !important;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 3rem 0 1.5rem !important;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2.5rem 1.5rem !important;
    }
    
    .footer-section {
        text-align: left;
    }
    
    .footer-section h4 {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .footer-links {
        justify-content: flex-start;
    }
    
    .footer-links li {
        margin-bottom: 0.75rem;
    }
    
    .footer-links a {
        font-size: 0.9rem !important;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding-top: 2rem !important;
        margin-top: 2rem !important;
    }
    
    .footer-bottom p {
        font-size: 0.85rem !important;
    }
    
    /* Logo section responsive */
    .footer-section .logo {
        margin-bottom: 1rem;
    }
    
    .footer-section .logo-icon {
        width: 40px !important;
        height: 40px !important;
    }
    
    .footer-section .logo-text {
        font-size: 1.1rem !important;
    }
    
    .footer-section .logo-slogan {
        font-size: 0.75rem !important;
    }
    
    .footer-description {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 2.5rem 0 1rem !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section h4 {
        font-size: 0.95rem !important;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .footer-links li {
        margin-bottom: 0.65rem;
    }
    
    .footer-links a {
        font-size: 0.85rem !important;
    }
    
    .footer-bottom {
        padding-top: 1.5rem !important;
        margin-top: 1.5rem !important;
    }
    
    .footer-bottom p {
        font-size: 0.8rem !important;
    }
    
    /* Logo centré sur mobile */
    .footer-section .logo {
        justify-content: center;
    }
    
    .footer-description {
        font-size: 0.85rem !important;
        text-align: center;
    }
    
    /* Badges empilés sur mobile */
    .footer-section > div[style*="display: flex"] {
        justify-content: center !important;
    }
}

@media (max-width: 360px) {
    .footer-section h4 {
        font-size: 0.9rem !important;
    }
    
    .footer-links a {
        font-size: 0.8rem !important;
    }
    
    .footer-bottom p {
        font-size: 0.75rem !important;
    }
}

/* ============================================
   HERO SECTION - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem !important;
        min-height: auto !important;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
    
    .hero-description {
        font-size: 0.9rem !important;
    }
    
    .search-box {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .search-input {
        width: 100% !important;
    }
    
    .search-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
    }
}

/* ============================================
   STATS CARDS - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
    }
    
    .stat-card {
        padding: 1rem !important;
    }
    
    .stat-value {
        font-size: 1.75rem !important;
    }
    
    .stat-label {
        font-size: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
}

/* ============================================
   CARDS & GRIDS - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .cards-grid,
    .offers-grid,
    .news-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .card {
        padding: 1rem !important;
    }
    
    .card-title {
        font-size: 1rem !important;
    }
    
    .card-description {
        font-size: 0.875rem !important;
    }
}

/* ============================================
   FORMS & INPUTS - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .form-group {
        width: 100% !important;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px !important; /* Évite le zoom automatique sur iOS */
    }
    
    .btn {
        width: 100% !important;
        padding: 0.875rem 1.25rem !important;
    }
}

/* ============================================
   MODALS - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .modal-content,
    .modal-content-simple {
        margin: 1rem !important;
        padding: 1.5rem !important;
        max-width: calc(100% - 2rem) !important;
        border-radius: 12px !important;
    }
    
    .modal-header h2,
    .modal-header h3 {
        font-size: 1.25rem !important;
    }
    
    .modal-body {
        padding: 1rem 0 !important;
    }
    
    .modal-footer {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .modal-footer .btn {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .modal-content,
    .modal-content-simple {
        margin: 0.75rem !important;
        padding: 1.25rem !important;
    }
}

/* ============================================
   TABLES - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    table {
        min-width: 600px !important;
    }
    
    th, td {
        padding: 0.5rem !important;
        font-size: 0.875rem !important;
    }
}

/* ============================================
   BADGES & TAGS - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .badge,
    .tag {
        font-size: 0.7rem !important;
        padding: 3px 8px !important;
    }
}

/* ============================================
   SPACING UTILITIES - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .section {
        padding: 2rem 0 !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
    }
    
    .section-subtitle {
        font-size: 1rem !important;
    }
    
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 1.5rem 0 !important;
    }
    
    .section-title {
        font-size: 1.25rem !important;
    }
    
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* ============================================
   CHAT & FEEDBACK - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .chatbot-container {
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    
    .feedback-modal {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
    }
}

/* ============================================
   PROFILE & DASHBOARD - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1rem !important;
    }
    
    .profile-avatar {
        width: 80px !important;
        height: 80px !important;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .dashboard-card {
        padding: 1rem !important;
    }
}

/* ============================================
   SEARCH FILTERS - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .filters-container {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .filter-item {
        width: 100% !important;
    }
    
    .filter-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ============================================
   BREADCRUMB - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .breadcrumb {
        font-size: 0.75rem !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ============================================
   FIXES SPÉCIFIQUES iOS
   ============================================ */
@supports (-webkit-touch-callout: none) {
    /* iPhone/iPad safe areas */
    .header {
        padding-top: env(safe-area-inset-top) !important;
    }
    
    .floating-buttons-group {
        bottom: calc(15px + env(safe-area-inset-bottom)) !important;
    }
    
    /* Éviter le zoom sur les inputs */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ============================================
   FIXES SCROLLING MOBILE
   ============================================ */
body {
    -webkit-overflow-scrolling: touch;
}

/* Empêcher le scroll horizontal */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ============================================
   TOUCH FEEDBACK
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Améliorer les zones de touch */
    
    
    /* Retour tactile visuel */
    button:active,
    a:active,
    .btn:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* ============================================
   LANDSCAPE MODE MOBILE
   ============================================ */
@media (max-width: 767px) and (orientation: landscape) {
    .header {
        height: 48px !important;
    }
    
    .navbar {
        height: 48px !important;
    }
    
    .nav-links {
        top: 48px !important;
        max-height: calc(100vh - 48px) !important;
    }
    
    .floating-buttons-group {
        bottom: 10px !important;
        right: 10px !important;
        gap: 6px !important;
    }
    
    .floating-action-btn {
        width: 44px !important;
        height: 44px !important;
    }
}

/* ============================================
   PRINT MODE
   ============================================ */
@media print {
    .header,
    .footer,
    .floating-buttons-group,
    .nav-links,
    .mobile-menu-toggle {
        display: none !important;
    }
}
