/* Carte du site client (page produits) : barre des catégories, cartes, panneau de choix. */
/* Panneau de choix #mp-panel (parties/panels.php) */
/* Cache les anciens modals s'ils existent encore (anti-flash) */
#associatedProductsModal, #bundleModal, #allergensModal { display:none !important; }

/* Backdrop + Panel */
#mp-panel-bg{
  position:fixed; inset:0; background:rgba(17,24,39,.45);
  opacity:0; pointer-events:none; transition:opacity .2s ease;
  z-index:1080; backdrop-filter: blur(2px);
}
#mp-panel-bg.open{ opacity:1; pointer-events:auto; }

#mp-panel{
  position:fixed; z-index:1081; background:#fff; color:#111827;
  box-shadow:0 24px 60px rgba(0,0,0,.25);
  display:flex; flex-direction:column; overscroll-behavior:contain;
  border-radius:18px 18px 0 0;
  left:0; right:0; bottom:0; transform: translateY(100%); transition: transform .25s ease;
  max-height:86vh;
}
#mp-panel.open{ transform: translateY(0); }

/* Header / Body / Footer */
#mp-panel .hdr{ padding:.9rem 1rem .6rem; border-bottom:1px solid #e5e7eb; display:flex; align-items:center; justify-content:space-between; gap:.75rem; }
#mp-panel .hdr h5{ margin:0; font-weight:800; display:flex; align-items:center; gap:.5rem; }
#mp-panel .hdr .mp-icon{ width:20px; height:20px; }
#mp-panel .hdr .close{
  border:1px solid #e5e7eb; background:#f8f9fa; border-radius:10px; line-height:1;
  width:34px; height:34px; display:flex; align-items:center; justify-content:center;
}
#mp-panel .body{ padding:1rem; overflow-y:auto; -webkit-overflow-scrolling:touch; }
#mp-panel .ftr{ padding:.8rem 1rem; border-top:1px solid #e5e7eb; display:flex; gap:.5rem; }

/* Desktop => drawer latéral droit */
@media (min-width: 768px){
  #mp-panel{
    top:0; bottom:0; right:0; left:auto; width: min(640px, 92vw);
    border-radius:0; transform: translateX(100%);
  }
  #mp-panel.open{ transform: translateX(0); }
}

/* Freshy buttons */
.btn-freshy{
  border:0; border-radius:12px; padding:.6rem 1rem; font-weight:700; background:#FDE354;
  box-shadow:0 8px 20px rgba(253,227,84,.45);
}
.btn-freshy-secondary{ border:1px solid #e5e7eb; border-radius:12px; background:#fff; font-weight:700; }

/* Allergènes tags */
#mp-panel .tag{
  display:inline-block; margin:0 .35rem .35rem 0; padding:.35rem .6rem; border-radius:9999px;
  background:#f3f4f6; border:1px solid #e5e7eb; font-weight:600; font-size:.85rem;
}

/* Form bundle */
#mp-panel select.form-control{ border-radius:12px; border:1px solid #e5e7eb; padding:.6rem .85rem; }
#mp-panel .group > label{ font-weight:800; margin-bottom:.35rem; }

/* Groupes associés (LISTE RADIO COMPACTE) */
#mp-panel .cat-block{ margin-bottom:16px; }
#mp-panel .cat-title{ font-weight:800; margin:0 0 .5rem; }
#mp-panel .mp-radio-list{ display:grid; grid-template-columns:1fr; gap:8px; }

#mp-panel .mp-radio-item{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border:1px solid #e5e7eb; border-radius:12px; background:#fff;
  height:46px; min-height:46px; box-sizing:border-box;
}
#mp-panel .mp-radio-item .thumb{
  width:20px; height:20px; border-radius:6px; object-fit:cover; flex:0 0 20px;
}
#mp-panel .mp-radio-item .meta{
  flex:1; min-width:0; display:flex; align-items:center; gap:10px;
}
#mp-panel .mp-radio-item .name{
  font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
#mp-panel .mp-radio-item .price{
  font-size:.85rem; color:#6b7280; white-space:nowrap; margin-left:auto;
}
#mp-panel .mp-radio-item input[type="radio"]{
  margin-left:8px; width:16px; height:16px; flex:0 0 16px;
}
#mp-panel .mp-radio-item.is-checked{
  border-color:#10b981; box-shadow:0 0 0 2px rgba(16,185,129,.12) inset;
}

/* Compat : anciennes classes sans prefix mp- (radio-row/radio-list) */
#mp-panel .radio-list{ display:grid; grid-template-columns:1fr; gap:8px; }
#mp-panel .radio-row{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border:1px solid #e5e7eb; border-radius:12px; background:#fff;
  height:46px; min-height:46px; box-sizing:border-box;
}
#mp-panel .radio-row .thumb{ width:20px; height:20px; border-radius:6px; overflow:hidden; flex:0 0 20px; display:inline-block; }
#mp-panel .radio-row .thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
#mp-panel .radio-row .text{ flex:1; min-width:0; display:flex; align-items:center; gap:10px; }
#mp-panel .radio-row .name{ font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#mp-panel .radio-row .delta{ font-size:.85rem; color:#6b7280; white-space:nowrap; margin-left:auto; }
#mp-panel .radio-row input[type="radio"]{ margin-left:8px; width:16px; height:16px; flex:0 0 16px; }
#mp-panel .radio-row.selected{ border-color:#10b981; box-shadow:0 0 0 2px rgba(16,185,129,.12) inset; }

/* Safe area iOS */
@supports (padding: max(0px)) {
  #mp-panel .ftr{ padding-bottom: max(.8rem, env(safe-area-inset-bottom)); }
}

/* Page carte */
    .categories-menu{display:flex;gap:.5rem;overflow-x:auto;padding:.5rem 0;margin:0 0 1rem 0}
    .category-chip{display:inline-flex;align-items:center;gap:.5rem;padding:.35rem .6rem;border:1px solid #e5e7eb;border-radius:9999px;background:#fff;text-decoration:none;color:#111;white-space:nowrap}
    .category-chip.active{border-color:#28a745;background:#f3fff6}
    .chip-icon{width:24px;height:24px;object-fit:cover;border-radius:50%}
    .chip-label{font-weight:600;font-size:.9rem}

    .products-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));grid-gap:14px}
    .product-card{border:1px solid #eee;border-radius:14px;overflow:hidden;position:relative}
    /* Panneau des choix (viandes, sauces, suppléments) */
    #mp-panel .ftr{position:relative;align-items:center}
    #mp-panel .ftr > .alert,#mp-panel .ftr > .mp-ch-error{position:absolute;left:12px;right:12px;bottom:calc(100% + 8px);margin:0;padding:9px 12px;border-radius:12px;font-size:.86rem;font-weight:600;line-height:1.35;z-index:6;box-shadow:0 10px 24px rgba(15,23,42,.14)}
    #mp-panel .ftr > .mp-ch-error{background:#fff1f2;color:#9f1239;border:1px solid #fecdd3}
    #mp-panel .ftr > .mp-ch-error[hidden]{display:none}
    #mp-panel .ftr > .btn{white-space:nowrap}
    /* Pied du panneau : le bouton principal prend la place, « Annuler » reste compact, le prix ne déborde jamais. */
    /* .ftr.ftr.ftr : l'emporte sur la grille du thème (.mp-freshy #mp-panel .ftr) qui plaçait Continuer dans la colonne étroite. */
    #mp-panel .ftr.ftr.ftr{display:flex!important;gap:8px!important;flex-wrap:nowrap!important}
    #mp-panel .ftr.ftr.ftr > .btn{width:auto!important;margin:0!important}
    #mp-panel .ftr.ftr.ftr > .btn-freshy-secondary{flex:0 0 auto!important;padding-left:16px!important;padding-right:16px!important}
    #mp-panel .ftr.ftr.ftr > .btn-freshy:not(.btn-freshy-secondary){flex:1 1 auto!important;min-width:0}
    #mp-panel .ftr .mp-ch-submit{flex:1 1 auto!important;min-width:0;display:flex!important;align-items:center;justify-content:space-between;gap:8px;min-height:48px;padding:6px 8px 6px 16px!important;overflow:hidden}
    #mp-panel .mp-ch-submit > span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis}
    #mp-panel .mp-ch-total{flex:none;font-weight:800;font-size:.88rem;padding:6px 10px;border-radius:999px;background:rgba(0,0,0,.1);white-space:nowrap}
    #mp-panel .mp-ch-total:empty{display:none}
    #mp-panel .mp-ch-submit:has(.mp-ch-total:empty){justify-content:center}
    /* Déclinaisons (taille, nombre de viandes…) : même style que les choix */
    #mp-panel .cat-block[data-attr-id]{border:1px solid #e5e7eb;border-radius:16px;padding:12px;margin-bottom:14px;background:#fff}
    #mp-panel .cat-block[data-attr-id] .cat-title{font-weight:800;font-size:.98rem;margin:0 0 10px}
    #mp-panel .radio-row{height:auto!important;min-height:48px!important;padding:10px 12px!important;border:1px solid #e5e7eb!important;border-radius:12px!important;background:#fff!important;box-shadow:none!important;transition:border-color .15s,background .15s}
    #mp-panel .radio-row input[type="radio"]{-webkit-appearance:none;appearance:none;order:-1;flex:0 0 20px!important;width:20px!important;height:20px!important;margin:0!important;border:2px solid #cbd5e1;border-radius:50%;background:#fff;cursor:pointer}
    #mp-panel .radio-row input[type="radio"]:checked{border-color:#16a34a;background:#16a34a;box-shadow:inset 0 0 0 4px #fff}
    #mp-panel .radio-row.selected{border-color:#16a34a!important;background:#f0fdf4!important}
    #mp-panel .radio-row.selected .name{color:#14532d}
    #mp-panel .radio-row.disabled{opacity:.4}
    #mp-panel .radio-row .name{font-weight:600}
    #mp-panel .cat-block .hint{display:block;margin-top:8px;color:#64748b;font-size:.8rem}
    #mp-panel .mp-ch-submit.is-incomplete{opacity:.72}
    :is(#mp-panel,.mp-pd) .mp-ch-group{border:1px solid #e5e7eb;border-radius:16px;padding:12px;margin-bottom:14px;background:#fff;scroll-margin:16px}
    :is(#mp-panel,.mp-pd) .mp-ch-group.is-flash{animation:mpChFlash 1.2s ease}
    @keyframes mpChFlash{0%,60%{box-shadow:0 0 0 3px rgba(225,29,72,.35);border-color:#fb7185}100%{box-shadow:none}}
    :is(#mp-panel,.mp-pd) .mp-ch-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:10px}
    :is(#mp-panel,.mp-pd) .mp-ch-title{font-weight:800;font-size:.98rem}
    :is(#mp-panel,.mp-pd) .mp-ch-req{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;background:#fef3c7;color:#92400e;font-size:.7rem;font-weight:700;vertical-align:middle}
    :is(#mp-panel,.mp-pd) .mp-ch-rule{color:#64748b;font-size:.8rem;margin-top:2px}
    :is(#mp-panel,.mp-pd) .mp-ch-count{flex:none;min-width:40px;text-align:center;padding:3px 10px;border-radius:999px;background:#f1f5f9;color:#475569;font-weight:800;font-size:.8rem}
    :is(#mp-panel,.mp-pd) .mp-ch-count:empty{display:none}
    :is(#mp-panel,.mp-pd) .mp-ch-count.is-ok{background:#dcfce7;color:#166534}
    :is(#mp-panel,.mp-pd) .mp-ch-list{display:grid;gap:8px}
    :is(#mp-panel,.mp-pd) .mp-ch-opt{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #e5e7eb;border-radius:12px;cursor:pointer;user-select:none;transition:border-color .15s,background .15s,opacity .15s}
    :is(#mp-panel,.mp-pd) .mp-ch-opt.is-on{border-color:#16a34a;background:#f0fdf4}
    :is(#mp-panel,.mp-pd) .mp-ch-opt.is-locked{opacity:.45;cursor:not-allowed}
    :is(#mp-panel,.mp-pd) .mp-ch-mark{flex:none;width:20px;height:20px;border:2px solid #cbd5e1;border-radius:6px;display:inline-flex;align-items:center;justify-content:center}
    :is(#mp-panel,.mp-pd) .mp-ch-opt.is-single .mp-ch-mark{border-radius:50%}
    :is(#mp-panel,.mp-pd) .mp-ch-opt.is-on .mp-ch-mark{background:#16a34a;border-color:#16a34a}
    :is(#mp-panel,.mp-pd) .mp-ch-opt.is-on .mp-ch-mark::after{content:'';width:6px;height:10px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg) translate(-1px,-1px)}
    :is(#mp-panel,.mp-pd) .mp-ch-opt.is-single.is-on .mp-ch-mark::after{width:8px;height:8px;border:0;border-radius:50%;background:#fff;transform:none}
    :is(#mp-panel,.mp-pd) .mp-ch-name{flex:1;font-weight:600}
    :is(#mp-panel,.mp-pd) .mp-ch-price{color:#475569;font-size:.85rem;font-weight:700;white-space:nowrap}
    :is(#mp-panel,.mp-pd) .mp-ch-step{display:inline-flex;align-items:center;gap:6px}
    :is(#mp-panel,.mp-pd) .mp-ch-btn{width:30px;height:30px;border-radius:50%;border:1px solid #cbd5e1;background:#fff;font-weight:800;line-height:1;padding:0}
    :is(#mp-panel,.mp-pd) .mp-ch-btn:disabled{opacity:.35}
    :is(#mp-panel,.mp-pd) .mp-ch-q{min-width:16px;text-align:center;font-weight:800}
    /* Parcours v5 : en-tête produit et vignettes des choix */
    #mp-panel .mp-ch-product{display:flex;gap:12px;align-items:center;margin:0 0 14px;padding:10px;border:1px solid #e5e7eb;border-radius:16px;background:#fff}
    #mp-panel .mp-ch-product__img{width:88px;height:88px;flex:none;border-radius:12px;object-fit:cover}
    #mp-panel .mp-ch-product__copy{min-width:0}
    #mp-panel .mp-ch-product__name{font-weight:800;font-size:1.05rem}
    #mp-panel .mp-ch-product__desc{margin:4px 0 0;color:#64748b;font-size:.85rem;line-height:1.4;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
    #mp-panel .mp-ch-product__price{margin-top:6px;font-weight:800}
    #mp-panel .mp-ch-thumb{width:44px;height:44px;flex:none;border-radius:10px;object-fit:cover}
    #mp-panel .mp-ch-fixed .mp-ch-head{margin-bottom:0}
    .product-card.is-unavailable .image-container img{filter:grayscale(1);opacity:.55}
    .product-card.is-unavailable .card-body{opacity:.6}
    .product-card.is-unavailable .mask .badge{opacity:.6;text-decoration:line-through}
    .mp-unavailable-ribbon{position:absolute;top:10px;left:50%;transform:translateX(-50%);max-width:calc(100% - 20px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;z-index:3;padding:7px 14px;box-shadow:0 6px 18px rgba(0,0,0,.18);border-radius:999px;background:rgba(17,24,39,.82);color:#fff;font-size:.8rem;font-weight:700;text-align:center;letter-spacing:.01em;pointer-events:none}
    /* Au centre de la photo : ne recouvre ni les badges (en haut) ni le prix (en bas). */
    html:not(.mp-layout-gastro):not(.mp-layout-brasserie):not(.mp-layout-pizzeria):not(.mp-layout-xxl) .image-container>.mp-unavailable-ribbon{top:50%;transform:translate(-50%,-50%)}
    .product-image{width:100%;height:auto;display:block}
    .mask{position:absolute;left:8px;bottom:8px;background:rgba(0,0,0,.8);color:#fff;border-radius:10px;padding:6px 10px;font-weight:700}
    .add-to-cart-smart{position:absolute;right:8px;bottom:8px;width:44px;height:44px;border-radius:10px;border:none;background:#FDE354;display:flex;align-items:center;justify-content:center}
    .add-to-cart-smart .mp-icon{width:18px;height:18px}

    .goog-te-banner-frame { display:none !important; }
    body { top:0 !important; }
    /* radios list UI (variations & associés) */
    .cat-block{margin-bottom:14px}
    .cat-title{font-weight:600;margin-bottom:6px}
    .radio-list{display:flex;flex-direction:column;gap:8px}
    .radio-row{display:flex;align-items:center;gap:10px;padding:8px;border:1px solid #eee;border-radius:10px;cursor:pointer}
    .radio-row.selected{border-color:#28a745;background:#f7fff9}
    .radio-row.disabled{opacity:.5;pointer-events:none}
    .mp-status-wrap{margin:10px auto 22px;}

.product-description-wrap{
  margin-bottom: .5rem;
}

.product-description-desktop{
  display: none !important;
}

.product-description-mobile{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .55rem;
  line-height: 1.5;
}

.product-description-mobile__text{
  display: block;
  width: 100%;
}

.product-description-trigger{
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .45rem .85rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  color: #2f3c7e;
  box-shadow: 0 8px 18px rgba(47, 60, 126, .14);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1;
}

.product-description-trigger__label{
  display: inline-block;
}

.product-description-trigger:hover,
.product-description-trigger:focus{
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(47, 60, 126, .18);
  color: #1f2a5c;
  outline: none;
}

.mp-desc-full{
  white-space: pre-line;
  color: #4b5563;
  line-height: 1.7;
}

@media (max-width: 767.98px){
  .product-description-trigger{
    font-size: .81rem;
    padding: .42rem .8rem;
  }
}
