/* Sac cadeau du panier (module ad_giftbag) — maquette « Panier · choix du sac cadeau » */

.agb,
.agb-modal {
  --agb-primary: #17474c;
  --agb-soft: #e3ecec;
  --agb-line: #c9d6d6;
  --agb-text: #2f3d3f;
  --agb-muted: #566668;
  --agb-idle: #839da0;
  color: var(--agb-text);
}

.agb {
  margin-bottom: 1rem;
}

.agb,
.agb *,
.agb-modal,
.agb-modal * {
  font-family: "Montserrat", sans-serif;
}

.agb [hidden],
.agb-modal[hidden],
.agb-modal [hidden] {
  display: none !important;
}

html.agb-lock,
html.agb-lock body {
  overflow: hidden;
}

/* Encart */

/* L'encart reprend la structure d'une ligne produit (.cart-container > .product-line-grid) :
   la taille et la position de l'image viennent des règles du thème, comme pour les photos
   produit. Seuls le fond et l'alignement vertical sont propres au module. La bordure garde
   son épaisseur pour que les décalages restent identiques à ceux de la liste. */
#cart .cart-grid .cart-grid-body .agb .agb-teaser {
  margin: 0;
  border-color: transparent;
  background: var(--agb-soft);
}

#cart .agb .agb-teaser .product-line-grid.row {
  align-items: center;
}

.agb .agb-teaser__img {
  height: auto;
  object-fit: cover;
  background: #fff;
}

.agb-teaser__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.agb-teaser__title {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  color: var(--agb-primary);
}

.agb-teaser__text {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
}

.agb-teaser__text--summary,
.agb-teaser__text--summary strong {
  font-weight: 600;
  color: var(--agb-primary);
}

.agb-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  margin-top: 2px;
  padding: 0 18px 0 20px;
  border: 1px solid var(--agb-primary);
  border-radius: 22px;
  background: #fff;
  color: var(--agb-primary);
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.agb-pill:disabled {
  opacity: 0.6;
  cursor: progress;
}

.agb-teaser__error {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #b3261e;
}

.agb-pill:not(:disabled):hover,
.agb-pill:not(:disabled):focus-visible {
  background: var(--agb-primary);
  color: #fff;
}

/* Pop-up */

.agb-modal {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 110px 24px 24px;
  overflow-y: auto;
  font-family: "Montserrat", sans-serif;
}

.agb-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 71, 76, 0.45);
}

.agb-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1080px;
  box-sizing: border-box;
  padding: 28px 32px 24px;
  background: #fff;
  outline: none;
}

.agb-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: -14px;
}

.agb-modal__intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-right: 60px;
}

.agb-modal__title {
  margin: 0;
  padding-top: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--agb-primary);
}

.agb-modal__lead {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
}

.agb-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  color: var(--agb-primary);
}

.agb-notice svg {
  flex: none;
}

.agb-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--agb-primary);
  cursor: pointer;
}

.agb-modal__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.agb-scale {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--agb-muted);
}

.agb-grid-wrap {
  overflow-x: auto;
}

.agb-grid {
  display: grid;
  grid-template-columns: repeat(var(--agb-cols, 5), minmax(150px, 1fr));
  gap: 12px;
}

.agb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px 14px;
  border: 2px solid var(--agb-line);
  border-radius: 6px;
  background: #fff;
  text-align: center;
  transition: background-color 0.15s, border-color 0.15s;
}

.agb-card.is-selected {
  border-color: var(--agb-primary);
  background: var(--agb-soft);
}

.agb-card__shape {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 104px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--agb-line);
  color: var(--agb-primary);
}

.agb-card__shape svg {
  display: block;
  width: calc(var(--w) * 1px);
  height: calc(var(--h) * 1px);
}

.agb-card__shape--photo {
  align-items: center;
  height: 140px;
}

.agb-card__photo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.agb-card__fill {
  fill: var(--agb-idle);
  transition: fill 0.15s;
}

.agb-card.is-selected .agb-card__fill {
  fill: var(--agb-primary);
}

.agb-card__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.agb-card__label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--agb-primary);
}

.agb-card__dims {
  font-size: 12px;
  line-height: 17px;
  color: var(--agb-muted);
}

.agb-card__advice {
  min-height: 51px;
  font-size: 12px;
  line-height: 17px;
}

.agb-card__price {
  font-size: 15px;
  font-weight: 600;
  color: var(--agb-primary);
}

.agb-card__price--inline {
  display: none;
}

.agb-qty {
  display: flex;
  align-items: center;
  margin-top: 4px;
  border: 1px solid var(--agb-line);
  border-radius: 3px;
  background: #fff;
}

.agb-qty button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--agb-primary);
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.agb-qty button:disabled {
  opacity: 0.35;
  cursor: default;
}

.agb-qty span {
  width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.agb-modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--agb-line);
}

.agb-modal__recap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agb-modal__recap-main {
  font-size: 13px;
  font-weight: 600;
  color: var(--agb-primary);
}

.agb-modal__hint {
  font-size: 12px;
  color: var(--agb-muted);
}

.agb-modal__error {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #b3261e;
}

.agb-modal__actions {
  display: flex;
  gap: 12px;
}

.agb-btn {
  height: 44px;
  padding: 0 20px;
  border-radius: 3px;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.agb-btn--ghost {
  border: 1px solid var(--agb-primary);
  background: #fff;
  color: var(--agb-primary);
}

.agb-btn--primary {
  padding: 0 28px;
  border: 0;
  background: var(--agb-primary);
  color: #fff;
}

.agb-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Même marge intérieure que la liste des produits sur petit écran (custom_2026.css) */
@media (max-width: 600px) {
  #cart .agb .agb-teaser .cart__card-body {
    padding: 0.75rem;
  }
}

/* Mobile : encart compact, pop-up plein écran, sacs en liste */

@media (max-width: 767.98px) {
  .agb-teaser__body {
    gap: 6px;
  }

  .agb-teaser__title {
    font-size: 14px;
    line-height: 19px;
  }

  .agb-teaser__text {
    font-size: 12px;
    line-height: 17px;
  }

  .agb-pill {
    gap: 8px;
    padding: 0 14px 0 16px;
    font-size: 11px;
  }

  .agb-modal {
    padding: 0;
    overflow: hidden;
  }

  .agb-modal__dialog {
    gap: 0;
    height: 100%;
    max-width: none;
    padding: 0;
  }

  .agb-modal__head {
    align-items: center;
    margin-bottom: 0;
    padding: 12px 8px 12px 16px;
    border-bottom: 1px solid var(--agb-line);
  }

  .agb-modal__intro {
    gap: 4px;
    margin: 0 0 4px;
  }

  .agb-modal__lead {
    font-size: 12px;
    line-height: 17px;
    color: var(--agb-muted);
  }

  .agb-notice {
    margin: 0;
  }

  .agb-modal__title {
    font-size: 14px;
  }

  .agb-modal__body {
    flex: 1 1 auto;
    gap: 8px;
    padding: 14px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .agb-scale {
    display: none;
  }

  .agb-grid-wrap {
    overflow: visible;
  }

  .agb-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .agb-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 8px 10px 10px;
    text-align: left;
  }

  .agb-card__shape {
    height: 72px;
    margin-bottom: 0;
  }

  .agb-card__shape--photo {
    height: 56px;
  }

  .agb-card__shape svg {
    width: calc(var(--w) * 0.7px);
    height: calc(var(--h) * 0.7px);
  }

  .agb-card__info {
    align-items: flex-start;
    gap: 2px;
  }

  .agb-card__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .agb-card__label,
  .agb-card__price {
    font-size: 13px;
  }

  .agb-card__price--inline {
    display: inline;
  }

  .agb-card__price--block {
    display: none;
  }

  .agb-card__dims {
    font-size: 11px;
    line-height: 16px;
  }

  .agb-card__advice {
    min-height: 0;
    line-height: 16px;
  }

  .agb-qty {
    margin-top: 0;
  }

  .agb-qty button {
    height: 44px;
    font-size: 18px;
  }

  .agb-qty span {
    width: 18px;
  }

  .agb-modal__foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px 20px;
  }

  .agb-modal__hint {
    display: none;
  }

  .agb-modal__actions .agb-btn--ghost {
    display: none;
  }

  .agb-modal__actions .agb-btn--primary {
    flex: 1;
    height: 48px;
  }
}
