/**
 * Cart & Checkout Page — Premium Redesign
 * Only loaded on cart and checkout pages via functions.php
 */

/* ============================================
   GENERAL — Shared styles for Cart & Checkout
   ============================================ */

/* Page title */
.woocommerce-cart .page-title,
.woocommerce-checkout .page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 30px;
}

/* Cart steps breadcrumb */
.woocommerce-cart .cart-checkout-steps,
.woocommerce-checkout .cart-checkout-steps {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  color: #999;
}

.woocommerce-cart .cart-checkout-steps .current-step,
.woocommerce-checkout .cart-checkout-steps .current-step {
  color: #1e7228;
}

/* ============================================
   CART PAGE
   ============================================ */

/* Cart table — clean modern look */
.woocommerce-cart .shop_table {
  border: none !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.woocommerce-cart .shop_table thead th {
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid #e8e8e8 !important;
  color: #888 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  padding: 12px 10px !important;
}

.woocommerce-cart .shop_table td {
  border: none !important;
  border-bottom: 1px solid #f0f0f0 !important;
  padding: 20px 10px !important;
  vertical-align: middle !important;
}

/* Product row */
.woocommerce-cart .shop_table .cart_item {
  transition: background 0.2s ease;
}

.woocommerce-cart .shop_table .cart_item:hover {
  background: #fafafa;
}

/* Product thumbnail */
.woocommerce-cart .shop_table .product-thumbnail img {
  width: 80px !important;
  height: 80px !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  border: 1px solid #eee !important;
  padding: 4px !important;
  background: #fff !important;
}

/* Product name */
.woocommerce-cart .shop_table .product-name a {
  color: #333 !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
}

.woocommerce-cart .shop_table .product-name a:hover {
  color: #1e7228 !important;
}

/* Product price */
.woocommerce-cart .shop_table .product-price .amount,
.woocommerce-cart .shop_table .product-subtotal .amount {
  font-weight: 600 !important;
  color: #333 !important;
  font-size: 15px !important;
}

/* Remove button — trash icon style */
.woocommerce-cart .shop_table .product-remove a.remove {
  width: 32px !important;
  height: 32px !important;
  border-radius: 6px !important;
  background: #f5f5f5 !important;
  color: #999 !important;
  font-size: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  border: 1px solid #e5e5e5 !important;
  text-decoration: none !important;
}

.woocommerce-cart .shop_table .product-remove a.remove:hover {
  background: #fee !important;
  color: #e53935 !important;
  border-color: #e53935 !important;
}

/* Quantity input — modern pill style */
.woocommerce-cart .quantity {
  display: inline-flex !important;
  align-items: center !important;
  border: 1px solid #ddd !important;
  border-radius: 50px !important;
  overflow: hidden !important;
  background: #f9f9f9 !important;
}

.woocommerce-cart .quantity .minus,
.woocommerce-cart .quantity .plus,
.woocommerce-cart .quantity .ux-quantity__button {
  width: 34px !important;
  height: 34px !important;
  border: none !important;
  background: transparent !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #555 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.2s !important;
}

.woocommerce-cart .quantity .minus:hover,
.woocommerce-cart .quantity .plus:hover,
.woocommerce-cart .quantity .ux-quantity__button:hover {
  background: #eee !important;
}

.woocommerce-cart .quantity input.qty {
  width: 40px !important;
  height: 34px !important;
  border: none !important;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  background: transparent !important;
  -moz-appearance: textfield !important;
}

.woocommerce-cart .quantity input.qty::-webkit-outer-spin-button,
.woocommerce-cart .quantity input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* Action buttons row */
.woocommerce-cart .shop_table .actions {
  border: none !important;
  padding-top: 20px !important;
}

.woocommerce-cart .shop_table .actions .button {
  border-radius: 50px !important;
  padding: 10px 24px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  transition: all 0.2s ease !important;
}

/* Continue shopping button */
.woocommerce-cart a.continue-shopping,
.woocommerce-cart .button.continue-shopping {
  border-radius: 50px !important;
  padding: 10px 24px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  border: 2px solid #1e7228 !important;
  background: transparent !important;
  color: #1e7228 !important;
}

.woocommerce-cart a.continue-shopping:hover,
.woocommerce-cart .button.continue-shopping:hover {
  background: #1e7228 !important;
  color: #fff !important;
}

/* Update cart button */
.woocommerce-cart .actions button[name="update_cart"] {
  border-radius: 50px !important;
  background: #333 !important;
  color: #fff !important;
  border: none !important;
}

.woocommerce-cart .actions button[name="update_cart"]:hover {
  background: #555 !important;
}

/* ============================================
   CART TOTALS — Card style
   ============================================ */

.woocommerce-cart .cart_totals {
  background: #fff !important;
  border: 1px solid #eee !important;
  border-radius: 12px !important;
  padding: 24px !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04) !important;
}

.woocommerce-cart .cart_totals h2 {
  font-size: 18px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 16px !important;
  padding-bottom: 12px !important;
  border-bottom: 2px solid #eee !important;
  color: #222 !important;
}

.woocommerce-cart .cart_totals table {
  border: none !important;
}

.woocommerce-cart .cart_totals table th,
.woocommerce-cart .cart_totals table td {
  border: none !important;
  padding: 10px 0 !important;
  font-size: 14px !important;
}

.woocommerce-cart .cart_totals table th {
  color: #777 !important;
  font-weight: 500 !important;
}

.woocommerce-cart .cart_totals .order-total th,
.woocommerce-cart .cart_totals .order-total td {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #222 !important;
  padding-top: 16px !important;
  border-top: 1px solid #eee !important;
}

/* Proceed to checkout button */
.woocommerce-cart .checkout-button {
  border-radius: 50px !important;
  padding: 3px 30px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  background: #1e7228 !important;
  color: #fff !important;
  width: 100% !important;
  text-align: center !important;
  margin-top: 16px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(30, 114, 40, 0.3) !important;
}

.woocommerce-cart .checkout-button:hover {
  background: #165e1e !important;
  box-shadow: 0 6px 20px rgba(30, 114, 40, 0.4) !important;
  transform: translateY(-1px) !important;
}

/* ============================================
   COUPON SECTION
   ============================================ */

.woocommerce-cart .coupon {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  flex-wrap: wrap !important;
}

.woocommerce-cart .coupon label {
  font-weight: 600 !important;
  font-size: 14px !important;
  color: #333 !important;
  width: 100% !important;
  margin-bottom: 4px !important;
}

.woocommerce-cart .coupon #coupon_code {
  flex: 1 !important;
  min-width: 180px !important;
  padding: 10px 16px !important;
  border: 1px solid #ddd !important;
  border-radius: 50px !important;
  font-size: 14px !important;
  outline: none !important;
  transition: border-color 0.2s !important;
}

.woocommerce-cart .coupon #coupon_code:focus {
  border-color: #1e7228 !important;
  box-shadow: 0 0 0 3px rgba(30, 114, 40, 0.1) !important;
}

.woocommerce-cart .coupon .button {
  border-radius: 50px !important;
  padding: 10px 24px !important;
  background: #1e7228 !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  border: none !important;
}

.woocommerce-cart .coupon .button:hover {
  background: #165e1e !important;
}

/* ============================================
   CHECKOUT PAGE
   ============================================ */

/* Form fields — modern clean design */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout .woocommerce-additional-fields h3 {
  font-size: 18px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: #222 !important;
  margin-bottom: 20px !important;
  padding-bottom: 12px !important;
  border-bottom: 2px solid #eee !important;
}

/* Form row */
.woocommerce-checkout .form-row {
  margin-bottom: 16px !important;
}

.woocommerce-checkout .form-row label {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #555 !important;
  margin-bottom: 6px !important;
}

/* Input fields */
.woocommerce-checkout .woocommerce-input-wrapper input,
.woocommerce-checkout .woocommerce-input-wrapper textarea,
.woocommerce-checkout .woocommerce-input-wrapper select,
.woocommerce-checkout .select2-container .select2-selection--single {
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  padding: 0px 16px !important;
  font-size: 14px !important;
  transition: border-color 0.2s ease !important;
  background: #fff !important;
}

.woocommerce-checkout .woocommerce-input-wrapper input:focus,
.woocommerce-checkout .woocommerce-input-wrapper textarea:focus {
  border-color: #1e7228 !important;
  box-shadow: 0 0 0 3px rgba(30, 114, 40, 0.1) !important;
  outline: none !important;
}

/* Order review section */
.woocommerce-checkout #order_review_heading {
  font-size: 18px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 16px !important;
}

/* Order review table */
.woocommerce-checkout .woocommerce-checkout-review-order-table {
  border: 1px solid #eee !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border-collapse: separate !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table thead th {
  background: #f8f8f8 !important;
  border: none !important;
  padding: 14px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  color: #666 !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table td,
.woocommerce-checkout .woocommerce-checkout-review-order-table th {
  border: none !important;
  border-bottom: 1px solid #f0f0f0 !important;
  padding: 12px 16px !important;
}

/* Alternating row backgrounds for item distinction */
.woocommerce-checkout .woocommerce-checkout-review-order-table tbody tr.cart_item:nth-child(odd) {
  background: #fff !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tbody tr.cart_item:nth-child(even) {
  background: #f8faf8 !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table .order-total td,
.woocommerce-checkout .woocommerce-checkout-review-order-table .order-total th {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #222 !important;
  border-bottom: none !important;
}

/* ── Checkout — Product thumbnail in order review ── */
.woocommerce-checkout .woocommerce-checkout-review-order-table td.product-name {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-wrap: wrap !important;
}

.checkout-product-with-thumb {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.checkout-thumb-wrap {
  flex-shrink: 0 !important;
}

.checkout-thumb-wrap img.checkout-product-thumbnail {
  width: 60px !important;
  height: 60px !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  border: 1px solid #eee !important;
  padding: 3px !important;
  background: #fff !important;
}

.checkout-product-name {
  flex: 1 !important;
  line-height: 1.4 !important;
  font-size: 14px !important;
  color: #333 !important;
  min-width: 0 !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table td.product-name .product-quantity {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Payment methods */
.woocommerce-checkout #payment {
  background: #fff !important;
  border: 1px solid #eee !important;
  border-radius: 12px !important;
  padding: 20px !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04) !important;
}

.woocommerce-checkout #payment .payment_methods {
  border: none !important;
  padding: 0 !important;
  margin-bottom: 16px !important;
}

.woocommerce-checkout #payment .payment_methods li {
  border-bottom: 1px solid #f0f0f0 !important;
  padding: 14px 0 !important;
}

.woocommerce-checkout #payment .payment_methods li:last-child {
  border-bottom: none !important;
}

.woocommerce-checkout #payment .payment_methods li label {
  font-weight: 600 !important;
  color: #333 !important;
  cursor: pointer !important;
}

/* Place order button */
.woocommerce-checkout #place_order {
  border-radius: 50px !important;
  padding: 16px 40px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  background: #1e7228 !important;
  color: #fff !important;
  width: 100% !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(30, 114, 40, 0.3) !important;
  border: none !important;
}

.woocommerce-checkout #place_order:hover {
  background: #165e1e !important;
  box-shadow: 0 6px 20px rgba(30, 114, 40, 0.4) !important;
  transform: translateY(-1px) !important;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .woocommerce-cart .shop_table .product-thumbnail img {
    width: 60px !important;
    height: 60px !important;
  }

  .woocommerce-cart .cart_totals {
    padding: 16px !important;
    border-radius: 8px !important;
  }

  .woocommerce-cart .coupon {
    flex-direction: column !important;
  }

  .woocommerce-cart .coupon #coupon_code {
    width: 100% !important;
  }

  .woocommerce-checkout .woocommerce-checkout-review-order-table {
    border-radius: 8px !important;
  }

  .woocommerce-checkout #payment {
    padding: 14px !important;
    border-radius: 8px !important;
  }

  .checkout-thumb-wrap img.checkout-product-thumbnail {
    width: 48px !important;
    height: 48px !important;
    border-radius: 6px !important;
  }

  .checkout-product-with-thumb {
    gap: 8px !important;
  }
}

/* ==========================================================================
   BLOCK CHECKOUT — Styles for WooCommerce Block-based Checkout
   ========================================================================== */

/* ── Return to Cart button ── */
.wc-block-components-checkout-return-to-cart-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 3px 24px !important;
  border: 1.5px solid #ddd !important;
  border-radius: 50px !important;
  background: #fff !important;
  color: #222 !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 38px;
  margin-bottom: 12px;
}

.wc-block-components-checkout-return-to-cart-button:hover {
  border-color: #333 !important;
  background: #f5f5f5 !important;
  color: #000 !important;
}

/* Arrow icon */
.wc-block-components-checkout-return-to-cart-button svg {
  width: 18px !important;
  height: 18px !important;
  fill: #222 !important;
  flex-shrink: 0 !important;
}

/* Cart icon after arrow */
.wc-block-components-checkout-return-to-cart-button svg+* {
  display: none !important;
}

.wc-block-components-checkout-return-to-cart-button::after {
  content: "🛒" !important;
  font-size: 16px !important;
  order: -1 !important;
  margin-left: 14px !important;
}

.wc-block-cart__submit-container a,
button.wc-block-components-checkout-place-order-button {
  border-radius: 40px !important;
  padding: 14px 40px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  background: #1e7228;
  color: #fff;
  width: 100% !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(30, 114, 40, 0.3) !important;
  border: none !important;
}

.wc-block-cart__submit-container a:hover {
  background: #195b21;
}

/* ── Checkout actions — row layout only on desktop ── */
@media (min-width: 769px) {
  .wc-block-checkout__actions {
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .wc-block-checkout__actions .wc-block-components-checkout-place-order-button {
    flex: 1 !important;
  }
}

/* ── Block Checkout Responsive ── */
@media (max-width: 768px) {
  .wc-block-components-checkout-return-to-cart-button {
    font-size: 12px !important;
    padding: 3px 14px !important;
    gap: 4px !important;
  }

  .wc-block-components-checkout-return-to-cart-button svg {
    width: 14px !important;
    height: 14px !important;
  }

  .wc-block-components-checkout-return-to-cart-button::after {
    font-size: 13px !important;
    margin-left: 8px !important;
  }

  button.wc-block-components-checkout-place-order-button {
    padding: 12px 20px !important;
    font-size: 14px !important;
  }
}