/**
 * Livraison anticipée & ergonomie du tunnel - Aurone
 *
 * @author    Aurone
 * @copyright 2026
 * @license   Proprietary
 */

/* Jetons partagés par les blocs du module */
.asp-choice,
.asp-delay,
.asp-summary {
  --asp-accent: #2f665f;
  --asp-accent-soft: #eaf1ef;
  --asp-ink: #1f2326;
  --asp-text: #4a5056;
  --asp-muted: #8a9096;
  --asp-line: #e3e3e3;
}

/* ===================================================================== */
/* Ligne du panier : case « Livraison anticipée »                        */
/* ===================================================================== */
/* Rangée pleine largeur sous la ligne, alignée sur le texte du produit. */

.asp-choice-row {
  clear: both;
  float: left;
  width: 100%;
  padding: 4px 15px 14px;
}

.asp-choice {
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: left;
}

.asp-choice__label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--asp-line);
  border-radius: 10px;
  background: #fff;
  font-weight: 400;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.asp-choice__label:hover {
  border-color: #c5cbc9;
}

.asp-choice--checked .asp-choice__label {
  border-color: var(--asp-accent);
  background: var(--asp-accent-soft);
  box-shadow: 0 0 0 3px rgba(47, 102, 95, 0.08);
}

.asp-choice--loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Case native masquée, remplacée par une case dessinée. */
.asp-choice__checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.asp-choice__box {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 2px solid #b9bfc4;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.asp-choice__box::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 6px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s;
}

.asp-choice__checkbox:checked + .asp-choice__box {
  border-color: var(--asp-accent);
  background: var(--asp-accent);
}

.asp-choice__checkbox:checked + .asp-choice__box::after {
  transform: rotate(45deg) scale(1);
}

.asp-choice__checkbox:focus-visible + .asp-choice__box {
  box-shadow: 0 0 0 3px rgba(47, 102, 95, 0.25);
}

.asp-choice__label,
.asp-choice__body,
.asp-choice__text,
.asp-choice__help {
  text-align: left;
}

.asp-choice__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.asp-choice__text {
  color: var(--asp-ink);
  font-size: 0.9375rem;
  font-weight: 700;
}

.asp-choice__help {
  color: var(--asp-text);
  font-size: 0.8125rem;
}

.asp-choice__fee {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2f2f2;
  color: var(--asp-text);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.asp-choice__fee--free {
  background: var(--asp-accent);
  color: #fff;
}

@media (max-width: 575px) {
  .asp-choice__label {
    flex-wrap: wrap;
  }

  .asp-choice__fee {
    margin-left: 36px;
  }
}

/* ===================================================================== */
/* Ligne du panier : colonne « délai de livraison »                      */
/* ===================================================================== */

.asp-delay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 12px;
  border: 1px solid var(--asp-line);
  border-radius: 12px;
  background: #fff;
  line-height: 1.2;
  text-align: center;
}

.asp-delay__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--asp-muted);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.asp-delay__value {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.asp-delay__number {
  color: var(--asp-ink);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.asp-delay__unit {
  color: var(--asp-text);
  font-size: 0.75rem;
}

.asp-delay__text {
  color: var(--asp-ink);
  font-size: 0.8125rem;
  font-weight: 700;
}

.asp-delay__dates {
  color: var(--asp-muted);
  font-size: 0.6875rem;
}

.asp-delay__tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Produit éligible non coché : le délai court est grisé, il ne s'appliquera
   que si la case est cochée. */
.asp-delay--inactive {
  border-style: dashed;
  background: transparent;
}

.asp-delay--inactive .asp-delay__number,
.asp-delay--inactive .asp-delay__unit {
  color: #b3b8bc;
}

.asp-delay--inactive .asp-delay__tag {
  background: #f0f0f0;
  color: #8a9096;
}

/* Livraison anticipée choisie */
.asp-delay--early {
  border-color: var(--asp-accent);
  background: var(--asp-accent-soft);
}

.asp-delay--early .asp-delay__number {
  color: var(--asp-accent);
}

.asp-delay--early .asp-delay__tag {
  background: var(--asp-accent);
  color: #fff;
}

.asp-delay-col {
  float: left;
  width: 100%;
  padding: 8px 15px 0;
}

@media (min-width: 768px) {
  .product-line-grid.asp-has-delay > .product-line-grid-left {
    width: 22%;
  }

  .product-line-grid.asp-has-delay > .product-line-grid-body {
    width: 42%;
  }

  .product-line-grid.asp-has-delay > .product-line-grid-right {
    width: 19%;
  }

  .product-line-grid.asp-has-delay > .asp-delay-col {
    width: 17%;
    padding: 0 12px 0 6px;
  }

  /* La case s'aligne sur le texte du produit, après la colonne image. */
  .product-line-grid > .asp-choice-row {
    padding-left: calc(22% + 15px);
  }
}

/* ===================================================================== */
/* Bloc des délais (panier et récapitulatif du tunnel)                   */
/* ===================================================================== */

.asp-summary {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--asp-line);
  border-radius: 12px;
  background: #fff;
  color: var(--asp-text);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.asp-summary:empty {
  display: none;
}

.asp-summary__eyebrow {
  margin: 0 0 4px;
  color: var(--asp-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.asp-summary__title {
  margin: 0;
  color: var(--asp-ink);
  font-size: 1rem;
}

.asp-summary__title strong {
  color: var(--asp-accent);
}

.asp-summary__note {
  margin: 6px 0 0;
  color: var(--asp-muted);
  font-size: 0.75rem;
}

/* Frise des deux envois */
.asp-steps {
  position: relative;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.asp-steps__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 0 12px 22px;
}

.asp-steps__item:last-child {
  padding-bottom: 0;
}

/* Trait vertical reliant les deux envois */
.asp-steps__item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: -2px;
  left: 5px;
  width: 2px;
  background: var(--asp-line);
}

.asp-steps__dot {
  position: absolute;
  top: 4px;
  left: 0;
  width: 12px;
  height: 12px;
  border: 2px solid #c3c8cc;
  border-radius: 50%;
  background: #fff;
}

.asp-steps__item--early .asp-steps__dot {
  border-color: var(--asp-accent);
  background: var(--asp-accent);
  box-shadow: 0 0 0 3px var(--asp-accent-soft);
}

.asp-steps__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 10px;
}

.asp-steps__name {
  color: var(--asp-ink);
  font-weight: 700;
}

.asp-steps__delay {
  color: var(--asp-ink);
  font-weight: 600;
  white-space: nowrap;
}

.asp-steps__item--early .asp-steps__delay {
  color: var(--asp-accent);
}

.asp-steps__product {
  overflow: hidden;
  color: var(--asp-muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asp-summary__fee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--asp-line);
}

.asp-summary__fee strong small {
  color: var(--asp-muted);
  font-weight: 400;
}

.asp-summary__pill {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--asp-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.asp-subtotal-detail {
  display: block;
  margin-top: 2px;
  color: #8a9096;
  font-size: 0.75rem;
  line-height: 1.35;
}

/* Historique et confirmation */
.asp-order__list {
  padding-left: 18px;
}

.asp-badge {
  display: inline-block;
  padding: 0 6px;
  border-radius: 3px;
  background: #2f665f;
  color: #fff;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* Dans la carte récapitulative du panier : même retrait que les autres blocs. */
.cart-summary > .asp-summary {
  margin: 0 10px 14px;
}

/* Mobile : la pastille de délai passe sur une ligne, sous le produit. */
@media (max-width: 767px) {
  .asp-delay {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px;
    padding: 8px 12px;
  }

  .asp-delay__value {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
  }

  .asp-delay__number {
    font-size: 1.125rem;
  }
}
