/* ============================================
   La Lueur du Seuil — Responsive & Mobile
   Menu burger + adaptations mobile/tablette
   Ne modifie PAS le rendu desktop (>1024px)
   ============================================ */

/* ============================================================
   BREAKPOINTS :
   - Tablette large  : max-width 1024px
   - Tablette        : max-width 768px
   - Mobile          : max-width 480px
   - Petit mobile    : max-width 360px
   ============================================================ */


/* ============================================================
   MOBILE MENU — FULLSCREEN OVERLAY (remplace le drawer latéral)
   Actif sur tablette + mobile (≤1024px)
   ============================================================ */

@media (max-width: 1024px) {

  /* --- Hamburger : toujours visible --- */
  .hamburger {
    display: flex !important;
    position: relative;
    z-index: 1002;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
  }

  .hamburger span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--brown);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform-origin: center;
  }

  /* Inner pages dark theme — barres claires */
  body.inner-page .hamburger span {
    background: var(--cream);
  }

  body.inner-page[data-theme="light"] .hamburger span {
    background: var(--brown);
  }

  /* Animation croix */
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Quand menu ouvert, forcer les barres en cream (car fond sombre) */
  .hamburger.active span {
    background: var(--cream) !important;
  }

  /* --- Menu fullscreen overlay --- */
  .nav-links {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(26, 20, 16, 0.97) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 5rem 2rem 3rem !important;
    z-index: 1000 !important;
    box-shadow: none !important;
    border: none !important;
    border-left: none !important;

    /* Caché par défaut */
    opacity: 0;
    visibility: hidden;
    transform: scale(1.02);
    transition:
      opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      visibility 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  /* Menu ouvert */
  .nav-links.open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
    right: auto !important;
  }

  /* Chaque lien dans le menu mobile */
  .nav-links li {
    width: 100%;
    max-width: 320px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity 0.35s ease,
      transform 0.35s ease;
  }

  /* Animation stagger quand menu ouvert */
  .nav-links.open li {
    opacity: 1;
    transform: translateY(0);
  }

  .nav-links.open li:nth-child(1) { transition-delay: 0.06s; }
  .nav-links.open li:nth-child(2) { transition-delay: 0.12s; }
  .nav-links.open li:nth-child(3) { transition-delay: 0.18s; }
  .nav-links.open li:nth-child(4) { transition-delay: 0.24s; }
  .nav-links.open li:nth-child(5) { transition-delay: 0.30s; }
  .nav-links.open li:nth-child(6) { transition-delay: 0.36s; }
  .nav-links.open li:nth-child(7) { transition-delay: 0.42s; }
  .nav-links.open li:nth-child(8) { transition-delay: 0.48s; }

  .nav-links a {
    display: block;
    font-size: 1rem !important;
    font-family: var(--font-heading);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(253, 248, 240, 0.85) !important;
    padding: 0.9rem 0 !important;
    transition: color 0.3s ease;
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--gold-light) !important;
  }

  .nav-links a::after {
    background: var(--gold-light) !important;
    bottom: 4px !important;
  }

  /* Social icons dans le menu mobile */
  .nav-links .nav-social-icon {
    padding: 0.8rem !important;
    color: rgba(253, 248, 240, 0.5) !important;
  }

  .nav-links .nav-social-icon:hover {
    color: var(--gold-light) !important;
  }

  /* Separator décoratif avant les icônes sociales */
  .nav-links li:nth-last-child(2) {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(201, 168, 76, 0.15);
  }

  /* Icônes sociales côte à côte */
  .nav-links li:nth-last-child(-n+2) {
    display: inline-flex;
    width: auto;
    max-width: none;
  }

  /* Overlay sombre : on le cache car on utilise le fullscreen */
  .nav-overlay {
    display: none !important;
  }

  /* Theme toggle : masqué sur mobile pour libérer de l'espace */
  .theme-toggle {
    display: none !important;
  }
}


/* ============================================================
   TABLETTE LARGE — max 1024px
   ============================================================ */

@media (max-width: 1024px) {

  /* --- Afficher la navbar sur la home (pour le burger) --- */
  body.home-page .navbar {
    display: block !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 1000;
    position: fixed;
  }

  body.home-page .navbar .container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  /* Masquer le logo dans la navbar home (déjà dans door-overlay) */
  body.home-page .navbar .nav-logo {
    display: none !important;
  }

  /* Burger visible en haut à droite sur la home */
  body.home-page .hamburger {
    display: flex !important;
  }

  body.home-page .hamburger span {
    background: var(--cream) !important;
  }

  body.home-page .hamburger.active span {
    background: var(--cream) !important;
  }

  /* Permettre l'overlay du menu sur la home */
  body.home-page .nav-overlay {
    display: block !important;
  }

  /* Panier : garder au-dessus de tout sur la home */
  body.home-page .cart-nav-btn {
    z-index: 1002;
    position: relative;
  }

  body.home-page .cart-sidebar {
    z-index: 10000;
  }

  /* --- Door intro overlay --- */
  .door-overlay-header {
    display: none !important;
  }

  .door-overlay-logo {
    top: 1.2rem;
    left: 1.5rem !important;
    right: auto !important;
    transform: none;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .door-overlay-logo img {
    width: 40px;
    height: 40px;
  }

  .door-overlay-title {
    font-size: 1rem !important;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Icônes sociales visibles */
  .door-overlay-logo .door-overlay-header-icon {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
  }

  /* Empêcher le chevauchement logo/navbar */
  .door-overlay-logo {
    max-width: calc(100vw - 110px);
    flex-wrap: nowrap;
  }

  /* CTA centré proprement */
  .door-overlay-cta {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.8);
  }

  .door-overlay-cta.pop {
    transform: translate(-50%, -50%) scale(1) !important;
  }

  /* Footer overlay : icônes sociales en bas à droite sur mobile */
  .door-overlay-footer {
    display: flex !important;
    padding: 1rem 1.2rem;
    justify-content: flex-end;
  }

  .door-overlay-footer > div:first-child {
    display: none;
  }

  /* --- Values cards : scroll horizontal --- */
  .values-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
  }

  .value-card {
    flex: 0 0 260px;
    scroll-snap-align: start;
  }

  /* --- Testimonials carousel : taille réduite --- */
  .testimonial-slide-inner {
    padding: 2rem 1.5rem;
  }
}


/* ============================================================
   TABLETTE — max 768px
   ============================================================ */

@media (max-width: 768px) {

  /* --- Navbar mobile ajustements --- */
  .navbar {
    padding: 0.8rem 0;
  }

  .navbar.scrolled {
    padding: 0.5rem 0;
  }

  .nav-logo img {
    height: 36px;
  }

  .navbar.scrolled .nav-logo img {
    height: 32px;
  }

  .nav-logo-text {
    font-size: 1.1rem;
  }

  /* --- Door intro mobile : ajustements supplémentaires --- */
  .door-intro {
    height: 120vh;
  }

  .door-intro-text span {
    font-size: clamp(1rem, 4vw, 1.5rem);
    padding: 0.5rem 1.5rem;
    letter-spacing: 0.12em;
  }

  .door-overlay-logo img {
    width: 36px;
    height: 36px;
  }

  .door-overlay-title {
    font-size: 0.9rem !important;
  }

  .door-overlay-logo .door-overlay-header-icon {
    width: 28px !important;
    height: 28px !important;
  }

  .door-overlay-btn {
    font-size: 0.7rem;
    padding: 0.8rem 1.8rem;
    text-align: center;
    white-space: nowrap;
  }

  /* --- Sections : paddings réduits --- */
  .section {
    padding: clamp(3rem, 6vw, 5rem) 0;
  }

  .section-title {
    font-size: clamp(1.6rem, 5vw, 2.5rem);
  }

  .section-text {
    font-size: 0.9rem;
  }

  .section-label {
    font-size: 0.65rem;
    padding-left: 2rem;
  }

  .section-label::before {
    width: 1.3rem;
  }

  /* --- Split section : empilé --- */
  .split {
    min-height: auto;
  }

  .split-image {
    min-height: 40vh;
  }

  .split-content {
    padding: clamp(2rem, 4vw, 3rem);
  }

  /* --- Accordion gallery mobile --- */
  .accordion-gallery .acc-card {
    border-radius: var(--radius);
  }

  .acc-card-content {
    padding: 1.2rem;
  }

  /* --- Values cards : plus petites --- */
  .value-card {
    flex: 0 0 240px;
    padding: 2rem 1.5rem;
  }

  .value-card h3 {
    font-size: 1.1rem;
  }

  .value-card p {
    font-size: 0.85rem;
  }

  /* --- Products grid mobile 2 cols --- */
  .products-grid {
    gap: 1rem;
  }

  .product-card-info {
    padding: 1rem;
  }

  .product-card-name {
    font-size: 0.95rem;
  }

  .product-card-desc {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  /* --- Counter grid --- */
  .counter-number {
    font-size: clamp(2rem, 6vw, 3rem);
  }

  .counter-label {
    font-size: 0.75rem;
  }

  /* --- Testimonials carousel --- */
  .testimonial-text {
    font-size: 0.9rem;
  }

  .testimonial-quote {
    font-size: 3rem;
  }

  .carousel-controls {
    margin-top: 1.5rem;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* --- Buttons adaptés --- */
  .btn {
    padding: 0.85rem 1.8rem;
    font-size: 0.72rem;
  }

  /* --- Page header inner pages --- */
  .page-header {
    min-height: 35vh;
    padding-bottom: 3rem;
  }

  .page-header h1 {
    font-size: clamp(1.8rem, 6vw, 3rem);
  }

  /* --- Footer mobile --- */
  .footer {
    padding: 3rem 0 1.5rem;
  }

  .footer-grid {
    gap: 2rem;
  }

  .footer-brand p {
    font-size: 0.85rem;
  }

  .footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    gap: 1rem;
  }

  /* --- Marquee --- */
  .marquee {
    padding: 0.6rem 0;
  }

  .marquee-item {
    font-size: 0.7rem;
  }

  /* --- Contact grid --- */
  .contact-form textarea {
    min-height: 120px;
  }

  /* --- FAQ --- */
  .faq-question {
    padding: 1rem 0;
    font-size: 1rem;
  }

  /* --- Agenda --- */
  .agenda-filters {
    gap: 0.4rem;
  }

  .event-card-body {
    padding: 1rem;
  }

  .event-card-footer {
    padding: 0.8rem 1rem 1rem;
  }
}


/* ============================================================
   MOBILE — max 480px
   ============================================================ */

@media (max-width: 480px) {

  /* --- Navbar encore plus compact --- */
  .nav-logo-text {
    font-size: 0.95rem;
  }

  .nav-logo img {
    height: 32px;
  }

  /* --- Container padding réduit --- */
  .container {
    padding: 0 1rem;
  }

  /* --- Sections --- */
  .section {
    padding: clamp(2.5rem, 5vw, 4rem) 0;
  }

  .section-title {
    font-size: clamp(1.4rem, 5vw, 2rem);
  }

  /* --- Split section --- */
  .split-image {
    min-height: 30vh;
  }

  .split-content {
    padding: 1.5rem 1rem;
  }

  /* --- Accordion gallery --- */
  .accordion-gallery .acc-card {
    height: 160px;
  }

  .accordion-gallery .acc-card:hover {
    height: 280px;
  }

  /* --- Values cards --- */
  .value-card {
    flex: 0 0 220px;
    padding: 1.5rem 1.2rem;
  }

  /* --- Products --- */
  .product-card-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
  }

  .product-card-price {
    font-size: 0.9rem;
  }

  /* --- Counter --- */
  .counter-grid {
    gap: 0.8rem;
  }

  .counter-item {
    padding: 1rem;
  }

  /* --- Testimonials --- */
  .testimonial-slide-inner {
    padding: 1.5rem 1rem;
  }

  .testimonial-text {
    font-size: 0.85rem;
  }

  /* --- Buttons --- */
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.7rem;
  }

  /* --- Footer --- */
  .footer-grid {
    gap: 1.5rem;
  }

  .footer h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .footer li a,
  .footer-brand p {
    font-size: 0.8rem;
  }

  .footer-social a {
    width: 36px;
    height: 36px;
  }

  .footer-bottom span,
  .footer-bottom a {
    font-size: 0.7rem;
  }

  /* --- Door intro --- */
  .door-intro {
    height: 110vh;
  }

  .door-overlay-btn {
    font-size: 0.65rem;
    padding: 0.7rem 1.5rem;
  }

  /* Icônes sociales door overlay : taille réduite */
  .door-overlay-logo .door-overlay-header-icon {
    width: 24px !important;
    height: 24px !important;
  }

  .door-overlay-logo .door-overlay-header-icon svg {
    width: 14px;
    height: 14px;
  }

  .door-overlay-title {
    font-size: 0.85rem !important;
  }

  /* --- Page header --- */
  .page-header {
    min-height: 30vh;
    padding-bottom: 2rem;
  }

  .page-header h1 {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
  }

  .breadcrumb {
    font-size: 0.7rem;
  }

  /* --- Menu fullscreen : liens plus grands sur petit écran --- */
  .nav-links a {
    font-size: 0.95rem !important;
    padding: 0.75rem 0 !important;
  }

  /* --- Contact info cards --- */
  .contact-info-card {
    padding: 1.2rem;
  }

  /* --- Agenda event cards --- */
  .event-card-title {
    font-size: 1rem;
  }

  .event-card-meta {
    font-size: 0.75rem;
  }

  .event-card-desc {
    font-size: 0.8rem;
  }
}


/* ============================================================
   PETIT MOBILE — max 360px
   ============================================================ */

@media (max-width: 360px) {

  .nav-logo-text {
    font-size: 0.85rem;
  }

  .nav-logo img {
    height: 28px;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .btn {
    padding: 0.65rem 1.2rem;
    font-size: 0.65rem;
  }

  .nav-links a {
    font-size: 0.85rem !important;
    padding: 0.65rem 0 !important;
  }

  .value-card {
    flex: 0 0 200px;
    padding: 1.2rem 1rem;
  }

  .door-overlay-btn {
    font-size: 0.6rem;
    padding: 0.6rem 1.2rem;
  }

  /* Titre overlay réduit pour laisser place aux icônes */
  .door-overlay-title {
    font-size: 0.75rem !important;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .door-overlay-logo .door-overlay-header-icon {
    width: 22px !important;
    height: 22px !important;
  }

  .door-overlay-logo .door-overlay-header-icon svg {
    width: 13px;
    height: 13px;
  }

  .door-overlay-logo img {
    width: 30px;
    height: 30px;
  }

  .door-overlay-logo {
    gap: 0.35rem;
  }
}


/* ============================================================
   CURSOR GLOW : masquer sur tactile
   ============================================================ */

@media (hover: none) and (pointer: coarse) {
  .cursor-glow {
    display: none !important;
  }
}


/* ============================================================
   BOUTIQUE — grille produits responsive
   ============================================================ */

@media (max-width: 768px) {
  .shop-filters {
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
  }

  .shop-filter-btn {
    font-size: 0.65rem;
    padding: 0.4rem 0.9rem;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
}

@media (max-width: 400px) {
  .products-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ============================================================
   PANIER — sidebar et modal produit
   ============================================================ */

@media (max-width: 480px) {
  .cart-sidebar {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .product-modal-inner {
    flex-direction: column !important;
    width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto;
  }

  .product-modal-img {
    width: 100% !important;
    max-height: 220px;
    object-fit: cover;
  }

  .product-modal-info {
    padding: 1rem !important;
  }
}


/* ============================================================
   CONTACT — formulaire et infos
   ============================================================ */

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .contact-info-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .form-row {
    flex-direction: column !important;
    gap: 0 !important;
  }
}

@media (max-width: 480px) {
  .contact-info-cards {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   AGENDA — modal inscription et cards événements
   ============================================================ */

@media (max-width: 768px) {
  .event-modal-inner {
    width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto;
    padding: 1.5rem 1rem !important;
  }

  .event-modal-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .event-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ============================================================
   À PROPOS — sections texte + image
   ============================================================ */

@media (max-width: 768px) {
  .about-grid,
  .about-beliefs {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  .universe-cards {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
}


/* ============================================================
   DÉCOUVERTE — galerie et témoignages
   ============================================================ */

@media (max-width: 768px) {
  .decouverte-gallery,
  [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .counter-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .decouverte-gallery,
  [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }
}


/* ============================================================
   ADMIN — espace de gestion
   ============================================================ */

@media (max-width: 768px) {
  .admin-tabs {
    flex-direction: column;
    gap: 0.5rem;
  }

  .admin-tab-btn {
    width: 100%;
    text-align: center;
  }

  .admin-product-form .form-row,
  .admin-event-form .form-row {
    flex-direction: column !important;
    gap: 0 !important;
  }

  .product-list,
  .event-list {
    grid-template-columns: 1fr !important;
  }

  .admin-card-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .event-modal--regs .event-modal-inner {
    width: 98vw !important;
    padding: 1rem 0.75rem !important;
  }

  table {
    font-size: 0.78rem;
  }

  td, th {
    padding: 0.4rem 0.5rem !important;
  }
}


/* ============================================================
   FOOTER — liens en bas sur mobile
   ============================================================ */

@media (max-width: 480px) {
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }

  .footer-bottom-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
  }
}


/* ============================================================
   GÉNÉRIQUE — images et textes inline sur mobile
   ============================================================ */

@media (max-width: 768px) {
  img {
    max-width: 100%;
  }

  /* Empêcher tout dépassement horizontal (exclure overlays et modals) */
  *:not(.cart-sidebar):not(.product-modal):not(.event-modal):not(.cart-overlay):not([class*="modal"]) {
    max-width: 100%;
  }

  /* Sections avec style inline grid 3 cols → 1 col */
  [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* Sections avec style inline grid 2 cols → 1 col */
  [style*="grid-template-columns:repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  /* Flex rows inline → colonnes */
  [style*="display:flex"][style*="gap"] {
    flex-wrap: wrap;
  }
}


/* ============================================================
   LANDSCAPE MOBILE — empêcher le débordement en paysage
   ============================================================ */

@media (max-height: 500px) and (orientation: landscape) {

  .nav-links {
    padding: 3rem 2rem 2rem !important;
    gap: 0 !important;
  }

  .nav-links a {
    padding: 0.4rem 0 !important;
    font-size: 0.8rem !important;
  }

  .nav-links li:nth-last-child(2) {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  .door-intro {
    height: 100vh;
  }
}
