body.woocommerce-cart,
body.woocommerce-checkout {
  background-color: #f7f7f7 !important;
}

/* Align Elementor Title with Cart Card Content */
.woocommerce-cart .elementor-heading-title,
.woocommerce-checkout .elementor-heading-title {
  padding-left: 20px;
}

/* Layout */
.woocommerce {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.woocommerce .woocommerce-cart-form {
  flex: 1;
  min-width: 60%;
  background: #fff !important;
  padding: 20px !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
  margin-bottom: 24px;
}

/* The layout for #customer_details and #order_review is now handled in form-checkout.php */
/* .woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review {
  background: #fff !important;
  padding: 30px !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #eef0f2 !important;
  margin-bottom: 24px;
} */

/* Constrain Checkout Width */
.woocommerce-checkout .woocommerce {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.woocommerce .cart-collaterals {
  width: 30%;
  min-width: 280px;
}

/* Legacy layout rules removed to favor new grid system */
/* form.checkout .col2-set {
  width: 47% !important;
  float: left;
  margin-right: 3%;
} */

/* form.checkout #order_review_heading,
form.checkout #order_review {
  width: 50%;
  float: right;
} */

/* Clearfix for container */
form.checkout:after {
  content: "";
  display: table;
  clear: both;
}

@media (max-width: 992px) {

  /* Reset widths for mobile */
  form.checkout .col2-set,
  form.checkout #order_review_heading,
  form.checkout #order_review {
    width: 100% !important;
    float: none;
    margin-right: 0;
  }

  .woocommerce {
    flex-direction: column;
  }

  .woocommerce .woocommerce-cart-form,
  .woocommerce .cart-collaterals {
    width: 100% !important;
    max-width: 100%;
    flex: 0 0 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Hide default coupon row */
.woocommerce .cart .actions .coupon {
  display: none;
}

/* Hide WooCommerce messages on Cart (e.g. "Cart updated") */
.woocommerce-cart .woocommerce-message {
  display: none !important;
}

/* Align Info boxes to left */
.woocommerce-checkout .woocommerce-info {
  text-align: left !important;
}

/* Quantity Button Hover Color Override */
.quantity .plus:hover,
.quantity .minus:hover,
.shop_table .product-quantity .quantity button:hover {
  background-color: #ff8a3d !important;
  color: #fff !important;
}

/* Card Boxes */
.rc-box {
  background: #fff;
  /* border: 1px solid #eef0f2; */
  border-radius: 12px;
  /* padding: 20px; */
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.rc-box h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

/* Fields */
.rc-field {
  margin-bottom: 12px;
}

.rc-field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  color: #111;
  margin-bottom: 6px;
}

/* Custom Select Style */
.rc-field select,
#shipping_country,
#billing_country {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #f8f8fa;
  border: none;
  border-radius: 8px;
  padding: 10px 36px 10px 14px;
  width: 100%;
  max-width: 100%;
  /* Prevent overflow from long options */
  font-size: 14px;
  font-weight: 500;
  color: #000;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23000' height='18' viewBox='0 0 24 24' width='18' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.rc-field select:focus,
#shipping_country:focus,
#billing_country:focus {
  outline: none;
  box-shadow: 0 0 0 2px #d0d0d0;
}

/* Order Summary */
.rc-summary .rc-coupon {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.rc-summary .rc-coupon input {
  flex: 1;
}

.rc-summary .checkout-button {
  width: 100%;
  height: 44px;
  border-radius: 10px;
}


/* for mobile */
/* -------------------------
   Mobile cart: card layout
   ------------------------- */
@media (max-width: 768px) {

  /* hide table header on mobile */
  .shop_table thead {
    display: none;
  }

  /* make each cart row a flexible card */
  .shop_table tbody tr.woocommerce-cart-form__cart-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #eef0f2;
    margin-bottom: 12px;
    box-shadow: none;
  }

  /* thumbnail: left */
  .shop_table .product-thumbnail {
    flex: 0 0 64px;
    max-width: 64px;
    order: 1;
    padding: 0;
  }

  .shop_table .product-thumbnail img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
  }

  /* product info (title + meta) */
  .shop_table .product-name {
    flex: 1 1 auto;
    order: 2;
    padding: 0;
  }

  .shop_table .product-name a {
    display: block;
    font-weight: 600;
    color: #144a3f;
    /* green-ish title like screenshot */
    margin-bottom: 4px;
  }

  .shop_table .product-name .variation,
  .shop_table .product-name .wc-item-meta,
  .shop_table .product-name p {
    margin: 0;
    font-size: 13px;
    color: #6b6f73;
  }

  /* quantity row: below name, centered left */
  .shop_table .product-quantity {
    order: 3;
    flex: 0 0 100%;
    margin-top: 8px;
    padding: 0;
  }

  .shop_table .product-quantity .quantity {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: #fff;
    border-radius: 20px;
    padding: 6px 10px;
    border: 1px solid #e6e6e6;
  }

  .shop_table .product-quantity .quantity .input-text {
    width: 48px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
  }

  .shop_table .product-quantity .quantity button {
    background: transparent;
    border: none;
    font-size: 18px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
  }

  .shop_table .product-quantity .quantity button:hover {
    background-color: #ff8a3d;
    color: #fff;
  }

  /* price on the right */
  .shop_table .product-price,
  .shop_table .product-subtotal {
    order: 4;
    flex: 0 0 68px;
    text-align: right;
    padding: 0;
    font-weight: 600;
  }

  /* remove button to far right (small) */
  .shop_table .product-remove {
    order: 5;
    flex: 0 0 32px;
    text-align: right;
    padding: 0;
  }

  .shop_table .product-remove a.remove {
    font-size: 18px;
    color: #ff4d4f;
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 8px;
    background: transparent;
  }

  /* remove table spacing and borders around rows */
  .shop_table,
  .shop_table tbody {
    border-collapse: separate;
    border-spacing: 0;
  }
}


/* Hide card view on desktop */
.rc-cart-mobile {
  display: none;
}

/* Show card layout only on mobile */
@media (max-width: 768px) {

  /* Reset container style for mobile */
  .woocommerce .woocommerce-cart-form {
    background: transparent;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }

  /* Show form because we put mobile layout inside it */
  .woocommerce-cart-form {
    display: block;
  }

  /* hide default table */
  .woocommerce-cart-form .shop_table {
    display: none;
  }

  /* hide default table */
  .rc-cart-mobile {
    display: block;
  }

  .rc-cart-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
  }

  .rc-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
  }

  .rc-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px;
  }

  .rc-meta {
    font-size: 13px;
    color: #6b6f73;
    margin-bottom: 8px;
  }

  .rc-info {
    flex: 1;
    min-width: 0;
  }

  .rc-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 8px;
    gap: 15px;
  }

  .rc-qty .quantity {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 20px;
    padding: 5px 10px;
  }

  .rc-qty .quantity input {
    width: 40px;
    border: none;
    text-align: center;
  }

  .rc-price {
    font-weight: 600;
    color: #111;
  }

  .rc-remove a.remove {
    color: #ff4d4f;
    font-size: 18px;
    text-decoration: none;
  }
}

/* User requested specific constraint */
@media (max-width: 414px) {
  .rc-cart-item {
    min-width: 100%;
  }
}

#rc_pick_shop {
  max-width: 300px !important;
}

#rc_delivery_by {
  max-width: 300px !important;
}