/**
 * Cart page — match original SiteGiant cart (reference image 2)
 */

body.ew-cart-page,
body.ew-minimal-site.ew-cart-page {
  background: #f5f5f5 !important;
}

.ew-cart-page-area {
  padding-top: 100px;
  padding-bottom: 140px;
  min-height: 100vh;
  background: #f5f5f5;
}

@media (max-width: 1132px) {
  .ew-cart-page-area {
    padding-top: 80px;
    padding-bottom: 160px;
  }
}

.ew-cart-page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

.ew-cart-table-wrap {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}

.ew-cart-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ew-cart-table thead th {
  font-size: 13px;
  font-weight: 400;
  color: #8a9399 !important;
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #ececec;
  background: #fff !important;
}

.ew-cart-table .ew-col-check { width: 48px; text-align: center; }
.ew-cart-table .ew-col-product { width: 38%; }
.ew-cart-table .ew-col-price { width: 14%; text-align: center; }
.ew-cart-table .ew-col-qty { width: 16%; text-align: center; }
.ew-cart-table .ew-col-total { width: 14%; text-align: center; }
.ew-cart-table .ew-col-delete { width: 12%; text-align: center; }

.ew-cart-table thead .ew-col-price,
.ew-cart-table thead .ew-col-qty,
.ew-cart-table thead .ew-col-total {
  text-align: center;
}

.ew-cart-row {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.ew-cart-row.is-selected {
  background: #eef7ff;
}

.ew-cart-row td {
  padding: 16px 12px;
  vertical-align: middle;
  font-size: 14px;
  color: #0c2028;
}

.ew-cart-row .ew-col-price,
.ew-cart-row .ew-col-qty,
.ew-cart-row .ew-col-total,
.ew-cart-row .ew-col-check,
.ew-cart-row .ew-col-delete {
  text-align: center;
}

.ew-cart-product {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.ew-cart-thumb {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border: 1px solid #e5e5e5;
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
}

.ew-cart-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block;
}

.ew-cart-product-name {
  font-size: 14px;
  font-weight: 700;
  color: #0c2028;
  line-height: 1.35;
  margin-bottom: 6px;
}

.ew-cart-product-name a {
  color: #0c2028 !important;
  text-decoration: none !important;
}

.ew-cart-variant {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #647176;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 2px;
  padding: 2px 8px;
}

.ew-cart-variant::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #8a9399;
  margin-left: 2px;
}

.ew-line-total {
  font-weight: 700;
}

/* Green checkbox */
.ew-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.ew-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ew-check-box {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1px solid #c5c5c5;
  border-radius: 2px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.ew-check input:checked + .ew-check-box {
  background: #82c341;
  border-color: #82c341;
}

.ew-check input:checked + .ew-check-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

/* Qty — light blue buttons */
.ew-qty-stepper.ew-qty-cart {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #cfe3f5;
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
  vertical-align: middle;
}

.ew-qty-stepper.ew-qty-cart button {
  width: 32px;
  height: 32px;
  border: none;
  background: #e8f3fc;
  color: #0c2028;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.ew-qty-stepper.ew-qty-cart .ew-qty-input {
  width: 44px;
  height: 32px;
  border: none;
  border-left: 1px solid #cfe3f5;
  border-right: 1px solid #cfe3f5;
  text-align: center;
  font-size: 14px;
  padding: 0;
  background: #fff;
  -moz-appearance: textfield;
}

.ew-qty-stepper.ew-qty-cart .ew-qty-input::-webkit-outer-spin-button,
.ew-qty-stepper.ew-qty-cart .ew-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ew-cart-delete {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #e0241a !important;
  font-size: 13px;
  text-decoration: none !important;
  white-space: nowrap;
}

.ew-cart-delete svg {
  stroke: #e0241a;
}

/* Sticky bottom bar */
.ew-cart-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.ew-cart-sticky-top {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.ew-more-vouchers {
  appearance: none;
  border: none;
  background: #ff7f00;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  height: 30px;
  padding: 0 12px;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ew-more-vouchers .feather-tag,
.ew-more-vouchers i {
  font-size: 14px;
}

.ew-cart-remark {
  margin: 0;
  font-size: 12px;
  color: #8a9399;
  font-style: italic;
}

.ew-cart-sticky-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ew-select-all-text {
  font-size: 14px;
  color: #0c2028;
}

.ew-cart-sticky-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.ew-cart-subtotal-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ew-cart-subtotal-label {
  font-size: 14px;
  font-weight: 700;
  color: #0c2028;
}

.ew-cart-subtotal-amount {
  font-size: 20px;
  font-weight: 700;
  color: #0c2028;
}

.ew-cart-subtotal-amount::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #0c2028;
  vertical-align: middle;
}

.ew-cart-checkout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  height: 44px;
  padding: 0 28px;
  background: #82c341 !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none !important;
  border-radius: 2px;
  letter-spacing: 0.3px;
}

.ew-cart-checkout-btn:hover {
  background: #6fad32 !important;
}

.ew-cart-sticky-top .ew-coupon-field {
  width: 100%;
  max-width: 360px;
  display: flex;
  gap: 8px;
}

.ew-cart-sticky-top .ew-coupon-field[hidden] {
  display: none !important;
}

.ew-cart-sticky-top .ew-coupon-field .input-text {
  flex: 1;
  height: 34px;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  padding: 0 10px;
}

.ew-cart-sticky-top .ew-coupon-field .confirm-btn {
  height: 34px;
  padding: 0 14px;
  background: #82c341;
  color: #fff;
  border: none;
  border-radius: 2px;
  cursor: pointer;
}

.ew-update-cart-btn {
  display: none !important;
}

/* Mobile card layout */
@media (max-width: 900px) {
  .ew-cart-table thead {
    display: none;
  }

  .ew-cart-table,
  .ew-cart-table tbody,
  .ew-cart-table tr,
  .ew-cart-table td {
    display: block;
    width: 100%;
  }

  .ew-cart-row {
    position: relative;
    padding: 12px;
    border-bottom: 8px solid #f5f5f5;
  }

  .ew-cart-row td {
    padding: 4px 0;
    text-align: left !important;
  }

  .ew-cart-row .ew-col-check {
    position: absolute;
    left: 12px;
    top: 20px;
    width: auto;
  }

  .ew-cart-row .ew-col-product {
    padding-left: 36px;
  }

  .ew-cart-row .ew-col-price,
  .ew-cart-row .ew-col-qty,
  .ew-cart-row .ew-col-total {
    display: inline-block;
    width: auto;
    padding-left: 36px;
    margin-right: 12px;
  }

  .ew-cart-row .ew-col-delete {
    padding-left: 36px;
  }

  .ew-cart-sticky-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .ew-cart-sticky-right {
    width: 100%;
    justify-content: space-between;
  }

  .ew-cart-checkout-btn {
    flex: 1;
  }
}
