/**
 * THOTIKA / Upmotion - Recapitulatif commun au panier et au checkout.
 * Charge apres le theme et les styles des etapes.
 */

@media (min-width: 1201px) {
  body#cart .container_cart_details > .cart-grid-right {
    flex: 0 0 22rem;
    min-width: 0;
  }
}

:is(body#cart, body#checkout) .cart-grid-right .th-summary {
  --th-color: #104745;
  --th-muted: #778885;
  --th-line: #e9eeec;
  --th-mint: #e0faf0;
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--th-color);
  background: #fff;
  border: 1px solid #eef0ee;
  border-radius: 20px;
  box-shadow: none;
  overflow: hidden;
}

:is(body#cart, body#checkout) .cart-grid-right .th-summary,
:is(body#cart, body#checkout) .cart-grid-right .th-summary *,
:is(body#cart, body#checkout) .cart-grid-right .th-summary *::before,
:is(body#cart, body#checkout) .cart-grid-right .th-summary *::after {
  box-sizing: border-box;
}

:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-total::before {
  content: none;
}

/* Supprime les encadrements, marges et padding de la carte du theme */
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__main {
  padding: 23px 23px 0 !important;
  margin: 0 !important;
  background: transparent;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-summary-top:empty { display: none; }

/* Titre + nombre d'articles */
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__title {
  padding: 0;
  margin: 0;
  color: var(--th-color);
  font-size: 20px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -.45px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__count {
  flex: none;
  font-size: 12px;
  font-weight: 400;
  color: var(--th-muted);
  white-space: nowrap;
}

/* Ligne "Votre commande / Masquer les details" */
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__products-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 9px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__products-label {
  color: var(--th-muted);
  font-size: 13px;
  line-height: 1.5;
}
/* Lien stable pour tous les etats : evite les styles de hover du theme. */
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle,
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle:link,
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle:visited,
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle:hover,
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle:focus,
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle:active {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px;
  min-height: 32px;
  padding: 5px 8px !important;
  margin: 0 -8px 0 0 !important;
  border: 0 !important;
  border-radius: 7px;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--th-color) !important;
  opacity: 1 !important;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.3 !important;
  text-decoration: none !important;
  text-transform: none !important;
  transform: none !important;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle:hover,
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle:focus-visible {
  color: #126e61 !important;
  background: #e9f8f2 !important;
  text-decoration: none !important;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle:focus-visible {
  outline: 2px solid #168d7b !important;
  outline-offset: 2px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle .material-icons,
:is(body#cart, body#checkout) .cart-grid-right .th-summary a.th-summary__toggle span {
  color: inherit !important;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__toggle .material-icons {
  font-size: 19px;
  transition: transform .2s ease;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__when-closed { display: none; }
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__toggle[aria-expanded="false"] .th-summary__when-open { display: none; }
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__toggle[aria-expanded="false"] .th-summary__when-closed { display: inline; }
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__toggle[aria-expanded="true"] .material-icons { transform: rotate(180deg); }

/* Ligne des produits */
:is(body#cart, body#checkout) .cart-grid-right .th-summary .media-list {
  padding: 0;
  margin: 0;
  list-style: none;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .media-list > .media {
  display: flex !important;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--th-line);
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .media-left {
  float: none !important;
  flex: 0 0 60px;
  width: 60px;
  padding: 0 !important;
  margin: 0 !important;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .media-left a,
:is(body#cart, body#checkout) .cart-grid-right .th-summary .media-left picture { display: block; }
:is(body#cart, body#checkout) .cart-grid-right .th-summary .media-object,
:is(body#cart, body#checkout) .cart-grid-right .th-summary .media-left img {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--th-line);
  border-radius: 9px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .media-body {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) max-content;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 3px 10px;
  flex: 1 1 0;
  width: auto !important;
  min-width: 0;
  overflow: visible;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .product-name {
  display: block;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  line-height: 1.42;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .product-name a {
  color: var(--th-color);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .product-name a:hover { text-decoration: underline; }
:is(body#cart, body#checkout) .cart-grid-right .th-summary .product-quantity {
  display: block;
  grid-column: 1;
  grid-row: 2;
  color: var(--th-muted);
  font-size: 12px;
  font-weight: 400;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .product-price {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
  float: none !important;
  color: var(--th-color);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .product-line-info {
  grid-column: 1 / -1;
  color: var(--th-muted);
  font-size: 12px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .media-body > br { display: none; }

/* Sous-total / Livraison */
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-summary-subtotals-container {
  margin: 0 !important;
  padding: 13px 0 14px !important;
  border: 0;
  background: transparent;
  border-bottom: none!important;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-summary-subtotals-container .cart-summary-line,
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-total .cart-summary-line {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) max-content !important;
  align-items: center;
  width: 100% !important;
  gap: 12px;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-summary-subtotals-container .cart-summary-line {
  min-height: 34px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-summary-line > .label,
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-summary-line > .value {
  display: block !important;
  float: none !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  line-height: 1.4;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-summary-line > .label {
  grid-column: 1;
  color: var(--th-muted);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-summary-line > .value {
  grid-column: 2;
  justify-self: end !important;
  color: var(--th-color);
  font-size: 14px;
  font-weight: 650;
  text-align: right !important;
  white-space: nowrap;
}

/* Total TTC - plus discret que v2 */
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-summary-totals {
  padding: 0 23px !important;
  margin: 0 !important;
  background: transparent !important;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-total {
  display: flex !important;
  flex-direction: column;
  align-items: center !important;
  padding: 14px 15px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 10px;
  background: var(--th-mint);
}
/* Centrage vertical robuste, independant des styles de lignes du theme. */
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-total > .cart-summary-line {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  gap: 12px !important;
  min-height: 28px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-total > .cart-summary-line > .label,
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-total > .cart-summary-line > .value {
  display: inline-flex !important;
  align-items: center !important;
  align-self: center !important;
  min-height: 28px;
  line-height: 1.2 !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  transform: none !important;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-total > .cart-summary-line > .value {
  margin-left: auto !important;
  text-align: right !important;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-total .label {
  color: var(--th-color);
  font-size: 14px;
  font-weight: 700;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-total .value {
  color: var(--th-color);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.45px;
}

/* Coupon sous forme de lien discret / depliable */
:is(body#cart, body#checkout) .cart-grid-right .th-summary .block-promo:not(.promo-highlighted) {
  padding: 13px 23px 0 !important;
  margin: 0 !important;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-voucher {
  padding: 13px 0 0 !important;
  border-top: 1px solid var(--th-line);
  text-align: left !important;
}

/* Le libelle peut revenir a la ligne ; montant et suppression restent groupes. */
:is(body#cart, body#checkout) .cart-grid-right .th-summary .promo-name {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0 0 12px;
  list-style: none;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .promo-name .th-voucher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin: 0;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .promo-name .th-voucher__name {
  color: var(--th-color);
  font-size: 13px;
  line-height: 1.4;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-voucher__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  float: none !important;
  white-space: nowrap;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .promo-name .th-voucher__amount {
  color: var(--th-color);
  font-size: 14px;
  font-weight: 650;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-voucher__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: var(--th-color);
  text-decoration: none;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-voucher__remove:hover {
  background: var(--th-mint);
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-voucher__remove :is(i, svg) {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  color: inherit;
  font-size: 20px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary :is(.th-voucher__remove, .collapse-button, .promo-input):focus-visible {
  outline: 2px solid var(--th-color);
  outline-offset: 3px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .display-promo {
  display: block;
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .display-promo .collapse-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 24px;
  color: var(--th-color);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .display-promo .collapse-button::after {
  content: "+";
  color: var(--th-muted);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary #promo-code { margin-top: 12px; }
:is(body#cart, body#checkout) .cart-grid-right .th-summary #promo-code .promo-code {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .promo-code form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .promo-input {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  height: 41px;
  padding: 0 12px;
  margin: 0;
  border: 1px solid #d8e5e0;
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  color: var(--th-color);
  box-shadow: none;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .promo-code form .btn {
  flex: 0 0 auto;
  min-height: 41px;
  margin: 0;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: var(--th-color);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .cancel-promo {
  display: inline-block;
  margin-top: 9px;
  color: var(--th-muted);
  font-size: 12px;
  text-decoration: none;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .js-error { margin: 10px 0 0; }

:is(body#cart, body#checkout) .cart-grid-right .th-summary .promo-highlighted {
  padding: 0;
  margin: 14px 0 8px;
  font-size: 12px;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .promo-discounts {
  padding: 0;
  margin: 0;
  list-style: none;
}

:is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-detailed-actions {
  padding: 20px 23px 23px;
}

body#checkout .cart-grid-right .th-summary {
  padding-bottom: 23px;
}

/* Reassurance dans la carte */
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__reassurance {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 16px;
  margin: 13px 23px 0;
  border-top: 1px solid var(--th-line);
  color: var(--th-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
:is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__reassurance svg {
  font-size: 17px;
  color: #169978;
}

@media (max-width: 767px) {
  :is(body#cart, body#checkout) .cart-grid-right .th-summary { border-radius: 17px; }
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__main { padding: 19px 17px 0 !important; }
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__heading { margin-bottom: 16px; }
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__title { font-size: 19px; }
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .media-left { flex-basis: 52px; width: 52px; }
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .media-object,
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .media-left img { width: 52px; height: 52px; }
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-summary-totals { padding: 0 17px !important; }
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-total .value { font-size: 20px; }
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .block-promo:not(.promo-highlighted) { padding: 13px 17px 0 !important; }
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .cart-detailed-actions { padding: 20px 17px 19px; }
  body#checkout .cart-grid-right .th-summary { padding-bottom: 19px; }
  :is(body#cart, body#checkout) .cart-grid-right .th-summary .th-summary__reassurance { margin: 13px 17px 0; }
}
