
/* =====================================================
   TENUTA MAGNA - CARRELLO
   ===================================================== */

/* Pulsante carrello nell'intestazione */

.tm-cart-nav-item {
  display: flex;
  align-items: center;
  margin-left: 12px;
}

#tm-cart-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 25px;
  padding: 6px 10px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

#tm-cart-trigger:hover {
  background: #fff;
  color: #333;
}

.tm-cart-icon {
  font-size: 15px;
}

#tm-cart-count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 50px;
  background: #b58b48;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.tm-cart-floating-trigger {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 999;
}

/* Pulsanti acquisto nelle card */

.tm-cart-product-actions {
  margin-top: 13px;
  text-align: center;
}

.tm-cart-product-price {
  margin-bottom: 9px;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
}

.tm-cart-add {
  display: inline-block;
  border: 0;
  border-radius: 4px;
  padding: 10px 18px;
  background: #a98243;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease;
}

.tm-cart-add:hover {
  background: #886a36;
  color: #fff;
}

.tm-cart-unavailable {
  display: inline-block;
  color: #ddd;
  font-size: 13px;
  font-style: italic;
}

/* Acquisto nella scheda prodotto */

.tm-cart-detail-actions {
  margin: 20px 0 25px;
  padding: 18px;
  border: 1px solid #e5e0d7;
  border-radius: 6px;
  background: #faf9f6;
}

.tm-cart-detail-price {
  margin-bottom: 12px;
  color: #94713d;
  font-size: 25px;
  font-weight: 700;
}

.tm-cart-detail-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tm-cart-detail-row label {
  margin: 0;
  font-weight: 600;
}

#tm-detail-quantity {
  width: 75px;
  height: 40px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px;
  text-align: center;
}

.tm-cart-pack-note {
  margin: 12px 0 0;
  color: #666;
  font-size: 13px;
}

/* Pannello carrello */

#tm-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  visibility: hidden;
  pointer-events: none;
}

#tm-cart-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.tm-cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0;
  transition: opacity .25s ease;
}

#tm-cart-overlay.is-open .tm-cart-backdrop {
  opacity: 1;
}

.tm-cart-drawer {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: 460px;
  max-width: 100%;
  height: 100%;
  padding: 0;
  background: #fff;
  box-shadow: -5px 0 25px rgba(0,0,0,.15);
  transform: translateX(100%);
  transition: transform .3s ease;
}

#tm-cart-overlay.is-open .tm-cart-drawer {
  transform: translateX(0);
}

.tm-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid #e8e8e8;
}

.tm-cart-header h2 {
  margin: 0;
  color: #333;
  font-size: 22px;
  font-weight: 600;
}

.tm-cart-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f1f1f1;
  color: #333;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.tm-cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Carrello vuoto */

.tm-cart-empty {
  padding: 55px 15px;
  color: #666;
  text-align: center;
}

.tm-cart-empty-icon {
  margin-bottom: 15px;
  font-size: 40px;
}

/* Prodotti nel carrello */

.tm-cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  padding: 15px 0;
  border-bottom: 1px solid #e9e9e9;
}

.tm-cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #666;
  font-size: 13px;
}

.tm-cart-item-info strong {
  color: #333;
  font-size: 15px;
}

.tm-cart-item-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.tm-cart-item-controls button {
  width: 29px;
  height: 29px;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #fff;
  color: #333;
  font-size: 19px;
  cursor: pointer;
}

.tm-cart-item-controls span {
  min-width: 18px;
  color: #333;
  font-weight: 700;
  text-align: center;
}

.tm-cart-item-subtotal {
  grid-column: 1 / 2;
  color: #94713d;
  font-size: 14px;
  font-weight: 700;
}

.tm-cart-remove {
  grid-column: 2 / 3;
  justify-self: end;
  border: 0;
  background: transparent;
  color: #9b4545;
  font-size: 12px;
  cursor: pointer;
}

/* Riepilogo */

.tm-cart-summary {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

.tm-cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #555;
  font-size: 14px;
}

.tm-cart-total strong {
  color: #94713d;
  font-size: 16px;
  font-weight: 500;
}

/* Totale finale da pagare */

.tm-cart-grand-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 113, 61, 0.3);
  color: #333;
  font-size: 17px;
  font-weight: 600;
}

.tm-cart-grand-total strong {
  color: #94713d;
  font-size: 24px;
  font-weight: 700;
}

.tm-cart-shipping {
  margin: 12px 0;
  color: #777;
  font-size: 12px;
}

.tm-cart-bottles {
  margin-top: 17px;
  color: #333;
  font-size: 14px;
}

.tm-cart-rule {
  margin-top: 12px;
  border-radius: 4px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.tm-cart-rule.valid {
  background: #edf6ed;
  color: #286b35;
}

.tm-cart-rule.invalid {
  background: #fff5e7;
  color: #865a20;
}

.tm-cart-next-step {
  margin-top: 17px;
  color: #777;
  font-size: 12px;
  line-height: 1.5;
}

/* Blocca lo scorrimento della pagina quando il carrello è aperto */

body.tm-cart-lock {
  overflow: hidden;
}

/* Adattamento smartphone */

@media (max-width: 767px) {
.tm-cart-nav-item {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0 8px 0 0;
}

#tm-cart-trigger .tm-cart-label {
  display: none;
}

#tm-cart-trigger {
  padding: 7px 9px;
  gap: 5px;
}

  .tm-cart-floating-trigger {
    top: 12px;
    right: 12px;
  }

  #tm-cart-trigger {
    padding: 7px 11px;
    font-size: 13px;
  }

  .tm-cart-drawer {
    width: 100%;
  }

  .tm-cart-content {
    padding: 16px;
  }

  .tm-cart-detail-row {
    align-items: stretch;
  }

  .tm-cart-detail-row .tm-cart-add {
    width: 100%;
  }
}


/* ===== CHECKOUT ===== */

.tm-checkout h3,
.tm-checkout-success h3 {
  margin: 0 0 10px;
  color: #4b4031;
  font-size: 21px;
}

.tm-checkout > p {
  margin-bottom: 20px;
  color: #777;
  font-size: 14px;
}

.tm-checkout-field {
  display: block;
  margin-bottom: 14px;
}

.tm-checkout-field span {
  display: block;
  margin-bottom: 6px;
  color: #554a3a;
  font-size: 13px;
  font-weight: 600;
}

.tm-checkout-field input {
  display: block;
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid #d8d0c2;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.tm-checkout-field input:focus {
  outline: none;
  border-color: #a88a53;
  box-shadow: 0 0 0 2px rgba(168, 138, 83, 0.13);
}

.tm-checkout-required {
  color: #888;
  font-size: 12px;
}

.tm-checkout-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.tm-checkout-actions button,
.tm-checkout-start {
  min-height: 44px;
  padding: 11px 16px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.tm-checkout-start,
.tm-checkout-submit {
  background: #927544;
  color: #fff;
}

.tm-checkout-start {
  width: 100%;
  margin-top: 18px;
}

.tm-checkout-start:hover,
.tm-checkout-submit:hover {
  background: #765d35;
}

.tm-checkout-back {
  background: #eee9df;
  color: #554a3a;
}

.tm-checkout-submit {
  flex: 1;
}

.tm-checkout-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.tm-checkout-error {
  margin: 15px 0;
  padding: 12px;
  border: 1px solid #d9aaa3;
  border-radius: 4px;
  background: #fbefed;
  color: #8d3027;
  font-size: 14px;
}

/* Riepilogo ordine creato */

.tm-checkout-success {
  padding: 10px 0;
  text-align: center;
}

.tm-checkout-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #e8efe5;
  color: #55744b;
  font-size: 27px;
}

.tm-checkout-success > p {
  color: #777;
  font-size: 14px;
  line-height: 1.6;
}

.tm-checkout-order-number {
  margin: 22px 0;
  padding: 15px;
  border: 1px solid #e1d8c8;
  border-radius: 4px;
  background: #f8f5ef;
}

.tm-checkout-order-number span,
.tm-checkout-order-number strong {
  display: block;
}

.tm-checkout-order-number span {
  margin-bottom: 5px;
  color: #777;
  font-size: 12px;
}

.tm-checkout-order-number strong {
  color: #55452f;
  font-size: 19px;
}

.tm-checkout-order-details {
  padding: 15px 0;
  border-top: 1px solid #e8e2d8;
  border-bottom: 1px solid #e8e2d8;
  text-align: left;
}

.tm-checkout-order-details > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  font-size: 14px;
}

.tm-checkout-order-details span {
  color: #777;
}

.tm-checkout-order-details strong {
  color: #443b30;
}

.tm-checkout-order-details .tm-checkout-grand-total {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid #e8e2d8;
  font-size: 17px;
}

.tm-checkout-grand-total strong {
  color: #765d35;
}

.tm-checkout-pending {
  margin-top: 20px;
  padding: 12px;
  border-radius: 4px;
  background: #f7f1e5;
  color: #705b37 !important;
}

.tm-checkout-expiry {
  font-size: 12px !important;
}

.tm-checkout-next {
  margin-top: 18px;
  font-size: 13px !important;
}

@media (max-width: 480px) {
  .tm-checkout-actions {
    flex-direction: column-reverse;
  }

  .tm-checkout-actions button {
    width: 100%;
  }
}

/* Prezzo separato dalla sezione del pulsante */
.tm-cart-product-price {
  margin: 13px 0 9px;
  text-align: center;
}

/* Link privacy e condizioni nel checkout */
/* Testo e link delle dichiarazioni nel checkout */
.tm-checkout-age {
  font-size: 13px;
}

.tm-checkout-age a {
  color: #94713d;
  text-decoration: none;
  font-weight: 600;
}

.tm-checkout-age a:hover {
  color: #c8ad7c;
  text-decoration: none;
}


.tm-cart-delivery {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #55452f;
}

.tm-cart-delivery i {
  font-size: 19px;
  color: #94713d;
  flex-shrink: 0;
}