/* ------------------------------------- */
/* style.css - Qanila (version complète et corrigée) */
/* ------------------------------------- */

/* ==================== 1. VARIABLES ET RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --text: #0f172a;
    --text-light: #475569;
    --background: #f8fafd;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
}

/* Ajustements pour les zones sécurisées des PWA */
@media all and (display-mode: fullscreen) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    .header {
        padding-top: calc(0.75rem + env(safe-area-inset-top));
    }
}
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* ==================== 2. HEADER ==================== */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.5rem 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.date {
    font-size: 0.8rem;
    background: rgba(37, 99, 235, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    color: var(--primary);
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.hamburger {
    font-size: 1.8rem;
    color: #334155;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    cursor: pointer;
    padding: 0.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.hamburger:hover {
    background: var(--white);
    color: var(--primary);
    border-color: var(--primary);
}

/* ==================== 3. MENU OVERLAY ==================== */
.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    padding: 5rem 1.5rem 2rem;
    transition: right 0.3s ease;
    z-index: 1000;
}
.nav-menu.active {
    right: 0;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: #1e293b;
    font-weight: 500;
    font-size: 1.2rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    display: block;
}
.nav-link:hover {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.nav-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 0.5rem;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 999;
    display: none;
}
.overlay.active {
    display: block;
}

/* ==================== 4. TITRES DE SECTION ==================== */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 2rem 0 1.2rem;
    text-align: center;
    background: linear-gradient(135deg, #1e293b, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    padding-bottom: 1rem;
}
.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #a855f7);
    border-radius: 2px;
}

/* ==================== 5. CARROUSEL ==================== */
.carousel-section {
    margin: 1.5rem 0;
    width: 100%;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    width: 100%;
    height: 250px;
}
.carousel-track {
    display: flex;
    transition: transform 0.4s ease;
    height: 100%;
}
.carousel-slide {
    flex: 0 0 100%;
    position: relative;
    height: 100%;
    overflow: hidden;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    object-position: center;
}
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    color: white;
    padding: 2rem 1rem;
}
.slide-overlay h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.slide-overlay p {
    font-size: 0.9rem;
    max-width: 300px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-size: 1.2rem;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}
.carousel-btn:hover {
    background: var(--primary);
    color: var(--white);
}
.carousel-btn.prev {
    left: 10px;
}
.carousel-btn.next {
    right: 10px;
}
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1rem;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 30px;
    background: var(--gray-300);
    transition: all 0.2s;
    cursor: pointer;
}
.dot.active {
    width: 24px;
    background: var(--primary);
}

/* ==================== 6. CARTES BOUTIQUES (sans overlay) ==================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 20px -6px rgba(0,0,0,0.05);
    border: 1px solid #eef2f6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 25px -8px rgba(37,99,235,0.15);
    border-color: #b9d3ff;
}

.card-image-link {
    display: block;
    width: 100%;
    text-decoration: none;
}
.card-image-container {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
}
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.card-image-link:hover .card-image {
    transform: scale(1.05);
}

.card-content {
    padding: 0.8rem 0.5rem 0.5rem;
    text-align: center;
}
.card-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.card-content p {
    color: #475569;
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
}
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
}
.tag {
    background: #f1f5f9;
    color: #334155;
    font-size: 0.6rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 30px;
}

/* ==================== 7. SERVICES ==================== */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin: 1.5rem 0 3rem;
}
.single-service {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.service-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}
.service-card:hover {
    background: #f1f5fe;
    border-color: var(--primary);
    transform: scale(1.02);
}
.service-icon {
    background: #eef2ff;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--primary);
    flex-shrink: 0;
}
.service-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.service-content p {
    color: #5f6c84;
    font-size: 0.85rem;
}

/* ==================== 8. CONTACT RAPIDE ==================== */
.quick-contact {
    text-align: center;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}
.quick-contact h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.quick-contact p {
    margin-bottom: 1rem;
    opacity: 0.9;
}
.whatsapp-btn-large {
    background: #25D366;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    transition: background 0.2s;
    border: 2px solid white;
}
.whatsapp-btn-large:hover {
    background: #128C7E;
}

/* ==================== 9. FOOTER ==================== */
.footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-title {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}
.footer-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary);
}
.footer-text {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.footer-contact p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.footer-contact a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-contact a:hover {
    color: var(--primary);
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: 0.8rem;
}
.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--primary);
}
.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.social-links a {
    background: #334155;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.2rem;
    transition: all 0.2s;
    text-decoration: none;
}
.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}
.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}
.footer-legal-links {
    margin-top: 0.5rem;
}
.footer-legal-links a {
    color: #94a3b8;
    text-decoration: none;
    margin: 0 0.3rem;
}
.footer-legal-links a:hover {
    color: var(--primary);
}

/* ==================== 10. MODALES ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalFade 0.3s;
}
.modal-lg {
    max-width: 700px;
}
@keyframes modalFade {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
    line-height: 1;
    padding: 0.5rem;
}
.modal-close:hover {
    color: var(--primary);
}
.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #0f172a;
    padding-right: 2rem;
}
.contact-info {
    margin-bottom: 1.5rem;
}
.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
    color: #334155;
}
.contact-item i {
    width: 24px;
    color: var(--primary);
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 0.2rem;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.form-group label {
    font-weight: 500;
    color: #334155;
    font-size: 0.9rem;
}
.form-group input,
.form-group textarea {
    padding: 0.8rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}
.submit-btn:hover {
    background: var(--primary-dark);
}
.contact-direct {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}
.whatsapp-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: background 0.2s;
    margin-top: 0.5rem;
}
.whatsapp-btn:hover {
    background: #128C7E;
}
.service-modal-content {
    text-align: center;
}
.service-modal-content i {
    font-size: 3rem;
    color: var(--primary);
    background: #eef2ff;
    padding: 1rem;
    border-radius: 60px;
    margin-bottom: 1rem;
}
.legal-content {
    color: #334155;
}
.legal-content h3 {
    font-size: 1.2rem;
    margin: 1.2rem 0 0.5rem;
    color: var(--text);
}
.legal-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Bouton fermer en bas des modales */
.modal-footer {
    margin-top: 2rem;
    text-align: center;
}
.modal-close-bottom {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    padding: 0.75rem 1.5rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    min-width: 120px;
}
.modal-close-bottom:hover,
.modal-close-bottom:focus {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-2px);
}

/* ==================== 11. BOUTON INSTALLATION PWA ==================== */
.install-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 60px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 20px -5px rgba(37,99,235,0.4);
    cursor: pointer;
    z-index: 1000;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: 2px solid white;
}
.install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 25px -5px rgba(37,99,235,0.6);
}

/* ==================== 12. MEDIA QUERIES ==================== */

/* Tablettes (600px et plus) */
@media (min-width: 600px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .carousel-container {
        height: 300px;
    }
}

/* Desktop (768px et plus) */
@media (min-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .carousel-container {
        height: 400px;
    }
}

/* Grands écrans (1024px et plus) */
@media (min-width: 1024px) {
    .cards-grid {
        gap: 1.5rem;
    }
    .card-content h3 {
        font-size: 1.2rem;
    }
    .card-content p {
        font-size: 0.9rem;
    }
    .logo-img {
        height: 48px;
    }
    .carousel-container {
        height: 450px;
    }
}

/* Très grands écrans (1280px et plus) */
@media (min-width: 1280px) {
    .carousel-container {
        height: 500px;
    }
}

/* Très petits écrans (moins de 360px) */
@media (max-width: 359px) {
    .card-content h3 {
        font-size: 0.9rem;
    }
    .tag {
        font-size: 0.55rem;
    }
    .quick-contact {
        padding: 1.5rem;
    }
    .quick-contact h3 {
        font-size: 1.2rem;
    }
    .whatsapp-btn-large {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    .logo-img {
        height: 35px;
    }
    .date {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    .carousel-container {
        height: 180px;
    }
}

/* Mode paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .carousel-container {
        height: 200px;
    }
    .modal-content {
        max-height: 80vh;
    }
}

/* Version mobile : modale plein écran */
@media (max-width: 768px) {
    .modal {
        padding: 0;
        align-items: stretch;
    }
    .modal-content {
        max-width: none;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
        padding: 2rem 1.5rem;
        overflow-y: auto;
    }
    .modal-lg {
        max-width: none;
    }
    .modal-close-bottom {
        width: 100%;
        padding: 0.9rem;
        font-size: 1.1rem;
    }
}