/* assets/css/responsive.css
   Responsive GSLR Antiques
   À charger après style.css
*/

/* =========================================================
   TABLETTE ET ÉCRANS INTERMÉDIAIRES — jusqu’à 1099 px
   ========================================================= */

@media (max-width: 1099px){

  /* Structure générale */
  .wrap{
    width: auto;
    max-width: calc(100% - 40px);
  }

  body{
    font-size: 16px;
  }

  .section{
    padding: 24px 0;
  }

  /* Header */
  .header-row1{
    gap: 14px;
  }

  .brand{
    min-width: 0;
    flex: 0 1 auto;
  }

  .brand-logo{
    width: 50px;
  }

  .brand-title{
    font-size: 1.05rem;
  }

  .brand-subtitle{
    font-size: 0.75rem;
  }

  .header-navigation{
    gap: 10px;
  }

  .main-nav{
    gap: 4px;
  }

  .main-nav .nav-link{
    padding: 10px 7px;
    font-size: 0.94rem;
  }

  .language-switch{
    min-width: 40px;
    padding: 6px 8px;
  }

  /* Recherche */
  .search--wide input{
    min-width: 0;
  }

  /* Accueil */
  .hero-inner{
    align-items: flex-start;
  }

  .hero-media{
    width: min(38vw, 360px);
    flex: 0 0 auto;
  }

  .hero h1{
    font-size: 30px;
  }

  /* Grilles */
  .cards-4{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tiles-3{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Fiche objet */
  .objet-layout{
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    gap: 18px;
  }

  .detail-mini-img{
    width: 96px;
    height: 80px;
  }

  .notice-head{
    gap: 10px;
  }

  .gallery-open-btn{
    white-space: normal;
  }

  /* Contact */
  .contact-layout{
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  /* Catalogue :
     résultats à gauche, filtres sur la largeur disponible */
  .catalogue-toolbar-wrap{
    align-items: flex-start;
  }

  .catalogue-results{
    padding-top: 8px;
  }

  .catalogue-filters{
    flex: 1 1 650px;
    min-width: 0;
  }

  .catalogue-filter-group{
    justify-content: flex-start;
  }

  .catalogue-budget-group{
    margin-left: auto;
    justify-content: flex-end;
  }

  /* Footer */
  .footer-grid{
    gap: 36px;
  }
}


/* =========================================================
   MOBILE — jusqu’à 767 px
   ========================================================= */

@media (max-width: 767px){

  :root{
    --radius: 14px;
  }

  html{
    scroll-padding-top: 150px;
  }

  body{
    font-size: 16px;
    line-height: 1.55;
  }

  .wrap{
    max-width: calc(100% - 28px);
  }

  h1{
    font-size: clamp(1.7rem, 8vw, 2.05rem);
  }

  .section{
    padding: 20px 0;
  }

  .section-head{
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
  }

  .section-head h2,
  .prose h2{
    font-size: 1.12rem;
  }

  /* =======================================================
       /* =======================================================
     Header mobile
     ======================================================= */

  .site-header{
    backdrop-filter: blur(12px);
    background: rgba(251,250,248,.97);
  }

  .header-row1{
    position: relative;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 10px 0;
  }

  .brand{
    min-width: 0;
    flex: 1 1 180px;
    gap: 9px;
  }

  .brand-logo{
    width: 44px;
  }

  .brand-text{
    min-width: 0;
    gap: 3px;
  }

  .brand-title{
    font-size: 0.98rem;
    letter-spacing: 0.035em;
  }

  .brand-subtitle{
    max-width: 210px;
    font-size: 0.69rem;
    letter-spacing: 0.045em;
  }

  .header-navigation{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    margin-left: auto;
    gap: 7px;
  }

  .language-switch{
    order: 1;
    min-width: 38px;
    min-height: 42px;
    padding: 5px 7px;
    border-radius: 10px;
    font-size: 0.82rem;
  }

  /* Bouton hamburger */
  .nav-toggle{
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: #fff;
    color: var(--accent);

    cursor: pointer;
  }

  .nav-toggle-icon{
    position: relative;
    width: 20px;
    height: 16px;
  }

  .nav-toggle-icon span{
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;

    border-radius: 2px;
    background: currentColor;

    transition:
      top .2s ease,
      transform .2s ease,
      opacity .2s ease;
  }

  .nav-toggle-icon span:nth-child(1){
    top: 0;
  }

  .nav-toggle-icon span:nth-child(2){
    top: 7px;
  }

  .nav-toggle-icon span:nth-child(3){
    top: 14px;
  }

  /* Le hamburger devient une croix lorsque le menu est ouvert */
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1){
    top: 7px;
    transform: rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2){
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3){
    top: 7px;
    transform: rotate(-45deg);
  }

  /*
   * Navigation masquée par défaut sur mobile.
   * Elle occupe toute la largeur intérieure du header lorsqu’elle s’ouvre.
   */
  .main-nav{
    position: absolute;
    z-index: 30;
    top: calc(100% + 1px);
    left: 0;

    display: none;
    width: 100%;
    margin: 0;
    padding: 8px 14px 14px;

    align-items: stretch;
    flex-direction: column;
    gap: 3px;

    border-bottom: 1px solid var(--line);
    background: rgba(251,250,248,.99);
    box-shadow: 0 12px 24px rgba(31,45,54,.12);
  }

  .main-nav.is-open{
    display: flex;
  }

  .main-nav .nav-link{
    width: 100%;
    height: auto;
    min-height: 46px;
    justify-content: space-between;
    padding: 11px 12px;
    border-radius: 10px;
  }

  .main-nav > .nav-link:hover,
  .main-nav > .nav-link:focus-visible,
  .nav-dd-toggle:hover,
  .nav-dd-toggle:focus-visible{
    background: rgba(59,103,134,.07);
  }

  .nav-dd{
    width: 100%;
  }

  .nav-dd-toggle{
    width: 100%;
  }

  /*
   * Le sous-menu Boutique reste fermé tant qu’il n’est pas demandé.
   * Lorsqu’il s’ouvre, il reste inclus dans le panneau principal.
   */
  .nav-dd-panel{
    position: static;
    width: 100%;
    margin: 2px 0 7px;
    padding: 7px;

    border: 1px solid rgba(59,103,134,.16);
    border-radius: 12px;

    background: rgba(59,103,134,.055);
    box-shadow: none;
  }

  .nav-dd-panel[hidden]{
    display: none;
  }

  .nav-dd-panel a{
    display: block;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
  }

  .nav-dd-panel a:hover,
  .nav-dd-panel a:focus-visible{
    background: rgba(255,255,255,.72);
  }

  .nav-dd-toggle[aria-expanded="true"] .nav-caret{
    transform: rotate(180deg);
  }

  .nav-caret{
    transition: transform .2s ease;
  }

  .header-row2{
    padding-bottom: 10px;
  }

  /* Recherche mobile :
     le bleu reste le point de repère visuel. */
  .searchbar{
    background: rgba(59,103,134,.055);
    border-bottom-color: rgba(59,103,134,.16);
  }

  .search--wide{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .search--wide input{
    width: 100%;
    min-width: 0;
    padding: 10px 11px;
  }

  .search--wide button{
    min-width: 46px;
  }

  .search-advanced-link{
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: -2px;
    font-size: 12px;
  }

  /* =======================================================
     Accueil et contenus généraux
     ======================================================= */

  .hero{
    padding: 24px 0 8px;
  }

  .hero-inner{
    flex-direction: column;
    gap: 18px;
  }

  .hero-text{
    width: 100%;
  }

  .hero h1{
    font-size: clamp(1.85rem, 8vw, 2.15rem);
  }

  .lead{
    font-size: 1rem;
  }

  .hero-media{
    width: 100%;
  }

  .hero-frame{
    border-radius: var(--radius);
  }

  /* =======================================================
     Gros boutons d’action sur mobile
     ======================================================= */

  .cta-row,
  .prose-cta,
  .objet-cta{
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .cta-row .btn,
  .prose-cta .btn,
  .objet-cta .btn,
  .notice-open,
  .catalogue-apply,
  a.btn[href$="/nouveautes.php"],
  a.btn[href$="/rayons.php"]{
    width: 100%;
    min-height: 46px;
    padding: 11px 15px;
    border-radius: 13px;
    flex: none;
  }

  .cta-row .btn-ghost,
  .prose-cta .btn-ghost,
  .objet-cta .btn-ghost,
  .notice-open.btn-ghost,
  .catalogue-apply{
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
  }

  .cta-row .btn-ghost:hover,
  .cta-row .btn-ghost:focus-visible,
  .prose-cta .btn-ghost:hover,
  .prose-cta .btn-ghost:focus-visible,
  .objet-cta .btn-ghost:hover,
  .objet-cta .btn-ghost:focus-visible,
  .notice-open.btn-ghost:hover,
  .notice-open.btn-ghost:focus-visible,
  .catalogue-apply:hover,
  .catalogue-apply:focus-visible{
    background: #2f5670;
    border-color: #2f5670;
    color: #fff;
  }

  .catalogue-apply{
    font: inherit;
    font-weight: 500;
    cursor: pointer;
  }



  /* Cartes : deux colonnes sur téléphone, pour conserver
     l’allure de galerie d’antiquaire et éviter une page interminable. */
  .cards-4{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .card-title{
    min-height: 0;
    font-size: 0.94rem;
  }

  .card-body{
    padding: 11px 11px 13px;
  }

  .card:hover{
    transform: none;
  }

  .tiles-3{
    grid-template-columns: 1fr;
  }

  .tile-label{
    padding: 12px;
  }

  .actu{
    flex-direction: column;
  }

  .actu-media img{
    width: 100%;
    height: auto;
  }

  .prose{
    padding: 15px;
  }

  .prose ul{
    margin-left: 18px;
    padding-left: 0;
  }

  /* =======================================================
     Filtres catalogue
     ======================================================= */

  .catalogue-hero{
    padding-bottom: 10px;
  }

  .catalogue-section{
    padding-top: 8px;
  }

  .catalogue-toolbar-wrap{
    display: block;
    margin-bottom: 16px;
  }

  .catalogue-results{
    margin-bottom: 12px;
    padding-top: 0;
  }

  .catalogue-filters{
    width: 100%;
    margin-left: 0;
    padding: 12px;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    background: rgba(59,103,134,.045);
    border: 1px solid rgba(59,103,134,.14);
    border-radius: var(--radius);
  }

  .catalogue-filter-group{
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }

  .catalogue-budget-group{
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding-top: 11px;
    border-top: 1px solid rgba(59,103,134,.14);
  }

  .catalogue-filter{
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    white-space: normal;
    font-size: 0.9rem;
  }

  .catalogue-filter select,
  .catalogue-filter input{
    width: 100%;
    min-height: 42px;
    padding: 8px 9px;
  }

  .catalogue-filter--budget input{
    width: 100%;
  }


  /* =======================================================
     Fiche objet
     ======================================================= */

  .objet-head{
    display: block;
  }

  .objet-layout{
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .objet-left,
  .objet-right{
    width: 100%;
    flex: none;
  }

  .objet-gallery .gallery-btn{
    padding: 8px;
  }

  .gallery-thumb,
  .objet-gallery .gallery-thumb{
    max-height: 58vh;
  }

  .gallery-hint{
    left: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
  }

  .objet-info .card-body{
    padding: 14px;
  }

  .info-grid{
    gap: 0;
  }

  .info-row{
    padding: 8px 0;
    align-items: baseline;
    border-bottom: 1px solid var(--line);
  }

  .info-row:last-child{
    border-bottom: 0;
  }

  .info-k{
    font-weight: 500;
  }

  .info-v{
    text-align: right;
  }

  .objet-cta{
    flex-direction: column;
  }

  .objet-cta .btn{
    width: 100%;
    flex: none;
  }

  /* La hauteur synchronisée par le JS desktop ne doit pas
     enfermer la notice sur mobile. */
  #noticeCard{
    height: auto !important;
    overflow: visible;
  }

  #noticeBody,
  #noticeBox{
    display: block;
  }

  #noticeScroll{
    max-height: 360px;
    overflow: auto;
    padding-right: 5px;
  }

  .notice-head{
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 14px;
  }

  .detail-mini{
    text-align: left;
  }

  .detail-mini-img{
    width: 88px;
    height: 72px;
  }

  .gallery-open-btn{
    flex: 1 1 auto;
    min-width: 0;
    padding-inline: 12px;
  }

  .notice-open{
    width: 100%;
    margin-top: 14px;
  }

  /* Lightbox */
  .lightbox-panel{
    inset: 8px;
  }

  .lightbox-img{
    max-width: 96vw;
    max-height: 82vh;
    border-radius: 12px;
  }

  .lightbox-close,
  .lightbox-prev,
  .lightbox-next{
    width: 42px;
    height: 42px;
  }

  .lightbox-close{
    top: 6px;
    right: 6px;
  }

  .lightbox-prev{
    left: 4px;
  }

  .lightbox-next{
    right: 4px;
  }

  .notice-modal-panel{
    inset: 10px;
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .notice-modal-head{
    padding: 16px 60px 11px 15px;
  }

  .notice-modal-body{
    padding: 14px 15px 22px;
  }

  /* =======================================================
     Contact
     ======================================================= */

  .contact-layout{
    grid-template-columns: 1fr;
  }

  .contact-card{
    padding: 15px;
  }

  .contact-ref{
    padding: 13px;
    gap: 13px;
    align-items: flex-start;
  }

  .contact-ref img.contact-ref-photo{
    width: 88px;
    height: 88px;
    min-width: 88px;
    max-width: 88px;
    flex-basis: 88px;
  }

  .contact-ref-title{
    font-size: 1rem;
  }

  .form-row textarea{
    min-height: 150px;
  }

  .contact-side{
    margin-top: 4px;
  }

  /* =======================================================
     Footer
     ======================================================= */

  .site-footer{
    margin-top: 40px;
    padding: 36px 0 20px;
  }

  .footer-grid{
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-col{
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
  }

  .footer-col:last-child{
    padding-bottom: 0;
    border-bottom: 0;
  }

  .footer-col h3{
    margin-bottom: 12px;
  }

  .footer-col li{
    margin: 8px 0;
  }

  .footer-bottom{
    margin-top: 30px;
  }
}


/* =========================================================
   TRÈS PETITS ÉCRANS — jusqu’à 420 px
   ========================================================= */

@media (max-width: 420px){

  .wrap{
    max-width: calc(100% - 22px);
  }

  .brand-subtitle{
    display: none;
  }

  .brand-logo{
    width: 40px;
  }

  .brand-title{
    font-size: 0.92rem;
  }

  .cards-4{
    grid-template-columns: 1fr;
  }

  .catalogue-filter-group{
    grid-template-columns: 1fr;
  }

  .catalogue-budget-group{
    grid-template-columns: 1fr;
  }

  .catalogue-apply{
    width: 100%;
  }

  .notice-head{
    align-items: stretch;
    flex-direction: column;
  }

  .detail-mini{
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .detail-mini-txt{
    margin-top: 0;
    white-space: normal;
  }

  .gallery-open-btn{
    width: 100%;
  }

  .contact-ref{
    flex-direction: column;
  }

  .contact-ref img.contact-ref-photo{
    width: 100%;
    height: auto;
    max-width: 180px;
  }
}


/* =========================================================
   PRÉFÉRENCES D’ACCESSIBILITÉ
   ========================================================= */

@media (prefers-reduced-motion: reduce){

  *,
  *::before,
  *::after{
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   PAGE 404
   ========================================================= */

@media (max-width: 767px){
  .error404{
    padding: 40px 0 34px;
  }

  .error404-code{
    margin-bottom: 10px;
    font-size: clamp(4.5rem, 28vw, 7rem);
  }

  .error404-message{
    margin-bottom: 24px;
    font-size: 1rem;
  }

  .error404-actions{
    width: 100%;
  }
}