/* VivaHome Cart + Checkout unified OCMOD v2.1.0. One shared style. */

/* VivaHome Cart + Checkout Compact Product Card v1.9.3 */
#q-checkout .vh180-legacy{
  position:absolute!important;
  left:-10000px!important;
  top:0!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
  clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
}
#q-checkout .vh180-card{
  position:relative;background:#fff;border:1px solid #dce6ef;border-radius:18px;
  box-shadow:0 4px 14px rgba(19,72,122,.07);padding:14px;box-sizing:border-box;
  --vh180-img-w:112px;--vh180-img-h:168px;
}
#q-checkout .vh180-delete{
  position:absolute!important;top:10px!important;right:10px!important;width:32px!important;height:32px!important;
  min-width:32px!important;min-height:32px!important;padding:0!important;border:0!important;background:transparent!important;
  color:#df3851!important;z-index:6!important;box-shadow:none!important;
}
#q-checkout .vh180-delete i,#q-checkout .vh180-delete svg{font-size:24px!important;}
#q-checkout .vh180-hero{display:grid;grid-template-columns:var(--vh180-img-w) minmax(0,1fr);gap:12px;align-items:start;padding-right:32px;}
#q-checkout .vh180-image{width:var(--vh180-img-w);height:var(--vh180-img-h);overflow:hidden;border-radius:10px;background:#f4f7fa;}
#q-checkout .vh180-image img{display:block;width:100%;height:100%;object-fit:cover;border-radius:10px;image-rendering:auto;}
#q-checkout .vh180-head{min-width:0;display:flex;flex-direction:column;align-items:flex-start;}
#q-checkout .vh180-title{margin:1px 0 5px;color:#122b55;font-weight:500;font-size:15px;line-height:1.24;white-space:normal;overflow-wrap:anywhere;}
#q-checkout a.vh180-title{display:block;text-decoration:none!important;color:#122b55!important;}
#q-checkout a.vh180-title:hover,#q-checkout a.vh180-title:focus{color:#1875d2!important;text-decoration:none!important;}
#q-checkout .vh180-model{margin:0 0 8px;color:#7b8792;font-size:11.5px;line-height:1.25;}
#q-checkout .vh180-price{margin-top:5px;color:#1667c7;font-weight:800;font-size:18px;line-height:1.12;white-space:nowrap;max-width:100%;letter-spacing:-.2px;}
#q-checkout .vh180-vqty{
  margin-top:10px;display:grid;grid-template-columns:30px 34px 30px;align-items:center;justify-items:center;gap:6px;
  min-height:40px;padding:3px 6px;border:2px solid #dfeaf5;border-radius:999px;background:#fff;box-sizing:border-box;
  width:max-content;max-width:100%;
}
#q-checkout .vh180-qbtn{
  width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;padding:0!important;
  border:2px solid #acd0ef!important;border-radius:50%!important;background:#fff!important;color:#1875d2!important;
  font-size:18px!important;line-height:1!important;box-shadow:none!important;
}
#q-checkout .vh180-qvalue{color:#173d73;font-weight:700;font-size:17px;line-height:1;text-align:center;min-width:24px;}

#q-checkout .vh180-options{margin-top:10px;border:1px solid #dce8f2;border-radius:15px;overflow:hidden;background:#f8fbfd;}
#q-checkout .vh180-options-toggle{width:100%;min-height:40px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 11px;border:0;background:#edf4fa;color:#173d73;font-size:12.5px;font-weight:700;text-align:left;box-shadow:none;cursor:pointer;}
#q-checkout .vh180-options-toggle-left{display:flex;align-items:center;gap:8px;min-width:0;}
#q-checkout .vh180-options-toggle-icon{width:18px;height:18px;flex:0 0 18px;position:relative;}
#q-checkout .vh180-options-toggle-icon:before{content:"";position:absolute;left:2px;right:2px;top:3px;height:2px;background:#1875d2;border-radius:2px;box-shadow:0 4px 0 #1875d2,0 8px 0 #1875d2,0 12px 0 #1875d2;}
#q-checkout .vh180-chevron{width:8px;height:8px;border-right:2px solid #1875d2;border-bottom:2px solid #1875d2;transform:rotate(45deg);transition:transform .18s ease;margin-right:3px;}
#q-checkout .vh180-options.is-open .vh180-chevron{transform:rotate(225deg);margin-top:5px;}
#q-checkout .vh180-options-body{display:none;padding:6px;background:#f8fbfd;}
#q-checkout .vh180-options.is-open .vh180-options-body{display:grid;grid-template-columns:1fr;gap:5px;}
#q-checkout .vh180-attr{display:flex;align-items:center;gap:7px;min-height:30px;padding:5px 9px;border-radius:12px;background:#fff;box-sizing:border-box;font-size:11.5px;line-height:1.2;color:#303b45;}
#q-checkout .vh180-icon{width:17px;height:17px;flex:0 0 17px;background-color:#1875d2;-webkit-mask-image:var(--vh-icon);mask-image:var(--vh-icon);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:contain;mask-size:contain;}
#q-checkout .vh180-label{font-weight:700;color:#173d73;white-space:nowrap;}
#q-checkout .vh180-value{min-width:0;color:#303b45;overflow-wrap:anywhere;}

@media(max-width:420px){
  #q-checkout .vh180-card{padding:12px;--vh180-img-w:112px;--vh180-img-h:168px;}
  #q-checkout .vh180-hero{gap:10px;padding-right:29px;}
  #q-checkout .vh180-title{font-size:14px;font-weight:500;}
  #q-checkout .vh180-model{font-size:10.8px;margin-bottom:7px;}
  #q-checkout .vh180-price{font-size:17px;}
  #q-checkout .vh180-vqty{grid-template-columns:28px 32px 28px;gap:4px;min-height:38px;padding:3px 5px;margin-top:8px;}
  #q-checkout .vh180-qbtn{width:26px!important;height:26px!important;min-width:26px!important;min-height:26px!important;font-size:17px!important;}
  #q-checkout .vh180-qvalue{font-size:16px;min-width:22px;}
  #q-checkout .vh180-options-toggle{font-size:12px;min-height:38px;}
  #q-checkout .vh180-attr{font-size:11.2px;}
}
@media(min-width:768px){
  #q-checkout .vh180-card{padding:16px;--vh180-img-w:135px;--vh180-img-h:202px;}
  #q-checkout .vh180-title{font-size:17px;font-weight:500;}
  #q-checkout .vh180-model{font-size:12.5px;}
  #q-checkout .vh180-price{font-size:17px;}
  #q-checkout .vh180-options-toggle{font-size:13px;}
  #q-checkout .vh180-attr{font-size:12.5px;min-height:32px;}
}


/* v1.9.6 - linked product titles must never be visually truncated */
#q-checkout .vh180-card .vh180-head > a.vh180-title,
#q-checkout .vh180-card a.vh180-title {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  -webkit-box-orient: initial !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}


/* v1.9.7 - mobile balance: smaller image + compact quantity + price alignment */
@media (max-width: 420px) {
  #q-checkout .vh180-card {
    --vh180-img-w: 100px !important;
    --vh180-img-h: 150px !important;
  }

  #q-checkout .vh180-hero {
    gap: 10px !important;
    align-items: start !important;
  }

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

  #q-checkout .vh180-qbtn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    font-size: 16px !important;
    border-width: 2px !important;
  }

  #q-checkout .vh180-qvalue {
    font-size: 15px !important;
    min-width: 20px !important;
  }

  #q-checkout .vh180-price {
    margin-top: 4px !important;
  }
}

/* Checkout-only shell normalization. The visual component above remains identical to cart v1.9.3. */
#q-checkout.wrap.checkout .vh-checkout-product-card {
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
}
#q-checkout.wrap.checkout li.vh-checkout-product-item {
  height: auto !important;
  min-height: 0 !important;
}
#q-checkout.wrap.checkout ul.vh-hpqc-product-list {
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns: minmax(0,1fr) !important;
  box-sizing: border-box !important;
}
#q-checkout.wrap.checkout ul.vh-hpqc-product-list > li.vh-checkout-product-item,
#q-checkout.wrap.checkout .vh-checkout-product-card,
#q-checkout.wrap.checkout .vh180-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* 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;
  }
}

/* v2.1.0: Checkout expanded product options now match Cart exactly.
   The former v2.0.1 padding:0 override must NOT be installed with this package.
   Desktop only; leave mobile, coupons, tax and checkout calculations unchanged. */
@media (min-width: 768px) {
  #q-checkout .vh-checkout-product-card .vh180-options-body {
    padding: 6px !important;
    margin: 0 !important;
    background: #f8fbfd !important;
    box-sizing: border-box !important;
  }
  #q-checkout .vh-checkout-product-card .vh180-options.is-open .vh180-options-body {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 5px !important;
  }
  #q-checkout .vh-checkout-product-card .vh180-options-body > .vh180-attr {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    width: 100% !important;
    min-height: 32px !important;
    padding: 5px 9px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    font-size: 12.5px !important;
    line-height: 1.2 !important;
  }
}
