/* Boutique : liste des publications, fiche d'une publication, panier, commande, espace « Mes achats ».
   Valeurs relevées sur l'ancienne boutique : bleus #1c238a / #00afef, liens #0a6ebd, prix #02457D, bouton de validation #008CBA. */

.cerm-shop { max-width: 1180px; }
.cerm-shop h2 { text-transform: none; }
.cerm-muted { color: #8a8a8a; }
.cerm-low { color: #b45f00; }
.cerm-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.cerm-shop__intro { max-width: 820px; margin: 0 auto 22px; text-align: center; font-size: 15px; }

/* Boutons propres à la boutique */
.cerm-btn--checkout { background: #008CBA; }
.cerm-btn--checkout:hover { background: #006e93; }
.cerm-btn--big { padding: 14px 34px; font-size: 15px; min-height: 48px; }
.cerm-btn--small { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 6px 16px; font-size: 12px; letter-spacing: .5px; }
.cerm-link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; background: none; border: 0; padding: 6px 0; color: var(--cerm-link); font: inherit; font-weight: 600; cursor: pointer; }
.cerm-link-btn:hover, .cerm-link-btn:focus-visible { color: var(--cerm-danger); text-decoration: underline; }

/* Messages dans la page */
.cerm-notice { margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid var(--cerm-info); background: #eaf8fd; border-radius: 2px; color: #444; line-height: 1.5; }
.cerm-notice--warn { border-color: var(--cerm-warning); background: #fff7e0; }
.cerm-notice h2 { font-size: 17px; margin: 0 0 8px; }
.cerm-notice p { margin: 0 0 8px; }
.cerm-notice > :last-child { margin-bottom: 0; }
.cerm-notice i { margin-right: 6px; }
.cerm-badge--grey { background: #eceff4; color: #5e6578; }

/* Filtre Papier / Numérique */
.cerm-shop-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 18px; margin: 0 auto 30px; }
.cerm-shop-filter .cerm-btn { min-width: 150px; }

/* Grille de cartes : couverture portrait, prix gris centré, titre bleu en gras centré */
.cerm-shop-grid { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 34px 28px; }
.cerm-shop-grid--small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 24px 18px; }
.cerm-shop-card { display: flex; flex-direction: column; align-items: stretch; text-align: center; min-width: 0; }
.cerm-shop-card__image { display: block; line-height: 0; background: #fff; border: 1px solid #e3e7ee; padding: 6px; box-shadow: var(--cerm-shadow); transition: box-shadow .15s ease, transform .15s ease; }
.cerm-shop-card__image:hover { box-shadow: 0 8px 24px rgba(28, 35, 138, .18); transform: translateY(-2px); }
.cerm-shop-card__image img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: contain; background: #f6f7fb; }
.cerm-shop-card__noimg { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 4; font-size: 48px; color: #b9bfd6; background: #eceff4; }
.cerm-shop-card__price { margin: 12px 0 2px; font-size: 15px; line-height: 22px; color: #8a8a8a; }
.cerm-shop-card__title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700; color: var(--cerm-link); }
.cerm-shop-card__title a { color: var(--cerm-link); text-decoration: none; }
.cerm-shop-card__title a:hover, .cerm-shop-card__title a:focus-visible { color: var(--cerm-primary); text-decoration: underline; }
.cerm-shop-card--small .cerm-shop-card__title { font-size: 14px; line-height: 19px; }
.cerm-shop-card__tag { margin: 4px 0 0; font-size: 12px; line-height: 18px; color: #6b7280; }
.cerm-shop-card__tag--out { color: var(--cerm-danger); font-weight: 700; }

/* Fiche d'une publication : image à gauche, informations à droite, description dessous */
.cerm-product { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px 40px; align-items: start; }
.cerm-product__description { grid-column: 1 / -1; margin-top: 16px; padding-top: 18px; border-top: 1px solid #dde2ea; }
.cerm-gallery__main { display: block; line-height: 0; border: 1px solid #dde2ea; padding: 6px; background: #fff; box-shadow: var(--cerm-shadow); }
.cerm-gallery__main img { display: block; width: 100%; height: auto; }
.cerm-gallery__thumbs { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cerm-gallery__thumbs a { display: block; width: 72px; line-height: 0; border: 2px solid #dde2ea; padding: 2px; background: #fff; }
.cerm-gallery__thumbs a:hover, .cerm-gallery__thumbs a.is-current { border-color: var(--cerm-secondary); }
.cerm-gallery__thumbs img { display: block; width: 100%; height: auto; }
.cerm-gallery__none { display: flex; align-items: center; justify-content: center; min-height: 300px; font-size: 64px; color: #b9bfd6; background: #eceff4; }
.cerm-product__title { margin: 0 0 14px; font-size: clamp(22px, 4vw, 30px); line-height: 1.2; font-weight: 600; }
.cerm-product__price { margin: 0 0 6px; font-size: 32px; line-height: 1.2; font-weight: 700; color: #02457D; }
.cerm-stock { margin: 0 0 14px; font-weight: 600; }
.cerm-stock--ok { color: var(--cerm-success); }
.cerm-stock--low { color: #b45f00; }
.cerm-stock--out { color: var(--cerm-danger); }
.cerm-buy { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin: 16px 0; }
.cerm-buy .cerm-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.cerm-qty { width: 86px; min-height: 44px; padding: 8px 10px; border: 1px solid #c6cfdc; border-radius: 3px; background: #fff; color: #333; font: inherit; text-align: center; }
.cerm-qty:focus { border-color: var(--cerm-secondary); box-shadow: 0 0 0 3px rgba(0, 175, 239, .2); outline: 0; }
.cerm-product__note { margin: 0 0 12px; font-size: 13px; color: #7b8190; }
.cerm-product__facts { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid #e3e7ee; }
.cerm-product__facts > div { display: flex; gap: 8px; margin: 0 0 4px; }
.cerm-product__facts dt { flex: none; font-weight: 600; color: var(--cerm-primary); }
.cerm-product__facts dd { margin: 0; }
.cerm-shop-others { margin-top: 44px; padding-top: 24px; border-top: 1px solid #dde2ea; }
.cerm-shop-others__title { margin: 0 0 22px; text-align: center; font-size: 22px; }
.cerm-back { margin-top: 30px; }

/* Panier */
.cerm-empty-icon { margin: 0 0 6px; font-size: 48px; color: #b9bfd6; }
.cerm-cart__table td { vertical-align: middle; }
.cerm-cart__prod { display: flex; align-items: center; gap: 14px; }
.cerm-cart__thumb { flex: none; display: block; width: 64px; line-height: 0; border: 1px solid #e3e7ee; background: #fff; padding: 2px; }
.cerm-cart__thumb img { width: 100%; height: auto; display: block; }
.cerm-cart__noimg { display: flex; align-items: center; justify-content: center; height: 80px; font-size: 24px; color: #b9bfd6; }
.cerm-cart__name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cerm-cart__name small { font-size: 12px; color: #7b8190; font-weight: 400; }
.cerm-cart__name small.cerm-low { color: #b45f00; }
.cerm-cart__table .cerm-qty { width: 80px; }
.cerm-cart__remove { text-align: right; white-space: nowrap; }
.cerm-cart__update { margin: 14px 0 0; }
.cerm-cart__bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; align-items: start; }
.cerm-cart__bottom .cerm-card h2, .cerm-checkout .cerm-card h2 { margin: 0 0 14px; font-size: 19px; }
.cerm-cart__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 26px; }
.cerm-cart__actions form { margin: 0; }

/* Récapitulatif (panier, commande, confirmation) */
.cerm-summary__rows { margin: 0; }
.cerm-summary__rows > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid #edf0f6; }
.cerm-summary__rows dt { font-weight: 400; }
.cerm-summary__rows dd { margin: 0; font-weight: 600; text-align: right; }
.cerm-summary__rows > .cerm-summary__total { border-bottom: 0; font-size: 18px; }
.cerm-summary__total dt, .cerm-summary__total dd { font-weight: 700; color: var(--cerm-primary); }
.cerm-summary__items { list-style: none; margin: 0 0 10px; padding: 0; }
.cerm-summary__items li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed #e3e7ee; font-size: 14px; line-height: 20px; }
.cerm-summary__items li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.cerm-summary__items li span:last-child { white-space: nowrap; font-weight: 600; }
.cerm-summary__edit { margin: 12px 0 0; font-size: 13px; }

/* Commande */
.cerm-checkout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }
.cerm-checkout__main { display: grid; gap: 20px; min-width: 0; }
.cerm-checkout__side { position: sticky; top: 16px; }
.cerm-checkout .cerm-card { padding: 22px 24px; }
.cerm-checkout .cerm-actions { margin-top: 18px; }
.cerm-static { margin: 0; }
.cerm-billing { margin-top: 14px; }
.cerm-billing[hidden] { display: none !important; }
.cerm-pay { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.cerm-pay__option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid #c6cfdc; border-radius: 4px; background: #fff; cursor: pointer; }
.cerm-pay__option input { flex: none; width: 18px; height: 18px; margin-top: 4px; }
.cerm-pay__option:hover { border-color: var(--cerm-secondary); }
.cerm-pay__option:has(input:checked) { border-color: var(--cerm-secondary); background: #f1faff; box-shadow: 0 0 0 2px rgba(0, 175, 239, .2); }
.cerm-pay__text strong { display: block; color: var(--cerm-dark); }
.cerm-pay__text small { display: block; color: #6b7280; font-weight: 400; line-height: 1.45; }
.cerm-pay.has-error .cerm-pay__option { border-color: var(--cerm-danger); }

/* Confirmation et espace client */
.cerm-done__icon { margin: 0 0 6px; font-size: 56px; line-height: 1; color: var(--cerm-success); text-align: center; }
.cerm-done__icon--grey { color: #9aa0b0; }
.cerm-done h1, .cerm-done .cerm-lead { text-align: center; }
.cerm-done__subtitle { margin: 24px 0 10px; font-size: 19px; }
.cerm-order-no { color: var(--cerm-primary); font-size: 1.15em; letter-spacing: 1px; }
.cerm-bank { margin-top: 8px; padding: 10px 14px; background: #fff; border: 1px dashed #9fb0d4; }
.cerm-order__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 18px; margin: 0 0 18px; }
.cerm-order__facts > div { padding: 10px 12px; background: #f7f9fd; border-left: 3px solid var(--cerm-secondary); }
.cerm-order__facts dt { font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: #7b8190; }
.cerm-order__facts dd { margin: 2px 0 0; font-weight: 600; color: #333; }
.cerm-order__items td small { display: block; }
.cerm-order__totals { max-width: 360px; margin: 14px 0 0 auto; }
.cerm-order__addresses { margin-top: 12px; }
.cerm-order__addresses h3 { margin: 16px 0 6px; font-size: 15px; }
.cerm-order__addresses address { margin: 0; font-style: normal; line-height: 1.5; }
.cerm-order__help { margin-top: 24px; }
.cerm-done .cerm-actions { margin-top: 26px; }

/* Responsive */
@media (max-width: 991.98px) {
  .cerm-checkout { grid-template-columns: 1fr; }
  .cerm-checkout__side { position: static; order: -1; }
}
@media (max-width: 767.98px) {
  .cerm-product { grid-template-columns: 1fr; }
  .cerm-gallery { max-width: 360px; margin: 0 auto; }
  .cerm-cart__bottom { grid-template-columns: 1fr; }
  .cerm-cart__table td.cerm-cart__product { display: block; text-align: left; }
  .cerm-cart__table td.cerm-cart__product::before, .cerm-cart__table td.cerm-cart__remove::before { content: none; }
  .cerm-cart__table td.cerm-cart__remove { justify-content: flex-end; }
  .cerm-cart__actions { flex-direction: column; align-items: stretch; }
  .cerm-cart__actions .cerm-btn, .cerm-cart__actions form .cerm-btn { width: 100%; }
  .cerm-order__totals { max-width: none; }
  .cerm-order__items td { text-align: right; }
  .cerm-order__items td:first-child { text-align: left; display: block; }
  .cerm-order__items td:first-child::before { content: none; }
}
@media (max-width: 575.98px) {
  .cerm-shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .cerm-shop-grid--small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cerm-product__price { font-size: 28px; }
  .cerm-buy .cerm-btn { flex: 1 1 auto; justify-content: center; }
  .cerm-checkout .cerm-card { padding: 18px 14px; }
}
