/**
 * Bayaa Multi-Vendor - Luxury Shopping Cart Stylesheet
 *
 * Brand Bible Enforcement:
 * - Deep Navy: #0F2A4A
 * - Vivid Orange: #FF6B00
 * - Clean White: #FFFFFF
 * - Cairo Font strictly enforced
 * - Solid colors only (NO GRADIENTS)
 */

/* ========================================================
   Global Font & Container Enforcements on Cart
   ======================================================== */
.woocommerce-cart,
.woocommerce-cart * {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif !important;
  box-sizing: border-box;
}

.woocommerce-cart .woocommerce {
  max-width: 1240px;
  margin: 30px auto 60px;
  padding: 0 20px;
  direction: rtl;
  text-align: right;
  color: #1E293B;
}

/* ========================================================
   1. Cart Header & Progress Steps
   ======================================================== */
.bayaa-cart-header-wrapper {
  margin-bottom: 28px;
}

.bayaa-cart-benefit-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  margin-top: 14px;
  font-size: 13px;
  color: #1E40AF;
}

.bayaa-benefit-icon {
  font-size: 18px;
}

/* ========================================================
   2. Main Cart Layout: 2 Columns
   ======================================================== */
.woocommerce-cart .woocommerce {
  display: flex;
  flex-direction: column;
}

.woocommerce-cart .woocommerce-cart-form {
  width: 100%;
}

@media (min-width: 992px) {
  .woocommerce-cart .woocommerce {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    align-items: start;
  }

  .woocommerce-cart .bayaa-cart-header-wrapper {
    grid-column: 1 / -1;
  }

  .woocommerce-cart .woocommerce-notices-wrapper {
    grid-column: 1 / -1;
  }
}

/* ========================================================
   3. Cart Items Table & Modern Card Appearance
   ======================================================== */
.woocommerce-cart-form__contents {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 14px;
  border: none !important;
}

.woocommerce-cart-form__contents thead {
  display: none; /* Modern clean card view */
}

.woocommerce-cart-form__cart-item {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 42, 74, 0.03);
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 16px;
  position: relative;
  transition: all 0.2s ease;
}

.woocommerce-cart-form__cart-item:hover {
  border-color: #CBD5E1;
  box-shadow: 0 6px 18px rgba(15, 42, 74, 0.06);
}

.woocommerce-cart-form__contents td {
  border: none !important;
  padding: 0 !important;
}

/* Remove Item Button */
.product-remove {
  order: 6;
  margin-right: auto;
}

.product-remove a.remove {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50% !important;
  background: #FEE2E2 !important;
  color: #DC2626 !important;
  text-decoration: none !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  transition: all 0.2s !important;
  line-height: 1 !important;
}

.product-remove a.remove:hover {
  background: #DC2626 !important;
  color: #FFFFFF !important;
}

/* Thumbnail */
.product-thumbnail {
  order: 1;
  flex-shrink: 0;
}

.product-thumbnail img {
  width: 80px !important;
  height: 80px !important;
  object-fit: contain;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 4px;
}

/* Product Name & Vendor */
.product-name {
  order: 2;
  flex: 1;
  min-width: 180px;
}

.product-name a {
  color: #0F2A4A;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.4;
  display: block;
  margin-bottom: 4px;
  transition: color 0.2s;
}

.product-name a:hover {
  color: #FF6B00;
}

/* Vendor Store Tag */
.bayaa-cart-vendor-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

.bayaa-cart-vendor-link {
  color: #0F2A4A;
  font-weight: 700;
  text-decoration: none;
}

.bayaa-cart-vendor-link:hover {
  color: #FF6B00;
}

.bayaa-vendor-verified-mark {
  color: #16A34A;
  font-weight: 900;
  font-size: 11px;
}

/* Unit Price */
.product-price {
  order: 3;
  font-size: 14px;
  font-weight: 700;
  color: #64748B;
  padding: 0 10px !important;
}

/* Quantity Stepper in Cart */
.product-quantity {
  order: 4;
}

.product-quantity .quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #F8FAFC;
  overflow: hidden;
  height: 38px;
}

.product-quantity .quantity input.qty {
  width: 44px;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #0F2A4A;
  outline: none;
  padding: 0;
}

.bayaa-cart-qty-btn {
  width: 32px;
  height: 100%;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.bayaa-cart-qty-btn:hover {
  background: #E2E8F0;
  color: #0F2A4A;
}

/* Subtotal */
.product-subtotal {
  order: 5;
  font-size: 16px;
  font-weight: 800;
  color: #0F2A4A;
  padding: 0 14px !important;
  white-space: nowrap;
}

/* Hide raw update cart button since we auto-update on stepper change */
button[name="update_cart"] {
  display: none !important;
}

/* ========================================================
   4. Cart Collaterals & Sticky Order Summary
   ======================================================== */
.cart-collaterals {
  position: sticky;
  top: 90px;
}

.cart_totals {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(15, 42, 74, 0.04);
  width: 100% !important;
  float: none !important;
}

.cart_totals > h2 {
  font-size: 18px;
  font-weight: 800;
  color: #0F2A4A;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E2E8F0;
}

.cart_totals table.shop_table {
  width: 100%;
  border: none;
  margin-bottom: 20px;
}

.cart_totals table.shop_table tr th,
.cart_totals table.shop_table tr td {
  border: none;
  padding: 10px 0;
  font-size: 14px;
}

.cart_totals table.shop_table tr th {
  font-weight: 700;
  color: #64748B;
  text-align: right;
}

.cart_totals table.shop_table tr td {
  text-align: left;
  font-weight: 800;
  color: #0F2A4A;
}

.cart_totals table.shop_table tr.order-total th,
.cart_totals table.shop_table tr.order-total td {
  padding-top: 14px;
  border-top: 2px dashed #E2E8F0;
  font-size: 18px;
  color: #0F2A4A;
}

.cart_totals table.shop_table tr.order-total td strong {
  font-size: 20px;
  color: #0F2A4A;
}

/* Coupon Code Box in Cart */
.bayaa-cart-coupon-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #F1F5F9;
}

.bayaa-cart-coupon-input {
  flex: 1;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #0F2A4A;
  outline: none;
}

.bayaa-cart-coupon-input:focus {
  border-color: #0F2A4A;
}

.bayaa-cart-coupon-btn {
  padding: 10px 18px;
  background: #0F2A4A;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s;
}

.bayaa-cart-coupon-btn:hover {
  background: #183C66;
}

/* Proceed to Checkout CTA Button */
.wc-proceed-to-checkout {
  padding: 0 !important;
}

.wc-proceed-to-checkout a.checkout-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100% !important;
  padding: 15px 20px !important;
  background: #FF6B00 !important;
  color: #FFFFFF !important;
  border-radius: 12px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.25) !important;
  transition: all 0.25s ease !important;
  border: none !important;
}

.wc-proceed-to-checkout a.checkout-button:hover {
  background: #E05E00 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 107, 0, 0.35) !important;
}

/* Trust Guarantees in Cart */
.bayaa-cart-trust-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bayaa-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: #475569;
}

.bayaa-trust-icon {
  font-size: 18px;
  line-height: 1.2;
}

.bayaa-trust-item strong {
  display: block;
  color: #0F2A4A;
  font-size: 12.5px;
  font-weight: 700;
}

.bayaa-trust-item small {
  display: block;
  color: #64748B;
  font-size: 11px;
}

/* ========================================================
   5. Empty Cart State
   ======================================================== */
.cart-empty.woocommerce-info {
  display: none !important; /* Hide unstyled WC alert */
}

.bayaa-empty-cart-wrap {
  text-align: center;
  padding: 60px 20px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  max-width: 600px;
  margin: 40px auto;
  box-shadow: 0 4px 20px rgba(15, 42, 74, 0.05);
}

.bayaa-empty-cart-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.bayaa-empty-cart-title {
  font-size: 22px;
  font-weight: 800;
  color: #0F2A4A;
  margin: 0 0 8px;
}

.bayaa-empty-cart-desc {
  font-size: 14.5px;
  color: #64748B;
  margin: 0 0 24px;
}

.bayaa-empty-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: #FF6B00;
  color: #FFFFFF;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25);
}

.bayaa-empty-cart-btn:hover {
  background: #E05E00;
  transform: translateY(-2px);
}

/* ========================================================
   6. Mobile Responsive
   ======================================================== */
@media (max-width: 768px) {
  .woocommerce-cart-form__cart-item {
    flex-wrap: wrap;
    padding: 14px;
    gap: 12px;
  }

  .product-thumbnail img {
    width: 64px !important;
    height: 64px !important;
  }

  .product-name {
    width: calc(100% - 130px);
  }

  .product-price {
    display: none;
  }

  .product-quantity {
    order: 4;
  }

  .product-subtotal {
    order: 5;
    margin-right: auto;
  }

  .product-remove {
    order: 3;
    position: absolute;
    top: 12px;
    left: 12px;
  }
}

/* ========================================================
   7. WooCommerce Gutenberg Blocks & Elementor Cart Styles
   ======================================================== */
.wp-block-woocommerce-cart,
.wc-block-cart,
.elementor-widget-woocommerce-cart,
.wpr-woo-cart {
  direction: rtl !important;
  text-align: right !important;
  max-width: 1240px !important;
  margin: 10px auto 60px !important;
  padding: 0 16px !important;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif !important;
  color: #1E293B !important;
}

.wp-block-woocommerce-cart *,
.wc-block-cart *,
.elementor-widget-woocommerce-cart *,
.wpr-woo-cart * {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif !important;
  box-sizing: border-box !important;
}

/* 2-Column Grid on Desktop for Cart Block */
@media (min-width: 992px) {
  .wc-block-cart {
    display: grid !important;
    grid-template-columns: 1fr 380px !important;
    gap: 32px !important;
    align-items: start !important;
  }
  .wc-block-cart__main {
    min-width: 0 !important;
  }
  .wc-block-cart__sidebar {
    position: sticky !important;
    top: 90px !important;
  }
}

/* Title */
.wc-block-cart__title,
.wp-block-woocommerce-cart h1,
.wp-block-woocommerce-cart h2 {
  color: #0F2A4A !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  margin-bottom: 20px !important;
}

/* Cart Items in Block */
.wc-block-cart-items {
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px !important;
  background: #FFFFFF !important;
  overflow: hidden !important;
  box-shadow: 0 2px 10px rgba(15, 42, 74, 0.03) !important;
  margin-bottom: 24px !important;
}

.wc-block-cart-items__row {
  border-bottom: 1px solid #F1F5F9 !important;
  padding: 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.wc-block-cart-items__row:last-child {
  border-bottom: none !important;
}

.wc-block-components-product-name {
  color: #0F2A4A !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  transition: color 0.2s !important;
}

.wc-block-components-product-name:hover {
  color: #FF6B00 !important;
}

.wc-block-components-product-image img {
  border-radius: 10px !important;
  border: 1px solid #E2E8F0 !important;
  background: #F8FAFC !important;
  object-fit: contain !important;
}

/* Quantity Selector & Trash */
.wc-block-components-quantity-selector {
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 8px !important;
  background: #F8FAFC !important;
  height: 38px !important;
}

.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
  font-weight: 800 !important;
  color: #0F2A4A !important;
}

.wc-block-components-quantity-selector__button {
  color: #0F2A4A !important;
  font-weight: 800 !important;
}

/* Sidebar Totals Card in Blocks */
.wc-block-cart__sidebar,
.wc-block-components-totals-wrapper {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 16px !important;
  padding: 24px !important;
  box-shadow: 0 4px 16px rgba(15, 42, 74, 0.05) !important;
}

.wc-block-components-totals-wrapper h2 {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #0F2A4A !important;
  margin: 0 0 16px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid #F1F5F9 !important;
}

/* Submit Button ("المتابعة لإتمام الطلب" in Screenshot 3) */
.wc-block-cart__submit-button,
.wc-block-cart__submit-container a,
.wc-block-components-button.wp-element-button,
.wc-block-cart__sidebar .wc-block-components-checkout-place-order-button,
.elementor-widget-woocommerce-cart .checkout-button,
.wpr-woo-cart a.checkout-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  background: #FF6B00 !important;
  background-color: #FF6B00 !important;
  color: #FFFFFF !important;
  border-radius: 12px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  padding: 15px 24px !important;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.3) !important;
  transition: all 0.25s ease !important;
  border: none !important;
  cursor: pointer !important;
}

.wc-block-cart__submit-button:hover,
.wc-block-cart__submit-container a:hover,
.wc-block-components-button.wp-element-button:hover,
.elementor-widget-woocommerce-cart .checkout-button:hover,
.wpr-woo-cart a.checkout-button:hover {
  background: #E05E00 !important;
  background-color: #E05E00 !important;
  color: #FFFFFF !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 22px rgba(255, 107, 0, 0.4) !important;
}

/* Coupon Box */
.wc-block-components-totals-coupon {
  margin: 16px 0 !important;
}

.wc-block-components-totals-coupon button.wc-block-components-button {
  background: #0F2A4A !important;
  background-color: #0F2A4A !important;
  color: #FFFFFF !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
}

.wc-block-components-totals-footer-item {
  border-top: 2px dashed #E2E8F0 !important;
  padding-top: 14px !important;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-components-totals-footer-item strong {
  font-size: 20px !important;
  font-weight: 900 !important;
  color: #0F2A4A !important;
}
