/* VivaHome Cart / Checkout shared product presentation + Cart coupon accordion
   v2.0.0 -- visual changes only, preserving HPQC elements and events.
*/

/* These selectors intentionally standardize ONLY the DESKTOP product collection.
   Mobile Cart/Checkout v1.9.7/v1.2.3 remain unchanged. */
@media (min-width: 768px) {
  #q-checkout .left-cart ul.list-product,
  #q-checkout .left-cart ul.vh-hpqc-product-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    list-style: none !important;
    box-sizing: border-box !important;
  }

  #q-checkout .left-cart li.vh-cart-product-item,
  #q-checkout .left-cart li.vh-checkout-product-item {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
  }

  #q-checkout .left-cart .vh-cart-product-card,
  #q-checkout .left-cart .vh-checkout-product-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 12px !important;
    border: 1px solid #e1e7ee !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 3px 12px rgba(20, 64, 110, .045) !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  /* Same actual product card CSS in both contexts, using the Cart as baseline. */
  #q-checkout .left-cart .vh180-card {
    --vh180-img-w: 135px !important;
    --vh180-img-h: 202px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    border: 1px solid #dce6ef !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 4px 14px rgba(19, 72, 122, .07) !important;
    overflow: visible !important;
  }

  #q-checkout .left-cart .vh180-hero {
    display: grid !important;
    grid-template-columns: 135px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: start !important;
    padding-right: 32px !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  #q-checkout .left-cart .vh180-image {
    width: 135px !important;
    height: 202px !important;
    max-width: 135px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  #q-checkout .left-cart .vh180-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 10px !important;
  }

  #q-checkout .left-cart .vh180-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    min-width: 0 !important;
  }

  #q-checkout .left-cart .vh180-card a.vh180-title {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    margin: 1px 0 5px !important;
    color: #122b55 !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    line-height: 1.24 !important;
    text-decoration: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    overflow-wrap: anywhere !important;
  }

  #q-checkout .left-cart .vh180-model {
    margin: 0 0 8px !important;
    color: #7b8792 !important;
    font-size: 12.5px !important;
    line-height: 1.25 !important;
  }

  #q-checkout .left-cart .vh180-price {
    margin-top: 5px !important;
    color: #1667c7 !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    line-height: 1.12 !important;
    white-space: nowrap !important;
  }

  #q-checkout .left-cart .vh180-vqty {
    margin-top: 10px !important;
    margin-left: 0 !important;
    grid-template-columns: 30px 34px 30px !important;
    min-height: 40px !important;
    padding: 3px 6px !important;
    gap: 6px !important;
  }

  #q-checkout .left-cart .vh180-options {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 10px !important;
    box-sizing: border-box !important;
  }

  #q-checkout .left-cart .vh180-options-toggle {
    min-height: 40px !important;
    font-size: 13px !important;
  }

  #q-checkout .left-cart .vh180-delete {
    top: 10px !important;
    right: 10px !important;
  }
}

/* Cart page: preserve the original coupon element as a direct child of
   #product-total; its native input, apply/remove buttons and AJAX handlers
   are intentionally never reparented or replaced. */
#q-checkout .right-cart #product-total > .vh-coupon-card.vhcc-coupon-ready,
#q-checkout .right-cart .vh-coupon-card.vhcc-coupon-ready {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  align-self: start !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

#q-checkout .vh-coupon-card.vhcc-coupon-ready > h6 {
  display: none !important;
}

#q-checkout .vh-coupon-card.vhcc-coupon-ready > .vhcc-coupon-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 5px 2px !important;
  border: 0 !important;
  background: transparent !important;
  color: #203d5d !important;
  text-align: left !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

#q-checkout .vhcc-coupon-arrow {
  display: inline-block;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #1875d2;
  border-bottom: 2px solid #1875d2;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
  margin-right: 4px;
}
#q-checkout .vh-coupon-card.vhcc-coupon-ready:not(.vhcc-coupon-closed) .vhcc-coupon-arrow {
  transform: translateY(2px) rotate(225deg);
}

#q-checkout .vh-coupon-card.vhcc-coupon-ready.vhcc-coupon-closed > :not(.vhcc-coupon-toggle) {
  display: none !important;
}

#q-checkout .vh-coupon-card.vhcc-coupon-ready:not(.vhcc-coupon-closed) > :not(.vhcc-coupon-toggle):not(h6) {
  margin-top: 8px;
}

@media (max-width: 767px) {
  #q-checkout .vh-coupon-card.vhcc-coupon-ready > .vhcc-coupon-toggle {
    min-height: 36px !important;
    font-size: 14px !important;
  }
}
