/*
 * wc-cart.css
 *
 * MegaSport theme styling for the native WooCommerce cart template
 * (woocommerce/cart/cart.php).  Requires style.css + header.css first.
 *
 * Targets every class WooCommerce generates itself:
 *   .woocommerce-cart-form, .shop_table, .cart_item,
 *   .product-remove, .product-thumbnail, .product-name,
 *   .product-price, .product-quantity, .product-subtotal,
 *   .actions, .coupon, .cart-collaterals, .cart_totals,
 *   .wc-proceed-to-checkout  … and more.
 *
 * Does NOT touch custom classes from the MegaSport cart.php page template
 * (those live in cart.css).
 */

/* ──────────────────────────────────────────
   PAGE WRAPPER
   WooCommerce outputs the cart inside the
   active theme's page.php / woocommerce.php.
   We constrain and pad it here.
────────────────────────────────────────── */
.woocommerce-cart .woocommerce {
  max-width: 1240px;
  margin: 0 auto;
  padding: 44px 24px 80px;
}

/* ──────────────────────────────────────────
   NOTICES (added to cart, error, etc.)
────────────────────────────────────────── */
.woocommerce-notices-wrapper { margin-bottom: 20px; }

.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  list-style: none;
}

.woocommerce-message {
  background: rgba(41,214,181,.08);
  border-color: rgba(41,214,181,.25);
  color: var(--accent3);
}

.woocommerce-error {
  background: rgba(255,92,53,.08);
  border-color: rgba(255,92,53,.25);
  color: var(--accent2);
}

.woocommerce-info {
  background: rgba(232,255,71,.06);
  border-color: rgba(232,255,71,.2);
  color: var(--accent);
}

.woocommerce-message a,
.woocommerce-error a,
.woocommerce-info a {
  font-weight: 800;
  text-decoration: underline;
  margin-left: auto;
  white-space: nowrap;
}

/* ──────────────────────────────────────────
   MAIN CART LAYOUT
   Two columns: form (table) + collaterals
────────────────────────────────────────── */
.woocommerce-cart .woocommerce > * {
  /* Stack everything by default; collaterals float right via its own rule */
}

/* ──────────────────────────────────────────
   CART FORM + TABLE
────────────────────────────────────────── */
.woocommerce-cart-form {
  width: 100%;
}

/* Reset browser table defaults */
.shop_table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-family: var(--ff-body);
  background: transparent;
}

/* ── THEAD ── */
.shop_table thead tr {
  border-bottom: 1px solid var(--border);
}

.shop_table thead th {
  padding: 0 12px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: none;
}

.shop_table thead .product-remove,
.shop_table thead .product-thumbnail {
  width: 32px;  /* narrow – just icon width */
}

.shop_table thead .product-price,
.shop_table thead .product-subtotal {
  text-align: right;
}

.shop_table thead .product-quantity {
  text-align: center;
}

/* ── TBODY rows ── */
.shop_table tbody .cart_item {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.shop_table tbody .cart_item:last-child {
  border-bottom: none;
}

.shop_table tbody td {
  padding: 20px 12px;
  vertical-align: middle;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

/* ── Remove button ── */
.shop_table .product-remove {
  width: 40px;
  text-align: center;
}

.shop_table .product-remove a.remove {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  transition: color .2s, border-color .2s, background .2s;
}

.shop_table .product-remove a.remove:hover {
  color: var(--accent2);
  border-color: rgba(255,92,53,.3);
  background: rgba(255,92,53,.06);
}

/* ── Thumbnail ── */
.shop_table .product-thumbnail {
  width: 90px;
}

.shop_table .product-thumbnail a {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #1d2133, #111520);
  border: 1px solid var(--border);
  transition: border-color .2s;
  flex-shrink: 0;
}

.shop_table .product-thumbnail a:hover {
  border-color: var(--accent);
}

.shop_table .product-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Product name ── */
.shop_table .product-name {
  min-width: 0;
}

.shop_table .product-name a {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  transition: color .2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop_table .product-name a:hover { color: var(--accent); }

/* Variation meta (colour, size, etc.) */
.shop_table .product-name .variation {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.shop_table .product-name .variation dt,
.shop_table .product-name .variation dd {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  padding: 0;
}

.shop_table .product-name .variation dd { color: var(--text); }

/* Backorder notice */
.shop_table .product-name .backorder_notification {
  font-size: 11px;
  color: var(--accent2);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── Price ── */
.shop_table .product-price {
  text-align: right;
  white-space: nowrap;
}

.shop_table .product-price .woocommerce-Price-amount,
.shop_table .product-subtotal .woocommerce-Price-amount {
  font-family: var(--ff-head);
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: .03em;
}

.shop_table .product-subtotal .woocommerce-Price-amount {
  color: var(--accent);   /* line total in accent */
  font-size: 1.15rem;
}

/* Strike-through original price */
.shop_table .product-price del .woocommerce-Price-amount {
  font-size: .85rem;
  color: var(--muted);
  font-family: var(--ff-body);
}

/* ── Quantity ── */
.shop_table .product-quantity {
  text-align: center;
}

/* WooCommerce quantity input wrapper */
.shop_table .product-quantity .quantity {
  display: inline-flex;
  align-items: center;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  transition: border-color .2s;
}

.shop_table .product-quantity .quantity:focus-within {
  border-color: var(--accent3);
}

/* The native WooCommerce qty input */
.shop_table .product-quantity .qty {
  width: 52px;
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 0 4px;
  height: 38px;
  outline: none;
  -moz-appearance: textfield;
}

.shop_table .product-quantity .qty::-webkit-inner-spin-button,
.shop_table .product-quantity .qty::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* ── Subtotal ── */
.shop_table .product-subtotal {
  text-align: right;
  white-space: nowrap;
}

/* ── Actions row (coupon + update cart) ── */
.shop_table .actions {
  padding: 20px 12px 0;
  border-top: 1px solid var(--border);
}

.shop_table .actions > td {
  padding-top: 20px;
}

.woocommerce form {
	padding: 0 20%;
}

/* Coupon block */
.woocommerce-cart-form .coupon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color .2s;
  float: left;
}

.woocommerce-cart-form .coupon:focus-within {
  border-color: var(--accent3);
}

.woocommerce-cart-form .coupon label {
  /* screen-reader-text — visually hidden */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.woocommerce-cart-form .coupon input.input-text {
  background: none;
  border: none;
  outline: none;
  font-family: var(--ff-body);
  font-size: 13px;
  color: var(--text);
  min-width: 180px;
}

.woocommerce-cart-form .coupon input.input-text::placeholder {
  color: var(--muted);
}

/* Shared WC button → MegaSport btn-outline style */
.woocommerce-cart-form .button,
.woocommerce button.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--ff-body);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.25);
  background: transparent;
  color: var(--text);
  transition: border-color .2s, color .2s, transform .2s;
  white-space: nowrap;
}

.woocommerce-cart-form .button:hover,
.woocommerce button.button:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Update cart button sits on the right */
.woocommerce-cart-form [name="update_cart"] {
  float: right;
}

/* Clearfix for the actions row */
.woocommerce-cart-form .actions::after {
  content: '';
  display: table;
  clear: both;
}

/* ──────────────────────────────────────────
   CART COLLATERALS
   WooCommerce puts cross-sells + cart totals
   inside .cart-collaterals. We split them
   into a two-column layout that mirrors the
   custom cart page.
────────────────────────────────────────── */
.cart-collaterals {
  margin-top: 48px;
  align-items: start;
}

.woocommerce .cart-collaterals .cart_totals, .woocommerce-page .cart-collaterals .cart_totals {
    float: right;
    width: 100%; !important;
}

/* Cross-sells take the left column */
.cross-sells {
  min-width: 0;
}

.cross-sells h2 {
  font-family: var(--ff-head);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: .04em;
  margin-bottom: 20px;
}

.cross-sells .products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cross-sells .product {
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}

.cross-sells .product:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(232,255,71,.2);
}

.cross-sells .product img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}

.cross-sells .product h2,
.cross-sells .product h3 {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  padding: 12px 14px 4px;
  margin: 0;
  color: var(--text);
}

.cross-sells .woocommerce-Price-amount {
  font-family: var(--ff-head);
  font-size: 1.1rem;
  color: var(--accent);
  padding: 0 14px;
  display: block;
}

.cross-sells .add_to_cart_button {
  margin: 10px 14px 14px;
  width: calc(100% - 28px);
  justify-content: center;
}

/* ──────────────────────────────────────────
   CART TOTALS (right column of collaterals)
────────────────────────────────────────── */
.cart_totals {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
	white-space: nowrap;
	padding: 0 20%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  /* Sticky so it follows while user scrolls cross-sells */
  position: sticky;
  top: 90px;
}

/* Accent gradient top-right to match custom cart summary */
.cart_totals::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(232,255,71,.04), transparent 60%);
  pointer-events: none;
}

.cart_totals h2 {
  font-family: var(--ff-head);
  font-size: 1.3rem;
  letter-spacing: .05em;
  padding: 22px 22px 0;
  position: relative;
  margin: 0;
}

/* Totals table */
.cart_totals table.shop_table {
  border: none;
  width: 100%;
}

.cart_totals table.shop_table th,
.cart_totals table.shop_table td {
  padding: 10px 22px;
  font-size: 13px;
  border: none;
  background: transparent;
  vertical-align: middle;
}

.cart_totals table.shop_table th {
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  width: 40%;
}

.cart_totals table.shop_table td {
  text-align: right;
  color: var(--text);
  font-weight: 700;
}

.cart_totals table.shop_table .cart-subtotal td .woocommerce-Price-amount,
.cart_totals table.shop_table .order-total td .woocommerce-Price-amount {
  font-family: var(--ff-head);
  letter-spacing: .03em;
}

.cart_totals table.shop_table .order-total td .woocommerce-Price-amount {
  font-size: 1.9rem;
  color: var(--accent);
}

/* Shipping row */
.cart_totals table.shop_table .woocommerce-shipping-totals td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.btn.btn-primary.btn-full.cart-checkout-btn{
	max-width: 100%;
}

.cart_totals .woocommerce-shipping-calculator { margin-top: 8px; }

/* Divider above order total */
.cart_totals table.shop_table .order-total {
  border-top: 1px solid var(--border);
}

.cart_totals table.shop_table .order-total th,
.cart_totals table.shop_table .order-total td {
  padding-top: 16px;
  padding-bottom: 4px;
}

/* Tax note */
.cart_totals .tax_label,
.cart_totals .includes_tax {
  font-size: 11px;
  color: var(--muted);
  display: block;
  text-align: right;
  padding: 0 22px 12px;
  position: relative;
}

/* Proceed to checkout button */
.wc-proceed-to-checkout {
  padding: 4px 22px 18px;
  position: relative;
}

.wc-proceed-to-checkout .checkout-button,
.wc-proceed-to-checkout a.checkout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
}

.wc-proceed-to-checkout .checkout-button:hover {
  background: #d4eb30;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

/* ──────────────────────────────────────────
   SHIPPING CALCULATOR
────────────────────────────────────────── */
.shipping-calculator-button {
  font-size: 12px;
  color: var(--accent3);
  text-decoration: none;
  font-weight: 700;
  transition: color .2s;
}
.shipping-calculator-button:hover { color: var(--accent); }
.shipping-calculator-button::after { content: ' ↓'; }

.shipping-calculator-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shipping-calculator-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.shipping-calculator-form label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.shipping-calculator-form select,
.shipping-calculator-form input[type="text"],
.shipping-calculator-form input[type="tel"] {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--ff-body);
  font-size: 13px;
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border-color .2s;
}

.shipping-calculator-form select:focus,
.shipping-calculator-form input:focus {
  border-color: var(--accent3);
}

/* ──────────────────────────────────────────
   EMPTY CART STATE
────────────────────────────────────────── */
.woocommerce-cart .cart-empty {
  text-align: center;
  padding: 80px 24px;
  font-family: var(--ff-head);
  font-size: 1.6rem;
  letter-spacing: .04em;
  color: var(--muted);
}

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

.woocommerce-cart .return-to-shop a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s, transform .2s;
}

.woocommerce-cart .return-to-shop a:hover {
  background: #d4eb30;
  transform: translateY(-2px);
}

/* ──────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────── */
@media (max-width: 1024px) {
	.woocommerce form {
		padding: 0 30px;
	}
	
  .cart-collaterals {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cart_totals {
    position: static;
    order: -1; /* totals panel above cross-sells on tablet */
	padding: 0 30px;
  }

  .cross-sells .products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .woocommerce-cart .woocommerce {
    padding: 28px 16px 60px;
  }

  /* Collapse table to data-title card layout */
  .shop_table thead { display: none; }

  .shop_table,
  .shop_table tbody,
  .shop_table tr,
  .shop_table td,
	.shop-table tfoot {
    width: 100%;
  }

  .shop_table tbody .cart_item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "remove  thumb"
      ".       name"
      ".       qty"
      ".       subtotal";
    gap: 8px 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
  }

  .shop_table .product-remove  { grid-area: remove;   width: auto; padding: 0; }
  .shop_table .product-thumbnail { grid-area: thumb;  width: auto; padding: 0; }
  .shop_table .product-name    { grid-area: name;     padding: 0; }
  .shop_table .product-price   { display: none; } /* shown in product-name via data-title */
  .shop_table .product-quantity{ grid-area: qty;     text-align: left; padding: 0; }
  .shop_table .product-subtotal{ grid-area: subtotal; text-align: left; padding: 0; }

  .shop_table .product-subtotal::before {
    content: attr(data-title) ': ';
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 2px;
  }
	
	.cart-totals {
		padding: 0 15px;
	}

  /* Thumbnail smaller on mobile */
  .shop_table .product-thumbnail a {
    width: 64px;
    height: 64px;
  }

  /* Actions row */
  .woocommerce-cart-form .coupon {
    float: none;
    width: 100%;
    margin-bottom: 12px;
  }

  .woocommerce-cart-form .coupon input.input-text {
    min-width: 0;
    flex: 1;
  }

  .woocommerce-cart-form [name="update_cart"] {
    float: none;
    width: 100%;
  }

  .cross-sells .products { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .shop_table tbody .cart_item {
    grid-template-columns: 1fr;
    grid-template-areas:
      "thumb"
      "name"
      "qty"
      "subtotal"
      "remove";
  }

  .shop_table .product-remove {
    text-align: left;
    padding-top: 4px;
  }
}
