/*
 * Harmonia Tea - Instantio Side Cart
 * File:
 * wp-content/themes/hello-elementor-child/assets/css/harmonia-side-cart.css
 */

:root {
  --ht-night: #000410;
  --ht-gold: #ffd28e;
  --ht-gold-soft: #f5c28f;
  --ht-cream: #fffaf3;
  --ht-line: rgba(0, 4, 16, 0.12);
  --ht-muted: rgba(0, 4, 16, 0.62);
}

/* DRAWER / OVERLAY */
.ins-checkout-popup .ins-checkout-overlay {
  background: rgba(0, 4, 16, 0.72) !important;
  backdrop-filter: blur(1px);
}

.ins-checkout-popup .ins-checkout-layout {
  width: min(470px, 100vw) !important;
  max-width: 470px !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  background: var(--ht-cream) !important;
  color: var(--ht-night) !important;
  box-shadow: -18px 0 45px rgba(0, 4, 16, 0.18) !important;
}

/* HEADER */
.ins-checkout-popup .header-wrap {
  position: sticky !important;
  top: 0;
  z-index: 20;
  background: var(--ht-cream) !important;
  border-bottom: 1px solid var(--ht-line);
}

.ins-checkout-popup .ins-checkout-header {
  min-height: 72px;
  padding: 0 22px !important;
  display: grid !important;
  grid-template-columns: 36px 1fr 36px;
  align-items: center !important;
  gap: 12px;
  background: transparent !important;
}

.ins-checkout-popup .ins-checkout-header-title {
  color: var(--ht-night) !important;
  font-family: "Open Sans", sans-serif !important;
  font-size: 21px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-align: center;
}

.ins-checkout-popup .ins-checkout-header-icon,
.ins-checkout-popup .ins-checkout-close {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.ins-checkout-popup .ins-checkout-header-icon svg,
.ins-checkout-popup .ins-checkout-close svg {
  width: 24px !important;
  height: 24px !important;
}

.ins-checkout-popup .ins-checkout-header-icon path,
.ins-checkout-popup .ins-checkout-close path {
  fill: var(--ht-night) !important;
}

/* BODY */
.ins-checkout-popup .ins-content {
  background: var(--ht-cream) !important;
}

.ins-checkout-popup .ins-cart-content-wrap {
  padding: 12px 18px 0 !important;
}

.ins-checkout-popup .ins-cart-item-heading {
  display: none !important;
}

.ins-checkout-popup .ins-single-cart-wrap {
  display: flex !important;
  flex-direction: column;
  gap: 0;
}

.ins-checkout-popup .ins-single-cart-item {
  position: relative;
  display: grid !important;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  grid-template-areas:
    "image product total"
    "image qty total";
  gap: 10px 15px;
  align-items: center;
  padding: 22px 6px 22px 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ht-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.ins-checkout-popup .ins-cart-remove {
  position: absolute !important;
  top: 12px;
  right: 0;
  z-index: 3;
}

.ins-checkout-popup .ins-cart-item-remove a {
  width: 26px;
  height: 26px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: transparent !important;
}

.ins-checkout-popup .ins-single-item-remove svg {
  width: 15px !important;
  height: 15px !important;
}

.ins-checkout-popup .ins-single-item-remove path {
  fill: var(--ht-muted) !important;
}

.ins-checkout-popup .ins-cart-item-product {
  display: contents !important;
}

.ins-checkout-popup .ins-cart-item-image {
  grid-area: image;
  width: 86px !important;
  height: 106px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ins-checkout-popup .ins-cart-item-image a {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.ins-checkout-popup .ins-cart-item-image img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: contain !important;
  margin: 0 !important;
}

.ins-checkout-popup .ins-cart-item-title {
  grid-area: product;
  min-width: 0;
  padding-right: 28px;
  color: var(--ht-night) !important;
  font-family: "Open Sans", sans-serif !important;
}

.ins-checkout-popup .ins-cart-item-title > a {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--ht-night) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
}

.ins-checkout-popup .ht-cart-product-meta {
  margin-top: 3px;
}

.ins-checkout-popup .ht-cart-product-subtitle {
  color: var(--ht-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.ins-checkout-popup .ht-cart-product-weight {
  margin-top: 4px;
  color: var(--ht-night);
  font-size: 12px;
  font-weight: 700;
}

.ins-checkout-popup .ht-cart-product-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: var(--ht-muted);
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
}

.ins-checkout-popup .ht-cart-product-stock-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4caf50;
}

.ins-checkout-popup .ht-cart-product-stock.is-out-of-stock .ht-cart-product-stock-dot {
  background: #b42318;
}

.ins-checkout-popup .ins-cart-price {
  display: none !important;
}

.ins-checkout-popup .ins-cart-item-quantity {
  grid-area: qty;
  display: flex !important;
  align-items: center;
  gap: 7px;
  margin: 0 !important;
}

.ins-checkout-popup .ins-cart-minus,
.ins-checkout-popup .ins-cart-plus {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: rgba(0, 4, 16, 0.08) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.ins-checkout-popup .ins-cart-minus svg,
.ins-checkout-popup .ins-cart-plus svg {
  width: 17px !important;
  height: 17px !important;
}

.ins-checkout-popup .ins-cart-qty-wrap .quantity {
  margin: 0 !important;
}

.ins-checkout-popup .ins-cart-qty-wrap input.qty {
  width: 56px !important;
  height: 32px !important;
  min-height: 32px !important;
  margin: 0 !important;
  padding: 0 5px !important;
  border: 1px solid var(--ht-night) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--ht-night) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-align: center !important;
}

.ins-checkout-popup .ins-cart-item-total {
  grid-area: total;
  align-self: end;
  padding: 0 4px 5px 10px !important;
  color: var(--ht-night) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

/* FOOTER / TOTALS */
.ins-checkout-popup .ins-cart-footer-wrap {
  padding: 0 18px 120px !important;
  background: var(--ht-cream) !important;
}

.ins-checkout-popup .ins-cart-footer-content {
  padding-top: 18px;
}

.ins-checkout-popup .ins-footer-cart-button {
  display: block !important;
}

.ins-checkout-popup .ins-cart-coupon {
  margin: 0 0 15px !important;
}

.ins-checkout-popup .ins-cart-coupon .coupon {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.ins-checkout-popup .ins-cart-coupon input.input-text {
  width: 100% !important;
  height: 44px !important;
  border: 1px solid rgba(0, 4, 16, 0.25) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--ht-night) !important;
  padding: 0 12px !important;
}

.ins-checkout-popup .ins-cart-coupon button[name="apply_coupon"] {
  min-height: 44px !important;
  padding: 0 15px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: var(--ht-gold) !important;
  color: var(--ht-night) !important;
  font-weight: 800 !important;
}

.ins-checkout-popup .ins-cart-coupon-updated-cart {
  display: none !important;
}

.ins-checkout-popup .ins-empty-cart-button {
  margin: 0 0 18px;
}

.ins-checkout-popup .ins-empty-cart {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(0, 4, 16, 0.28) !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--ht-night) !important;
  font-weight: 700 !important;
}

.ins-checkout-popup .ins-cart-collaterals {
  padding: 0 !important;
}

.ins-checkout-popup .cart_totals {
  width: 100% !important;
}

.ins-checkout-popup .cart_totals h2 {
  margin: 0 0 12px !important;
  color: var(--ht-night) !important;
  font-size: 17px !important;
  font-weight: 800 !important;
}

.ins-checkout-popup .cart_totals table {
  width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
}

.ins-checkout-popup .cart_totals th,
.ins-checkout-popup .cart_totals td {
  padding: 11px 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--ht-line) !important;
  background: transparent !important;
  color: var(--ht-night) !important;
  font-size: 14px !important;
}

.ins-checkout-popup .cart_totals td {
  text-align: right !important;
}

.ins-checkout-popup .cart_totals .order-total th,
.ins-checkout-popup .cart_totals .order-total td {
  font-size: 18px !important;
  font-weight: 800 !important;
}

.ins-checkout-popup .ins-cart-btns {
  position: fixed !important;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: min(470px, 100vw) !important;
  max-width: 470px !important;
  padding: 14px 18px !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(255, 250, 243, 0.97) !important;
  border-top: 1px solid var(--ht-line);
  backdrop-filter: blur(8px);
}

.ins-checkout-popup .ins-cart-btns a {
  min-height: 48px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

.ins-checkout-popup .ins-cart-btns .view-cart {
  border: 1px solid var(--ht-night) !important;
  background: transparent !important;
  color: var(--ht-night) !important;
}

.ins-checkout-popup .ins-cart-btns .checkout {
  border: 1px solid var(--ht-gold) !important;
  background: var(--ht-gold) !important;
  color: var(--ht-night) !important;
}

/* EMPTY STATE */
.ins-checkout-popup .ins-cart-empty {
  padding: 80px 30px !important;
  color: var(--ht-night) !important;
  text-align: center !important;
}

.ins-checkout-popup .ins-cart-empty span {
  color: var(--ht-night) !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
}

.ins-checkout-popup .ins-cart-empty a {
  color: var(--ht-night) !important;
  font-weight: 800 !important;
  text-decoration-color: var(--ht-gold) !important;
}

/* MOBILE */
@media (max-width: 767px) {
  .ins-checkout-popup .ins-checkout-layout {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  .ins-checkout-popup .ins-checkout-header {
    min-height: 66px;
    padding: 0 16px !important;
  }

  .ins-checkout-popup .ins-checkout-header-title {
    font-size: 19px !important;
  }

  .ins-checkout-popup .ins-cart-content-wrap {
    padding: 8px 14px 0 !important;
  }

  .ins-checkout-popup .ins-single-cart-item {
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 9px 12px;
    padding: 18px 4px 18px 0 !important;
  }

  .ins-checkout-popup .ins-cart-item-image {
    width: 76px !important;
    height: 94px !important;
  }

  .ins-checkout-popup .ins-cart-item-title > a {
    font-size: 14px !important;
  }

  .ins-checkout-popup .ht-cart-product-subtitle {
    font-size: 11px;
  }

  .ins-checkout-popup .ins-cart-minus,
  .ins-checkout-popup .ins-cart-plus {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
  }

  .ins-checkout-popup .ins-cart-qty-wrap input.qty {
    width: 48px !important;
    height: 30px !important;
    min-height: 30px !important;
  }

  .ins-checkout-popup .ins-cart-item-total {
    font-size: 14px !important;
  }

  .ins-checkout-popup .ins-cart-footer-wrap {
    padding: 0 14px calc(104px + env(safe-area-inset-bottom)) !important;
  }

  .ins-checkout-popup .ins-cart-btns {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) !important;
    grid-template-columns: 1fr;
  }

  .ins-checkout-popup .ins-cart-btns .view-cart {
    display: none !important;
  }

  .ins-checkout-popup .ins-cart-btns a {
    min-height: 52px;
    font-size: 15px !important;
  }
}

/* ==========================================================
   HARMONIA SIDE CART — V3 REFINEMENT
   ========================================================== */

/* HEADER TITLE */
.ins-checkout-header-title {
  color: var(--ht-night) !important;
  font-weight: 800 !important;
}

/* FORCE ACTION BUTTON COLORS */
.ins-cart-btns a.view-cart,
.ins-cart-btns .view-cart,
.ins-cart-btns a.checkout,
.ins-cart-btns .checkout,
.ins-cart-btns a.active {
  box-shadow: none !important;
  text-decoration: none !important;
}

.ins-cart-btns a.view-cart,
.ins-cart-btns .view-cart {
  background: transparent !important;
  color: var(--ht-night) !important;
  border: 1px solid var(--ht-night) !important;
}

.ins-cart-btns a.checkout,
.ins-cart-btns .checkout {
  background: var(--ht-gold) !important;
  color: var(--ht-night) !important;
  border: 1px solid var(--ht-gold) !important;
}

.ins-cart-btns a.checkout:hover,
.ins-cart-btns .checkout:hover {
  background: var(--ht-gold-soft) !important;
  border-color: var(--ht-gold-soft) !important;
}

/* PROMO CODE — COMPACT ACCORDION */
.ins-cart-coupon {
  margin: 0 0 10px !important;
}

.ht-cart-coupon-toggle {
  width: 100%;
  min-height: 44px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-top: 1px solid var(--ht-line);
  border-bottom: 1px solid var(--ht-line);
  background: transparent;
  color: var(--ht-night);
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.ht-cart-coupon-toggle::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  transition: transform .2s ease;
}

.ht-cart-coupon-toggle.is-open::after {
  transform: rotate(45deg);
}

.ins-cart-coupon .coupon {
  display: none !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  padding-top: 12px;
}

.ins-cart-coupon.is-open .coupon {
  display: grid !important;
}

.ins-cart-coupon input.input-text {
  min-width: 0 !important;
  height: 42px !important;
}

.ins-cart-coupon button[name="apply_coupon"] {
  min-height: 42px !important;
  background: var(--ht-gold) !important;
  color: var(--ht-night) !important;
  border: 1px solid var(--ht-gold) !important;
  white-space: nowrap;
}

/* EMPTY CART BUTTON — DEMOTE TO TEXT ACTION */
.ins-empty-cart-button {
  margin: 6px 0 18px !important;
  text-align: right;
}

.ins-empty-cart {
  width: auto !important;
  min-height: 0 !important;
  padding: 4px 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: rgba(0, 4, 16, 0.58) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* TOTALS CLEANUP */
.cart_totals h2 {
  margin-top: 10px !important;
}

.cart_totals table tr:first-child th,
.cart_totals table tr:first-child td {
  border-top: 0 !important;
}

/* ==========================================================
   EMPTY CART - HARMONIA
   ========================================================== */

/* Quando Instantio dice che il carrello NON è vuoto */
.ins-cart-empty.hide {
  display: none !important;
}

/* Quando Instantio dice che il carrello È vuoto */
.ins-cart-empty.ins-show {
  min-height: 430px;
  padding: 110px 34px 70px !important;

  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  color: var(--ht-night) !important;
  text-align: center !important;
}

/*
 * Elimina definitivamente la faccina Instantio,
 * che viene creata tramite ::before sullo span.
 */
.ins-cart-empty span::before {
  display: none !important;
  content: none !important;
  background: none !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
}

/* Logo reale Harmonia */
.ht-empty-cart-brand {
  display: flex;
  align-items: center;
  justify-content: center;

  margin: 0 0 28px;
}

.ht-empty-cart-brand img {
  display: block !important;

  width: auto !important;
  height: auto !important;

  max-width: 110px !important;
  max-height: 90px !important;

  margin: 0 auto !important;

  object-fit: contain;
}

.ins-cart-empty .ht-empty-cart-message {
  margin: 0;

  color: var(--ht-night);
  font-family: "Open Sans", sans-serif;

  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.ins-cart-empty .ht-empty-cart-shop-link {
  display: inline-block;

  margin-top: 14px;

  color: var(--ht-night) !important;

  font-size: 14px;
  font-weight: 800;

  text-decoration: underline;
  text-decoration-color: var(--ht-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

@media (max-width: 767px) {

  .ins-cart-empty.ins-show {
    min-height: 58vh;
    padding: 90px 24px 60px !important;
  }

  .ht-empty-cart-brand img {
    max-width: 95px !important;
    max-height: 80px !important;
  }

}

/* MOBILE */
@media (max-width: 767px) {
  .ins-cart-btns {
    background: var(--ht-cream) !important;
  }

  .ins-cart-btns a.checkout,
  .ins-cart-btns .checkout {
    background: var(--ht-gold) !important;
    color: var(--ht-night) !important;
  }

  .ht-cart-coupon-toggle {
    font-size: 13px;
  }

  .ins-cart-coupon .coupon {
    grid-template-columns: 1fr !important;
  }

  .ins-cart-coupon button[name="apply_coupon"] {
    width: 100% !important;
  }

  .ins-cart-empty {
    min-height: 58vh;
    padding: 92px 24px 60px !important;
  }

  .ht-empty-cart-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
  }

  .ht-empty-cart-brand img {
    display: block !important;
    width: auto !important;
    max-width: 95px !important;
    max-height: 75px !important;
    margin: 0 auto !important;
    object-fit: contain;
  }

  /* Rimuove completamente l'illustrazione empty-state di Instantio */
  .ins-cart-empty svg,
  .ins-cart-empty img:not(.ht-empty-cart-logo),
  .ins-cart-empty-icon,
  .ins-empty-cart-icon,
  .ins-cart-empty-image {
    display: none !important;
  }
}

