/*!
 * nuts-responsive.css — calque responsive au-dessus de Journal2 (Nuts! Publishing)
 * Ne remplace rien : se charge APRÈS index.php?route=journal2/assets/css (voir header.twig).
 * Réutilise les variables --nc-* de la charte (Journal > Custom CSS).
 * Points de rupture :
 *   ≤ 1023 px  « mobile » : en-tête compact + tiroir, menu en rubans défilants, grilles fluides
 *   ≤  767 px  « téléphone » : 2 produits/ligne, panier en cartes, pied de page en accordéons
 * Pilotage JS : nuts-responsive.js ajoute html.nr-on et construit le tiroir (.nr-*).
 * Retrait complet : supprimer les deux lignes ajoutées dans header.twig.
 */

:root{
  --nr-b:var(--nc-bordeaux,#8b2346);
  --nr-b2:var(--nc-bordeaux2,#6e1b37);
  --nr-t:var(--nc-taupe,#9c8c7c);
  --nr-lin:var(--nc-lin,#f4f0eb);
  --nr-line:var(--nc-bordure,#e6e0d9);
  --nr-txt:var(--nc-texte,#5f5a55);
  --nr-or:var(--nc-or,#c9a24a);
  --nr-serif:var(--nc-serif,"Prata",Georgia,serif);
  --nr-cond:"Roboto Condensed",Arial,sans-serif;
  --nr-hdr:60px;
}

/* L'écran « tournez votre tablette » n'a plus lieu d'être : la boutique s'adapte */
#nuts-rotate{display:none!important}

/* Éléments du calque : invisibles tant qu'on n'est pas en mode mobile */
.nr-burger,.nr-badge,.nr-drawer{display:none}

/* =====================================================================
   ≤ 1023 px — MOBILE & TABLETTE PORTRAIT
   ===================================================================== */
@media (max-width:1023px){

  html{overflow-x:clip}
  body{background-image:none!important;background-color:var(--nr-lin)!important;min-width:0!important}
  body.is-sticky{padding-top:0!important}

  /* ---------- Bandeau du haut (slogan / réseaux / liens) : passe dans le tiroir ---------- */
  .header-notice,
  .journal-top-header,.journal-menu-bg,.journal-center-bg,
  #header .top-bar,
  #header .journal-menu{display:none!important}

  /* ---------- En-tête compact collant ---------- */
  header.journal-header-center{display:block!important;position:sticky!important;top:0;z-index:1000;
    background:#fff;border-bottom:1px solid var(--nr-line);box-shadow:0 4px 14px -10px rgba(0,0,0,.35);max-width:none!important}
  header.journal-header-center .header,
  .is-sticky header.journal-header-center .header{position:relative!important;top:auto!important;width:100%!important;display:block!important}
  #header{display:block!important;max-width:none!important;width:100%!important;padding:0!important}

  #header > .header-assets:not(.top-bar){
    display:grid!important;grid-template-columns:48px 1fr auto;align-items:center;gap:6px;
    height:var(--nr-hdr);padding:0 8px!important;margin:0!important;width:100%!important;box-sizing:border-box}
  #header > .header-assets:not(.top-bar) > div{width:auto!important;float:none!important;padding:0!important;margin:0!important;display:block}

  /* recherche + langue : déplacées dans le tiroir par le JS ; repli sans JS = masquées */
  #header .journal-search{display:none!important}

  /* logo */
  #header .journal-logo.j-100{display:flex!important;justify-content:center;min-width:0}
  #logo{position:relative;display:flex;align-items:center;justify-content:center;height:var(--nr-hdr);margin:0!important;padding:0!important}
  #logo > br{display:none}
  #logo > a:first-of-type img{width:46px!important;height:46px!important;border-radius:50%;margin:0!important}
  /* bouton « Un voyage dans le temps » : pastille à droite du logo, sans bulle */
  #logo .nc-frise-btn{left:calc(50% + 30px)!important;width:32px!important;height:32px!important;top:50%!important;transform:translateY(-50%)}
  #logo .nc-frise-btn:hover,#logo .nc-frise-btn:focus-visible{transform:translateY(-50%) rotate(-6deg)!important}
  #logo .nc-frise-btn::before{width:15px!important;height:15px!important}
  #logo .nc-frise-btn span{display:none!important}

  /* actions : dé du cadeau + panier (souhaits / compte → tiroir) */
  #header .journal-logo.j-min{position:relative;display:flex!important;align-items:center;justify-content:flex-end;gap:6px;padding-right:0!important;height:var(--nr-hdr)!important;overflow:visible}
  #header .journal-logo.j-min > br{display:none}
  #header #nc-pills{position:static!important;top:auto!important;display:flex!important;align-items:center;gap:4px;margin:0!important}
  #header #nc-pills > a{display:none!important}
  #header #nc-pills #dc-btn{height:40px;min-width:40px;padding:0 8px!important;margin:0!important;border-radius:999px}
  #header #nc-pills #dc-btn .dc-txt{display:none!important}

  #header #cart{position:relative!important;top:auto!important;left:auto!important;right:auto!important;width:44px!important;height:44px;margin:0!important;float:none!important;background:transparent!important}
  #header #cart > button{position:relative;width:44px!important;height:44px!important;min-height:0!important;padding:0!important;margin:0!important;
    border-radius:50%!important;display:flex!important;align-items:center;justify-content:center;background:var(--nr-b)!important;border:0!important;box-shadow:none!important}
  #header #cart > button > a{display:flex!important;align-items:center;justify-content:center;width:100%;height:100%;padding:0!important;color:#fff!important}
  #header #cart #cart-total{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  #header #cart > button i{margin:0!important;font-size:18px!important;color:#fff!important;background:transparent!important;width:auto!important;height:auto!important;line-height:1!important;position:static!important;padding:0!important;box-shadow:none!important}
  #header #cart > button i::before{color:#fff!important}
  #header #cart .content,#header #cart .dropdown-menu{display:none!important}

  html.nr-on .nr-badge{display:block;position:absolute;top:2px;right:-2px;z-index:3;min-width:19px;height:19px;padding:0 5px;border-radius:10px;
    background:var(--nr-or);color:#fff;font:700 11px/19px var(--nr-cond);text-align:center;pointer-events:none;box-shadow:0 0 0 2px #fff}
  html.nr-on .nr-badge[data-n="0"]{display:none}

  /* burger */
  html.nr-on .nr-burger{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;border-radius:12px;
    background:transparent;color:var(--nr-b);cursor:pointer;padding:0}
  .nr-burger:active{background:var(--nr-lin)}
  .nr-burger svg{width:24px;height:24px}

  /* ---------- Menu principal (.nutspub-menu) : rubans défilants ---------- */
  .block-content:has(>.editor-content>.nutspub-menu){padding:8px 0 0!important}
  /* le bloc CMS qui porte le menu est en display:table + flex : il s'élargirait à 900 px */
  .cms-blocks:has(.nutspub-menu),.cms-blocks:has(.nutspub-menu) .blocks,.cms-blocks:has(.nutspub-menu) .cms-block,
  .cms-blocks:has(.nutspub-menu) .block-content,.cms-blocks:has(.nutspub-menu) .editor-content{display:block!important;float:none!important;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box}
  .cms-blocks:has(.nutspub-menu) .cms-block{padding-left:0!important;padding-right:0!important}
  .nutspub-menu{float:none!important;width:100%!important}
  #top-modules .journal2_cms_blocks{max-width:100%!important;min-width:0!important}
  .nutspub-menu{max-width:100%!important;min-width:0!important;overflow:hidden}
  .nutspub-menu center{justify-content:flex-start!important;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;
    -webkit-overflow-scrolling:touch;scrollbar-width:none;padding:6px 12px 0!important;
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}
  .nutspub-menu center::-webkit-scrollbar{display:none}
  .nutspub-menu center>a.button{scroll-snap-align:start}
  .nutspub-menu center>a.button:last-of-type{margin-right:28px!important}

  /* ---------- Contenu ---------- */
  #container,.extended-container,#content{max-width:100%!important}
  #content img,.editor-content img{max-width:100%;height:auto}
  .editor-content iframe,#tab-description iframe,#content iframe{max-width:100%}
  #tab-description table,.editor-content table{display:block;max-width:100%;overflow-x:auto}
  .tp-banner-container{overflow:hidden!important;max-width:100%}

  /* colonnes latérales sous le contenu */
  #column-left,#column-right{width:100%!important;max-width:none!important;float:none!important;position:static!important;margin:0!important}
  #column-left + #content,#content + #column-right{margin:0!important}

  /* formulaires : 16 px minimum, sinon iOS zoome à la saisie */
  .form-control,select,textarea,
  input[type=text],input[type=email],input[type=tel],input[type=password],input[type=number],input[type=search]{font-size:16px!important}

  /* ---------- Listes de produits ---------- */
  .main-products.product-grid > .product-grid-item{width:33.333%!important;flex:0 0 33.333%!important;max-width:33.333%!important}
  .product-grid-item .name,.product-grid-item .name a{font-size:15px!important;line-height:1.25!important;word-break:normal;overflow-wrap:anywhere;hyphens:auto}
  .product-grid-item .description{display:none!important}
  .product-filter .display{display:none!important}
  .refine-images{flex-wrap:wrap!important}
  .refine-images > .refine-image{width:25%!important;flex:0 0 25%!important;max-width:25%!important}

  /* ---------- Fiche produit ---------- */
  .product-info.split-30-70 > .left,.product-info.split-30-70 > .right,
  .product-info > .left,.product-info > .right{width:100%!important;float:none!important;padding-left:0!important;padding-right:0!important}
  .product-tabs .nav-tabs{display:flex!important;overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap!important}
  .product-tabs .nav-tabs > li{flex:0 0 auto;float:none!important;width:auto!important}

  /* ---------- Compte ---------- */
  .content.my-account a.button,.content.my-orders a.button,.content.my-newsletter a.button,
  #content .list-unstyled > li > a.button{min-width:0!important;width:100%!important;box-sizing:border-box;white-space:normal}

  /* ---------- Commande ---------- */
  #accordion .panel-body [class*="col-sm-"],#accordion .panel-body [class*="col-md-"]{width:100%!important;float:none!important}
  #accordion .form-horizontal .control-label{text-align:left!important;padding-top:0!important;margin-bottom:4px}
  .table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch;border:0}

  /* ---------- Tiroir ---------- */
  html.nr-on .nr-drawer{display:block;position:fixed;inset:0;z-index:100000;visibility:hidden;pointer-events:none}
  html.nr-on .nr-drawer.nr-open{visibility:visible;pointer-events:auto}
  .nr-scrim{position:absolute;inset:0;background:rgba(30,15,10,.5);opacity:0;transition:opacity .25s}
  .nr-open .nr-scrim{opacity:1}
  .nr-panel{position:absolute;top:0;bottom:0;left:0;width:min(88vw,360px);background:#fff;display:flex;flex-direction:column;
    overflow-y:auto;overscroll-behavior:contain;transform:translateX(-102%);transition:transform .28s cubic-bezier(.2,.8,.2,1);
    padding-bottom:env(safe-area-inset-bottom);box-shadow:8px 0 30px -12px rgba(0,0,0,.4)}
  .nr-open .nr-panel{transform:none}
  .nr-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px 10px 16px;border-bottom:1px solid var(--nr-line);
    position:sticky;top:0;background:#fff;z-index:2}
  .nr-head img{width:42px;height:42px;border-radius:50%}
  .nr-head b{flex:1;font:400 17px/1.1 var(--nr-serif);color:var(--nr-b)}
  .nr-close{width:44px;height:44px;border:0;border-radius:12px;background:var(--nr-lin);color:var(--nr-b);display:flex;align-items:center;justify-content:center;cursor:pointer}
  .nr-close svg{width:20px;height:20px}

  /* recherche + langue déplacées */
  .nr-slot-search{padding:14px 16px 4px}
  .nr-slot-search .journal-search{display:flex!important;flex-direction:column;gap:10px;width:100%!important;height:auto!important;min-height:0!important;float:none!important;padding:0!important;margin:0!important;position:static!important}
  .nr-slot-search .journal-search > form{height:auto!important;margin:0!important}
  .nr-slot-search #language{display:flex!important;flex-wrap:wrap;gap:6px;margin:0!important;position:static!important;float:none!important}
  .nr-slot-search #language .btn-group{display:flex!important;flex-wrap:wrap;gap:6px;float:none!important}
  .nr-slot-search #search{display:flex!important;width:100%!important;height:46px!important;top:auto!important;left:auto!important;position:relative!important;float:none!important;margin:0!important;
    border:1px solid var(--nr-line);border-radius:999px;overflow:visible!important;background:var(--nr-lin)}
  .nr-slot-search #search input{flex:1;min-width:0;width:auto!important;height:44px!important;border:0!important;border-radius:999px 0 0 999px!important;background:transparent!important;padding:0 16px!important;box-shadow:none!important}
  .nr-slot-search #search .button-search{position:static!important;width:46px!important;height:44px!important;display:flex;align-items:center;justify-content:center;background:var(--nr-b)!important;border-radius:0 999px 999px 0}
  .nr-slot-search #search .button-search button{background:transparent!important;color:#fff!important;border:0!important;width:100%;height:100%}
  .nr-slot-search #search .button-search button i,.nr-slot-search #search .button-search button i::before{color:#fff!important;background:transparent!important}
  /* le thème écrit la recherche en blanc (prévue sur fond noir) : texte foncé sur le fond lin */
  .nr-slot-search #search input,.nr-slot-search #search input:focus{color:#2a2118!important;-webkit-text-fill-color:#2a2118!important;caret-color:var(--nr-b);opacity:1!important}
  .nr-slot-search #search input::placeholder{color:var(--nr-t)!important;-webkit-text-fill-color:var(--nr-t)!important;opacity:1!important}
  .nr-slot-search #search:focus-within{border-color:var(--nr-b)!important;box-shadow:0 0 0 3px rgba(139,35,70,.15)}
  .nr-slot-search .autocomplete2-suggestions,.nr-slot-search .autocomplete2-suggestions *{color:#2a2118!important;background-color:#fff}
  .nr-slot-search .autocomplete2-suggestions .autocomplete2-selected,.nr-slot-search .autocomplete2-suggestions .autocomplete2-selected *{background-color:var(--nr-lin)!important;color:var(--nr-b)!important}
  /* autocomplétion Journal (appendTo: '.journal-search > div' = #search) : liste sous le champ */
  .nr-slot-search .autocomplete2-suggestions{position:absolute!important;top:calc(100% + 6px)!important;left:0!important;right:0!important;
    width:auto!important;max-height:60vh!important;overflow-y:auto!important;z-index:20!important;margin:0!important;
    background:#fff!important;border:1px solid var(--nr-line)!important;border-radius:14px!important;box-shadow:0 14px 30px -12px rgba(0,0,0,.35)!important}
  .nr-slot-search .autocomplete2-suggestions > div{border-bottom:1px solid var(--nr-line)}
  .nr-slot-search .autocomplete2-suggestions > div:last-child{border-bottom:0}
  .nr-slot-search .autocomplete2-suggestions a{display:flex!important;align-items:center;gap:10px;padding:8px 12px!important;text-decoration:none!important}
  .nr-slot-search .autocomplete2-suggestions .p-image{flex:0 0 52px;width:52px!important;float:none!important;padding:0!important}
  .nr-slot-search .autocomplete2-suggestions .p-image img{width:52px!important;height:52px!important;object-fit:contain;border-radius:6px;background:var(--nr-lin)}
  .nr-slot-search .autocomplete2-suggestions .p-name{flex:1;min-width:0;width:auto!important;float:none!important;padding:0!important;font-size:14px;line-height:1.3;white-space:normal}
  .nr-slot-search .autocomplete2-suggestions .p-price{display:block;width:auto!important;float:none!important;padding:2px 0 0!important;font-weight:700;color:var(--nr-b)!important}
  .nr-slot-search .autocomplete2-suggestions .p-price .price-old{text-decoration:line-through;font-weight:400;margin-right:6px;color:var(--nr-t)!important}
  .nr-slot-search .autocomplete2-suggestions .view-more-link,.nr-slot-search .autocomplete2-suggestions .no-results{justify-content:center;font:400 13px/1 var(--nr-cond)!important;letter-spacing:.05em;text-transform:uppercase;color:var(--nr-b)!important;padding:12px!important}
  .nr-slot-search .autocomplete2-suggestions .clearfix{display:none}

  .nr-nav{padding:6px 0}
  .nr-nav a{display:flex;align-items:center;gap:12px;min-height:50px;padding:0 20px;border-bottom:1px solid var(--nr-line);
    font:400 15px/1.2 var(--nr-cond);letter-spacing:.06em;text-transform:uppercase;color:#2a2118!important;text-decoration:none!important}
  .nr-nav a::before{content:"";width:20px;height:20px;flex:none;background:var(--nr-t);-webkit-mask:var(--nc-ico) center/contain no-repeat;mask:var(--nc-ico) center/contain no-repeat}
  .nr-nav a[aria-current]{color:var(--nr-b)!important;background:var(--nr-lin);box-shadow:inset 4px 0 0 var(--nr-b)}
  .nr-nav a[aria-current]::before{background:var(--nr-b)}
  .nr-nav a:active{background:var(--nr-lin)}

  .nr-links{display:flex;flex-wrap:wrap;gap:8px;padding:16px}
  .nr-links a{display:inline-flex;align-items:center;min-height:38px;padding:0 14px;border:1px solid var(--nr-line);border-radius:999px;
    background:#fff;font:400 13px/1 var(--nr-cond);letter-spacing:.04em;text-transform:uppercase;color:var(--nr-txt)!important;text-decoration:none!important}
  .nr-links a.nr-strong{background:var(--nr-b);border-color:var(--nr-b);color:#fff!important}

  .nr-foot{margin-top:auto;padding:16px;background:var(--nr-lin);display:flex;align-items:center;gap:10px;flex-wrap:wrap}
  .nr-foot small{flex:1 0 100%;font:400 12px/1.4 var(--nr-cond);color:var(--nr-txt)}
  .nr-foot a{display:block;width:40px;height:40px}
  .nr-foot a img{width:40px!important;height:40px!important;border-radius:50%}

  html.nr-lock,html.nr-lock body{overflow:hidden!important}
}

/* =====================================================================
   ≤ 767 px — TÉLÉPHONE
   ===================================================================== */
@media (max-width:767px){

  #content{padding-left:10px!important;padding-right:10px!important}
  .heading-title{font-size:22px!important;line-height:1.2!important}

  /* produits : 2 par ligne */
  /* chemin de fer masqué (reste dans le DOM : nc-menu-actif.js s'en sert pour l'onglet actif) */
  .breadcrumb,ul.breadcrumb{display:none!important}

  /* titres : retour à la ligne forcé, plus de débordement en 2 colonnes */
  .main-products.product-grid > .product-grid-item,
  .product-grid-item .product-wrapper,.product-grid-item .product-details,.product-grid-item .caption{min-width:0!important;max-width:100%}
  .product-grid-item .product-wrapper{overflow:hidden}
  .product-grid-item .name,.product-grid-item .name a{display:block;font-size:13.5px!important;line-height:1.25!important;
    white-space:normal!important;overflow-wrap:anywhere!important;word-break:break-word!important;hyphens:auto;
    height:auto!important;max-height:none!important;overflow:visible!important;text-overflow:clip!important}
  .product-grid-item .caption{height:auto!important}
  .main-products.product-grid > .product-grid-item{width:50%!important;flex:0 0 50%!important;max-width:50%!important}
  .product-grid-item .button-group{flex-wrap:wrap}
  .product-grid-item .cart,.product-grid-item .cart .button{width:100%!important}
  .product-filter{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
  .product-filter .product-compare{display:none!important}
  .refine-images > .refine-image{width:33.333%!important;flex:0 0 33.333%!important;max-width:33.333%!important}
  .refine-image a,.refine-image a *{font-size:13px!important;line-height:1.25!important}

  /* ---------- Panier : lignes → cartes ---------- */
  .cart-info{overflow:visible!important}
  .cart-info table,.cart-info table > tbody{display:block!important;width:100%!important;border:0!important}
  .cart-info table > thead{display:none!important}
  .cart-info table > tbody > tr{display:grid!important;grid-template-columns:72px 1fr auto;grid-template-areas:"img name name" "img qty total";
    gap:8px 12px;align-items:center;padding:12px;margin:0 0 10px;background:#fff;border:1px solid var(--nr-line);border-radius:14px}
  .cart-info table > tbody > tr > td{display:block!important;border:0!important;padding:0!important;text-align:left!important;width:auto!important;background:none!important}
  .cart-info td.image{grid-area:img}
  .cart-info td.image img{width:72px!important;height:72px!important;object-fit:contain;border-radius:8px;background:var(--nr-lin)}
  .cart-info td.name{grid-area:name;font-size:14px;line-height:1.3}
  .cart-info td.name,.cart-info td.name a{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;font-size:14px!important;font-weight:600;line-height:1.3!important}
  .cart-info td.name small,.cart-info td.name br + *{font-weight:400;font-size:12px!important}
  .cart-info td.model,.cart-info td.price{display:none!important}
  .cart-info td.quantity{grid-area:qty}
  .cart-info td.quantity .input-group{display:flex!important;align-items:center;gap:4px;max-width:none!important;width:auto!important}
  .cart-info td.quantity input{width:52px!important;height:38px!important;text-align:center;flex:none}
  .cart-info td.quantity .input-group-btn{display:flex!important;width:auto!important;gap:4px}
  .cart-info td.quantity .input-group-btn .btn,.cart-info td.quantity button{width:38px!important;height:38px!important;padding:0!important;border-radius:8px!important}
  .cart-info td.total{grid-area:total;align-self:end;font:700 16px/1 var(--nr-cond);color:var(--nr-b)}
  #content .action-area,#content .cart-total,#content .cart-total table,#total,#content .row > .col-sm-4.col-sm-offset-8{width:100%!important;float:none!important;margin-left:0!important}
  #content .buttons{display:flex;flex-direction:column-reverse;gap:10px}
  #content .buttons .pull-left,#content .buttons .pull-right{float:none!important;width:100%}
  #content .buttons .button,#content .buttons .btn{width:100%!important;box-sizing:border-box;text-align:center}

  /* ---------- Pied de page : accordéons ---------- */
  #footer .columns{display:block!important}
  #footer .column{width:100%!important;float:none!important;padding:0 16px!important;box-sizing:border-box;border-bottom:1px solid var(--nr-line)}
  #footer .column > h3{display:flex!important;align-items:center;justify-content:space-between;margin:0!important;padding:14px 0!important;height:auto!important;cursor:pointer}
  html.nr-on #footer .column > h3::after{content:"+";font:400 22px/1 var(--nr-cond);color:var(--nr-b);transition:transform .2s}
  html.nr-on #footer .column.nr-open > h3::after{transform:rotate(45deg)}
  html.nr-on #footer .column > .column-menu-wrap{display:none!important}
  html.nr-on #footer .column.nr-open > .column-menu-wrap{display:block!important;padding-bottom:12px}
  #footer .column-menu-wrap,#footer .column-menu-wrap ul{width:100%!important}
  #footer .column-menu-wrap li a{display:block;padding:8px 0}
  .bottom-footer .copyright{padding:12px 16px calc(12px + env(safe-area-inset-bottom))!important;height:auto!important}
}

@media (prefers-reduced-motion:reduce){
  .nr-panel,.nr-scrim{transition:none!important}
}
