/* ==========================================================================
   TENBIT ADDON - WOOCOMMERCE CART PAGE STYLES
   Compatible with standard WooCommerce cart template & Elementor widgets
   ========================================================================== */

/* Cart Page Hero Header & Breadcrumb */
.cart-hero-header {
  background: #ffffff;
  border-bottom: 1px solid var(--tb-border-color, #e5e7eb);
  padding: 2.5rem 0 1.5rem 0;
  margin-bottom: 2rem;
}

.cart-hero-header h1,
.woocommerce-cart .entry-title,
.woocommerce-cart h1.page-title {
  font-family: var(--tb-font-heading, 'Bricolage Grotesque', sans-serif);
  font-size: clamp(2rem, 3.5vw, 2.5rem);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--tb-text-dark, #111827);
  margin-bottom: 0.5rem;
}

/* Free Shipping Goal Progress Bar */
.shipping-progress-card {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--tb-radius-md, 8px);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.shipping-progress-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.92rem;
  color: #065f46;
}

.shipping-progress-text strong {
  color: var(--tb-brand-red, #c91818);
}

.shipping-bar-bg {
  width: 100%;
  height: 10px;
  background: #d1fae5;
  border-radius: var(--tb-radius-full, 9999px);
  overflow: hidden;
}

.shipping-bar-fill {
  width: 100%;
  height: 100%;
  background: #10b981;
  border-radius: var(--tb-radius-full, 9999px);
  transition: width 0.4s ease;
}

/* WooCommerce Cart Grid Layout (2 Column Desktop) */
.woocommerce-cart .woocommerce {
  margin: 0 auto;
}

.woocommerce-cart .woocommerce::after,
.woocommerce-cart .woocommerce::before {
  content: "";
  display: table;
  clear: both;
}

@media (min-width: 992px) {
  .woocommerce-cart .woocommerce,
  .woocommerce-cart-grid {
    display: grid !important;
    grid-template-columns: 1.8fr 1fr !important;
    gap: 2.5rem !important;
    align-items: start !important;
  }
}

/* Cart Items Form Container */
.woocommerce-cart .woocommerce-cart-form,
.woocommerce-cart-form {
  background: #ffffff;
  border: 1px solid var(--tb-border-color, #e5e7eb);
  border-radius: var(--tb-radius-lg, 12px);
  padding: 1.75rem;
  box-shadow: var(--tb-shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
}

/* Cart Table Styles */
.woocommerce-cart table.shop_table.cart,
table.shop_table.cart {
  width: 100% !important;
  border-collapse: collapse !important;
  text-align: left !important;
  border: none !important;
  margin: 0 !important;
}

table.shop_table.cart thead th {
  font-family: var(--tb-font-heading, 'Bricolage Grotesque', sans-serif) !important;
  font-size: 0.85rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--tb-text-muted, #6b7280) !important;
  padding: 1rem 0.75rem !important;
  border-bottom: 2px solid var(--tb-border-color, #e5e7eb) !important;
  border-top: none !important;
  background: transparent !important;
}

table.shop_table.cart tbody td {
  padding: 1.25rem 0.75rem !important;
  border-bottom: 1px solid #f3f4f6 !important;
  border-top: none !important;
  vertical-align: middle !important;
  background: transparent !important;
}

/* Remove Item Button */
table.shop_table.cart .product-remove {
  width: 36px;
  text-align: center;
}

table.shop_table.cart .product-remove a.remove {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: #fee2e2 !important;
  color: var(--tb-brand-red, #c91818) !important;
  font-weight: 800 !important;
  font-size: 1.1rem !important;
  text-decoration: none !important;
  line-height: 1 !important;
  transition: var(--tb-transition);
}

table.shop_table.cart .product-remove a.remove:hover {
  background: var(--tb-brand-red, #c91818) !important;
  color: #ffffff !important;
}

/* Product Thumbnail */
table.shop_table.cart .product-thumbnail {
  width: 80px;
}

table.shop_table.cart .product-thumbnail img {
  width: 72px !important;
  height: 72px !important;
  border-radius: var(--tb-radius-md, 8px) !important;
  object-fit: cover !important;
  border: 1px solid var(--tb-border-color, #e5e7eb) !important;
  display: block;
}

/* Product Name & Variations */
table.shop_table.cart .product-name a {
  font-family: var(--tb-font-heading, 'Bricolage Grotesque', sans-serif);
  font-size: 1rem;
  font-weight: 800;
  color: var(--tb-text-dark, #111827);
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.3;
}

table.shop_table.cart .product-name a:hover {
  color: var(--tb-brand-red, #c91818);
}

table.shop_table.cart .product-name .variation,
table.shop_table.cart .product-name .item-meta {
  font-size: 0.78rem;
  color: var(--tb-text-muted, #6b7280);
  margin-top: 0.35rem;
}

table.shop_table.cart .product-name .variation dt {
  font-weight: 700;
  float: left;
  clear: left;
  margin-right: 0.3rem;
}

table.shop_table.cart .product-name .variation dd {
  margin: 0 0 0.2rem 0;
}

/* Pricing & Subtotals */
table.shop_table.cart .product-price,
table.shop_table.cart .product-subtotal {
  font-weight: 800 !important;
  font-size: 1.05rem !important;
  color: var(--tb-text-dark, #111827) !important;
  white-space: nowrap;
}

table.shop_table.cart .product-subtotal {
  color: var(--tb-brand-red, #c91818) !important;
}

/* Quantity Box in Cart */
.woocommerce-cart .quantity,
table.shop_table.cart .quantity {
  display: inline-flex !important;
  align-items: center !important;
  border: 1px solid #d1d5db !important;
  border-radius: var(--tb-radius-sm, 4px) !important;
  overflow: hidden !important;
  background: #ffffff !important;
  height: 40px !important;
}

.woocommerce-cart .quantity .input-text.qty,
table.shop_table.cart .quantity .input-text.qty {
  width: 48px !important;
  height: 100% !important;
  border: none !important;
  text-align: center !important;
  font-weight: 800 !important;
  font-size: 0.92rem !important;
  color: var(--tb-text-dark, #111827) !important;
  outline: none !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Table Actions (Coupon & Update Cart) */
table.shop_table.cart td.actions {
  padding-top: 2rem !important;
  border-bottom: none !important;
}

table.shop_table.cart td.actions .coupon,
.cart-actions-wrapper .coupon {
  display: flex !important;
  align-items: center !important;
  gap: 0.6rem !important;
  flex: 1 !important;
  max-width: 400px !important;
  float: left !important;
}

table.shop_table.cart td.actions .coupon input.input-text,
.coupon input.input-text {
  flex: 1 !important;
  height: 46px !important;
  padding: 0 1rem !important;
  border: 1.5px solid #d1d5db !important;
  border-radius: var(--tb-radius-sm, 4px) !important;
  font-size: 0.88rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  font-family: inherit !important;
  outline: none !important;
}

table.shop_table.cart td.actions .coupon input.input-text:focus {
  border-color: var(--tb-brand-red, #c91818) !important;
}

table.shop_table.cart td.actions .coupon button.button,
table.shop_table.cart td.actions button[name="update_cart"] {
  height: 46px !important;
  padding: 0 1.35rem !important;
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  color: var(--tb-text-main, #1f2937) !important;
  font-family: var(--tb-font-heading, 'Bricolage Grotesque', sans-serif) !important;
  font-size: 0.85rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  border-radius: var(--tb-radius-sm, 4px) !important;
  transition: var(--tb-transition) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

table.shop_table.cart td.actions .coupon button.button:hover,
table.shop_table.cart td.actions button[name="update_cart"]:hover {
  background: #e5e7eb !important;
  color: var(--tb-brand-red, #c91818) !important;
  border-color: #9ca3af !important;
}

table.shop_table.cart td.actions button[name="update_cart"] {
  float: right !important;
}

/* ==========================================================================
   CART COLLATERALS (ORDER TOTALS & TRUST BOXES)
   ========================================================================== */
.cart-collaterals {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
  width: 100% !important;
}

.cart-collaterals .cart_totals {
  background: #ffffff !important;
  border: 1px solid var(--tb-border-color, #e5e7eb) !important;
  border-radius: var(--tb-radius-lg, 12px) !important;
  padding: 2rem !important;
  box-shadow: var(--tb-shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06)) !important;
  width: 100% !important;
  float: none !important;
}

.cart-collaterals .cart_totals h2 {
  font-family: var(--tb-font-heading, 'Bricolage Grotesque', sans-serif) !important;
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  color: var(--tb-text-dark, #111827) !important;
  padding-bottom: 1rem !important;
  border-bottom: 2px solid #f3f4f6 !important;
  margin-bottom: 1.25rem !important;
}

table.shop_table.woocommerce-cart-totals,
.cart_totals table.shop_table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-bottom: 1.5rem !important;
  border: none !important;
}

table.shop_table.woocommerce-cart-totals th,
table.shop_table.woocommerce-cart-totals td,
.cart_totals table.shop_table th,
.cart_totals table.shop_table td {
  padding: 0.9rem 0 !important;
  border-bottom: 1px solid #f3f4f6 !important;
  border-top: none !important;
  font-size: 0.95rem !important;
  background: transparent !important;
}

table.shop_table.woocommerce-cart-totals th,
.cart_totals table.shop_table th {
  font-weight: 600 !important;
  color: var(--tb-text-muted, #4b5563) !important;
  text-align: left !important;
}

table.shop_table.woocommerce-cart-totals td,
.cart_totals table.shop_table td {
  text-align: right !important;
  font-weight: 700 !important;
  color: var(--tb-text-dark, #111827) !important;
}

/* Total Row Highlight */
.cart_totals tr.order-total th,
.cart_totals tr.order-total td {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  border-bottom: none !important;
  padding-top: 1.25rem !important;
  font-family: var(--tb-font-heading, 'Bricolage Grotesque', sans-serif) !important;
}

.cart_totals tr.order-total td span,
.cart_totals tr.order-total td strong {
  color: var(--tb-brand-red, #c91818) !important;
}

/* Proceed to Checkout Button */
.wc-proceed-to-checkout {
  margin-top: 1.25rem;
  padding: 0 !important;
}

.wc-proceed-to-checkout a.checkout-button.button.alt,
a.checkout-button {
  width: 100% !important;
  padding: 1.15rem 1.5rem !important;
  font-family: var(--tb-font-heading, 'Bricolage Grotesque', sans-serif) !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  text-align: center !important;
  display: block !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  background: var(--tb-brand-red, #c91818) !important;
  color: #ffffff !important;
  border-radius: var(--tb-radius-sm, 4px) !important;
  box-shadow: 0 6px 20px rgba(201, 24, 24, 0.3) !important;
  transition: var(--tb-transition) !important;
}

.wc-proceed-to-checkout a.checkout-button.button.alt:hover,
a.checkout-button:hover {
  background: var(--tb-brand-red-hover, #a51212) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 25px rgba(201, 24, 24, 0.4) !important;
}

/* Cart Trust Badges Card */
.cart-trust-badges {
  background: #ffffff;
  border: 1px solid var(--tb-border-color, #e5e7eb);
  border-radius: var(--tb-radius-lg, 12px);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--tb-shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
}

.trust-badge-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.84rem;
  color: var(--tb-text-muted, #4b5563);
  line-height: 1.4;
}

.trust-badge-row svg {
  color: var(--tb-brand-red, #c91818);
  flex-shrink: 0;
}

.trust-badge-row strong {
  color: var(--tb-text-dark, #111827);
  display: block;
}

/* Cross-Sells Section */
.woocommerce-cart .cross-sells {
  margin-top: 4.5rem;
  border-top: 1px solid var(--tb-border-color, #e5e7eb);
  padding-top: 3.5rem;
  width: 100%;
}

.woocommerce-cart .cross-sells h2 {
  font-family: var(--tb-font-heading, 'Bricolage Grotesque', sans-serif);
  font-size: 1.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--tb-text-dark, #111827);
  margin-bottom: 2rem;
}

/* Empty Cart State */
.woocommerce-cart .cart-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: #ffffff;
  border: 1px solid var(--tb-border-color, #e5e7eb);
  border-radius: var(--tb-radius-lg, 12px);
  font-size: 1.2rem;
  font-weight: 700;
}

.woocommerce-cart .return-to-shop {
  text-align: center;
  margin-top: 1.5rem;
}

.woocommerce-cart .return-to-shop a.button {
  background: var(--tb-brand-red, #c91818) !important;
  color: #ffffff !important;
  padding: 1rem 2.5rem !important;
  font-size: 0.95rem !important;
}

/* Mobile Responsiveness for Cart Table */
@media (max-width: 768px) {
  table.shop_table.cart thead {
    display: none;
  }

  table.shop_table.cart tr {
    display: block;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--tb-border-color, #e5e7eb);
    position: relative;
  }

  table.shop_table.cart td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none !important;
    padding: 0.5rem 0 !important;
  }

  table.shop_table.cart td.product-remove {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
  }

  table.shop_table.cart td.product-thumbnail {
    justify-content: center;
    width: 100%;
  }

  table.shop_table.cart td.actions .coupon {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1rem;
  }

  table.shop_table.cart td.actions button[name="update_cart"] {
    width: 100% !important;
    float: none !important;
  }
}
