/* ========================================
   STYLES.CSS - Cocon Aménagement
   Fichier CSS principal externalisé
   ======================================== */

/* === BASE === */
body {
    box-sizing: border-box;
}

/* === BACKGROUNDS === */
.hero-bg {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 50%, #CD853F 100%);
}

.wood-texture {
    background-image: 
        linear-gradient(45deg, #8B4513 25%, transparent 25%), 
        linear-gradient(-45deg, #8B4513 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #8B4513 75%), 
        linear-gradient(-45deg, transparent 75%, #8B4513 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* === ANIMATIONS === */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.photo-clickable {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.photo-clickable:hover {
    transform: scale(1.05);
}

/* === CAROUSEL SLIDES === */
.carousel-slide,
.hero-slide,
.studio-slide,
.yoga-slide,
.sauna-slide,
.extension-slide,
.terrasses-slide,
.pergola-slide,
.carport-slide,
.module-slide {
    display: none;
}

.carousel-slide.active,
.hero-slide.active,
.studio-slide.active,
.yoga-slide.active,
.sauna-slide.active,
.extension-slide.active,
.terrasses-slide.active,
.pergola-slide.active,
.carport-slide.active,
.module-slide.active {
    display: block;
}

/* === DROPDOWN MENU === */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    margin-top: 0.25rem;
    min-width: 16rem;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-size: 0.875rem;
}

.dropdown-menu a:hover {
    background-color: #fef3c7;
    color: #d97706;
}

.dropdown-menu a:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-menu a:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

/* === CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === HEADER === */
header,
nav {
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #1f2937;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-tab {
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f3f4f6;
    color: #374151;
}

.nav-tab.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    color: white;
}

.nav-tab:hover:not(.active) {
    background: #e5e7eb;
}

/* === TAB CONTENT === */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.tab-content.active {
    display: block;
}

/* === HERO SECTION === */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h2 {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 24px;
    margin-top: 0;
}

.hero p {
    font-size: 20px;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-button {
    background: white;
    color: #8b5cf6;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-button:hover {
    background: #f3f4f6;
}

/* === SECTIONS === */
.section {
    padding: 64px 0;
}

.section-title {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 48px;
    color: #1f2937;
}

.section-subtitle {
    color: #6b7280;
    text-align: center;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* === GRIDS === */
.grid {
    display: grid;
    gap: 24px;
}

.grid-categories {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-gallery {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* === CATEGORY CARDS === */
.category-card {
    background: white;
    padding: 32px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.category-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1f2937;
}

.category-card p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* === FILTER BUTTONS === */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}

.filter-button {
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #374151;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 16px;
}

.filter-button.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    color: white;
}

.filter-button:hover:not(.active) {
    background: #f3f4f6;
}

/* === GALLERY === */
.gallery-item {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.gallery-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.gallery-content {
    padding: 16px;
}

.gallery-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.gallery-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.gallery-tag {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
    color: #7c3aed;
    font-size: 12px;
    font-weight: 500;
    border-radius: 50px;
}

.photo-image {
    width: 100%;
    height: 16rem;
    object-fit: cover;
}



/* === MODAL === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    padding: 16px;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    z-index: 10;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.modal-info {
    text-align: center;
    margin-top: 16px;
}

.modal-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-project {
    color: #d1d5db;
}

/* === EMPTY STATES === */
.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 0;
}

.empty-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

.empty-text {
    color: #9ca3af;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .nav {
        flex-direction: column;
        gap: 4px;
    }
    
    .nav-tab {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* === UTILITIES === */
.bg-amber-50 { background-color: #fffbeb; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-amber-200 { background-color: #fde68a; }
.bg-amber-600 { background-color: #d97706; }
.bg-amber-700 { background-color: #b45309; }
.bg-amber-800 { background-color: #92400e; }

.text-amber-600 { color: #d97706; }
.text-amber-700 { color: #b45309; }
.text-amber-800 { color: #92400e; }

.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }

.text-blue-600 { color: #2563eb; }
.text-blue-800 { color: #1e40af; }

.text-purple-600 { color: #9333ea; }

.text-red-600 { color: #dc2626; }

.text-gray-300 { color: #d1d5db; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }

.bg-white { background-color: white; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-900 { background-color: #111827; }

.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

.transition-colors { transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out; }
.transition-all { transition: all 0.15s ease-in-out; }

/* === AJUSTEMENTS SPÉCIFIQUES === */
.border-4 {
    border-width: 4px;
}

.border-amber-200 {
    border-color: #fde68a;
}

.border-amber-400 {
    border-color: #fbbf24;
}

.object-cover {
    object-fit: cover;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.mb-4 {
    margin-bottom: 1rem;
}

.w-32 {
    width: 8rem;
}

.h-32 {
    height: 8rem;
}

.w-60 {
    width: 15rem;
}

.h-60 {
    height: 15rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.font-bold {
    font-weight: 700;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

/* === CAROUSEL NAVIGATION === */
.hero-prev,
.hero-next,
.studio-prev,
.studio-next,
.yoga-prev,
.yoga-next,
.sauna-prev,
.sauna-next,
.extension-prev,
.extension-next,
.terrasses-prev,
.terrasses-next,
.pergola-prev,
.pergola-next,
.carport-prev,
.carport-next,
.module-prev,
.module-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.hero-prev:hover,
.studio-prev:hover,
.yoga-prev:hover,
.sauna-prev:hover,
.extension-prev:hover,
.terrasses-prev:hover,
.pergola-prev:hover,
.carport-prev:hover,
.module-prev:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hero-next:hover,
.studio-next:hover,
.yoga-next:hover,
.sauna-next:hover,
.extension-next:hover,
.terrasses-next:hover,
.pergola-next:hover,
.carport-next:hover,
.module-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hero-prev,
.studio-prev,
.yoga-prev,
.sauna-prev,
.extension-prev,
.terrasses-prev,
.pergola-prev,
.carport-prev,
.module-prev {
    left: 0.5rem;
}

.hero-next,
.studio-next,
.yoga-next,
.sauna-next,
.extension-next,
.terrasses-next,
.pergola-next,
.carport-next,
.module-next {
    right: 0.5rem;
}

/* === CAROUSEL DOTS === */
.hero-dot,
.studio-dot,
.yoga-dot,
.sauna-dot,
.extension-dot,
.terrasses-dot,
.pergola-dot,
.carport-dot,
.module-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-dot:hover,
.studio-dot:hover,
.yoga-dot:hover,
.sauna-dot:hover,
.extension-dot:hover,
.terrasses-dot:hover,
.pergola-dot:hover,
.carport-dot:hover,
.module-dot:hover {
    background: rgba(255, 255, 255, 0.75);
}

.bg-opacity-50 {
    background-color: rgba(255, 255, 255, 0.5);
}

.bg-opacity-60 {
    background-color: rgba(255, 255, 255, 0.6);
}

.bg-opacity-90 {
    background-color: rgba(255, 255, 255, 0.9);
}
/* === LOGO STYLES === */
nav img {
    transition: opacity 0.3s ease;
}

nav img:hover {
    opacity: 0.8;
}

/* Ajustement du logo sur mobile */
@media (max-width: 640px) {
    nav img {
        height: 2.5rem;
    }
}

/* ========================================
   AMÉLIORATIONS MENU MOBILE
   ======================================== */

/* Animation du menu mobile */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
    position: relative;
    z-index: 999;
}

#mobile-menu:not(.hidden) {
    max-height: 100vh;
    overflow-y: auto;
}

/* Sous-menu mobile réalisations */
#mobile-realisations-submenu {
    transition: all 0.3s ease-in-out;
}

/* Icône rotation smooth */
#mobile-realisations-icon {
    transition: transform 0.3s ease;
}

/* Effet tactile sur mobile */
.touch-device a:active,
.touch-device button:active {
    opacity: 0.7;
    transform: scale(0.98);
}

.touch-active {
    background-color: rgba(251, 191, 36, 0.1) !important;
}

/* Amélioration des zones de clic sur mobile */
@media (max-width: 768px) {
    #mobile-menu a,
    #mobile-menu button {
        min-height: 44px; /* Taille recommandée Apple */
        display: flex;
        align-items: center;
    }
    
    /* Menu mobile scroll */
    #mobile-menu {
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Améliorer le contraste sur mobile */
    #mobile-menu a:hover,
    #mobile-menu button:hover {
        background-color: rgba(251, 191, 36, 0.15);
    }
    
    /* Espacement du sous-menu */
    #mobile-realisations-submenu a {
        padding-left: 1.5rem;
        border-left: 2px solid #fbbf24;
    }
}

/* Dropdown desktop - amélioration tactile */
@media (hover: none) and (pointer: coarse) {
    .dropdown:hover .dropdown-menu {
        display: none; /* Désactiver le hover sur tactile */
    }
    
    .dropdown-menu {
        display: none;
    }
    
    .dropdown-menu.show {
        display: block;
    }
}

/* Navigation sticky - ajustement mobile */
@media (max-width: 640px) {
    nav {
        position: sticky;
        top: 0;
        z-index: 50;
    }
    
    /* Logo plus petit sur très petits écrans */
    nav img {
        height: 2.5rem;
    }
    
    /* Bouton hamburger plus grand */
    #mobile-menu-btn {
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Smooth scroll offset pour header sticky */
html {
    scroll-padding-top: 80px;
}

/* Animation d'ouverture du menu mobile */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mobile-menu:not(.hidden) {
    animation: slideDown 0.3s ease-out;
}

/* Amélioration de la lisibilité du menu mobile */
#mobile-menu {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* État actif pour les liens */
#mobile-menu a.active {
    background-color: rgba(251, 191, 36, 0.2);
    color: #d97706;
    border-left: 3px solid #d97706;
}

/* Overlay pour fermer le menu (optionnel) */
.mobile-menu-overlay {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 40;
}

.mobile-menu-overlay.show {
    display: block;
}


/* ========================================
   CORRECTION HEADER STICKY MOBILE
   ======================================== */

/* Forcer le header à rester au-dessus de tout */
nav {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999 !important;
    background: white;
    width: 100%;
}

/* S'assurer que le bouton hamburger est toujours cliquable */
#mobile-menu-btn {
    position: relative;
    z-index: 10000 !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Menu mobile au-dessus de tout le contenu */
#mobile-menu {
    position: relative;
    z-index: 9998 !important;
    background: white;
    width: 100%;
}

/* Éviter les conflits de pointer-events */
nav,
nav *,
#mobile-menu,
#mobile-menu * {
    pointer-events: auto !important;
}

/* Fix pour Safari iOS */
@supports (-webkit-touch-callout: none) {
    nav {
        position: -webkit-sticky;
        position: sticky;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* S'assurer que rien ne passe au-dessus du header */
body > *:not(nav):not(header) {
    position: relative;
    z-index: 1;
}

/* Hamburger toujours accessible */
@media (max-width: 768px) {
    #mobile-menu-btn {
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        padding: 12px;
    }
    
    #mobile-menu-btn svg {
        pointer-events: none;
    }
}
