/*
 * CA Study Shop transaction surfaces
 *
 * Presentation only.  All selectors are restricted to WooCommerce's Cart,
 * Checkout and Fast Cart DOM. No display rule hides a required order value,
 * form field, consent field, payment method or action.
 */

body.woocommerce-cart,
body.woocommerce-checkout:not(.wfc-checkout),
.wc-fast-cart {
  --csw-ink: #1d2736;
  --csw-muted: #657286;
  --csw-line: #e4e9f0;
  --csw-surface: #ffffff;
  --csw-tint: #f7f5ff;
  --csw-brand: #5e17eb;
  --csw-brand-deep: #4610b6;
  --csw-shadow: 0 16px 42px rgba(27, 39, 56, .10);
}

/* Shared hierarchy for the two full-page purchase surfaces. */
body.woocommerce-cart .site-content,
body.woocommerce-checkout:not(.wfc-checkout) .site-content { color: var(--csw-ink); }

body.woocommerce-cart .entry-header .entry-title,
body.woocommerce-checkout:not(.wfc-checkout) .entry-header .entry-title {
  color: var(--csw-ink);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 750;
  letter-spacing: -.035em;
}

/* Cart: product decision on the left, concise purchase summary on the right. */
@media (min-width: 922px) {
  body.woocommerce-cart .woocommerce {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, .42fr);
    align-items: start;
    gap: 32px;
  }

  body.woocommerce-cart .woocommerce-cart-form { min-width: 0; }
  body.woocommerce-cart .cart-collaterals { float: none; width: auto; }
}

body.woocommerce-cart table.shop_table {
  overflow: hidden;
  border: 1px solid var(--csw-line);
  border-radius: 16px;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: 0 8px 24px rgba(27, 39, 56, .045);
}

body.woocommerce-cart table.shop_table thead th {
  padding: 15px 14px;
  border: 0;
  background: #f8fafc;
  color: #536174;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.woocommerce-cart table.shop_table td {
  padding: 20px 14px;
  border-color: var(--csw-line);
  vertical-align: top;
}

body.woocommerce-cart .product-name > a {
  color: var(--csw-ink);
  font-size: 15px;
  font-weight: 720;
  line-height: 1.35;
  text-decoration: none;
}

body.woocommerce-cart dl.variation,
.wc-fast-cart dl.variation {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 10px;
  margin: 12px 0 0;
  padding: 11px 12px;
  border: 1px solid #ece8f8;
  border-radius: 10px;
  background: #fbfaff;
  color: #536174;
  font-size: 12px;
  line-height: 1.4;
}

body.woocommerce-cart dl.variation dt,
.wc-fast-cart dl.variation dt { color: #596276; font-weight: 700; }
body.woocommerce-cart dl.variation dd,
.wc-fast-cart dl.variation dd { margin: 0; color: #344154; }
body.woocommerce-cart dl.variation dd p,
.wc-fast-cart dl.variation dd p { margin: 0; }

body.woocommerce-cart .product-price,
body.woocommerce-cart .product-subtotal { color: var(--csw-ink); font-weight: 700; }
body.woocommerce-cart .product-thumbnail img { border-radius: 10px; }

body.woocommerce-cart .cart-collaterals .cart_totals {
  float: none;
  width: auto;
  padding: 24px;
  border: 1px solid #dfd8f7;
  border-radius: 18px;
  background: linear-gradient(155deg, #fbfaff 0%, #fff 58%);
  box-shadow: var(--csw-shadow);
}

body.woocommerce-cart .cart_totals > h2 {
  margin: 0 0 18px;
  color: var(--csw-ink);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.015em;
}

body.woocommerce-cart .cart_totals table { border: 0; box-shadow: none; }
body.woocommerce-cart .cart_totals table th,
body.woocommerce-cart .cart_totals table td { padding: 12px 0; border-color: var(--csw-line); }
body.woocommerce-cart .cart_totals .order-total th,
body.woocommerce-cart .cart_totals .order-total td { color: var(--csw-ink); font-size: 18px; font-weight: 750; }

body.woocommerce-cart .wc-proceed-to-checkout { padding: 18px 0 0; }
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.wc-fast-cart .wfc-checkout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 1px solid var(--csw-brand);
  border-radius: 10px;
  background: linear-gradient(115deg, var(--csw-brand) 0%, #7b35ec 100%);
  box-shadow: 0 10px 22px rgba(94, 23, 235, .22);
  color: #fff !important;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .01em;
  text-decoration: none;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.wc-fast-cart .wfc-checkout-button:hover {
  background: var(--csw-brand-deep);
  box-shadow: 0 13px 26px rgba(70, 16, 182, .28);
  transform: translateY(-1px);
}

/* Checkout: visually separate the trusted customer form from the order recap. */
body.woocommerce-checkout:not(.wfc-checkout) form.woocommerce-checkout {
  display: grid;
  gap: 28px;
}

body.woocommerce-checkout:not(.wfc-checkout) .woocommerce-billing-fields,
body.woocommerce-checkout:not(.wfc-checkout) .woocommerce-additional-fields,
body.woocommerce-checkout:not(.wfc-checkout) #order_review {
  border: 1px solid var(--csw-line);
  border-radius: 18px;
  background: var(--csw-surface);
  box-shadow: 0 8px 24px rgba(27, 39, 56, .045);
}

body.woocommerce-checkout:not(.wfc-checkout) .woocommerce-billing-fields,
body.woocommerce-checkout:not(.wfc-checkout) .woocommerce-additional-fields { padding: 24px; }
body.woocommerce-checkout:not(.wfc-checkout) .woocommerce-billing-fields > h3,
body.woocommerce-checkout:not(.wfc-checkout) .woocommerce-additional-fields > h3,
body.woocommerce-checkout:not(.wfc-checkout) #order_review_heading {
  margin: 0 0 20px;
  color: var(--csw-ink);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.015em;
}

body.woocommerce-checkout:not(.wfc-checkout) .form-row label { color: #4f5d71; font-size: 13px; font-weight: 700; }
body.woocommerce-checkout:not(.wfc-checkout) .form-row input.input-text,
body.woocommerce-checkout:not(.wfc-checkout) .form-row textarea,
body.woocommerce-checkout:not(.wfc-checkout) .select2-container .select2-selection {
  min-height: 46px;
  border: 1px solid #cfd8e5;
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
  color: var(--csw-ink);
}
body.woocommerce-checkout:not(.wfc-checkout) .form-row input.input-text,
body.woocommerce-checkout:not(.wfc-checkout) .form-row textarea { padding: 11px 13px; }
body.woocommerce-checkout:not(.wfc-checkout) .form-row input.input-text:focus,
body.woocommerce-checkout:not(.wfc-checkout) .form-row textarea:focus { border-color: var(--csw-brand); box-shadow: 0 0 0 3px rgba(94, 23, 235, .12); outline: 0; }

body.woocommerce-checkout:not(.wfc-checkout) #order_review { overflow: hidden; padding: 0 24px 24px; }
body.woocommerce-checkout:not(.wfc-checkout) #order_review table.shop_table { margin: 0 -24px 20px; border: 0; border-radius: 0; box-shadow: none; }
body.woocommerce-checkout:not(.wfc-checkout) #order_review table.shop_table th,
body.woocommerce-checkout:not(.wfc-checkout) #order_review table.shop_table td { padding: 14px 24px; border-color: var(--csw-line); }
body.woocommerce-checkout:not(.wfc-checkout) #payment { margin: 0; border: 1px solid #e5defa; border-radius: 12px; background: #faf9ff; }
body.woocommerce-checkout:not(.wfc-checkout) #payment .place-order { padding: 18px; }
body.woocommerce-checkout:not(.wfc-checkout) #place_order { min-height: 52px; border-radius: 10px; background: linear-gradient(115deg, var(--csw-brand) 0%, #7b35ec 100%); font-weight: 750; }

@media (min-width: 922px) {
  body.woocommerce-checkout:not(.wfc-checkout) form.woocommerce-checkout {
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
    align-items: start;
  }
  body.woocommerce-checkout:not(.wfc-checkout) .col2-set { grid-column: 1; }
  body.woocommerce-checkout:not(.wfc-checkout) #order_review_heading,
  body.woocommerce-checkout:not(.wfc-checkout) #order_review { grid-column: 2; }
  body.woocommerce-checkout:not(.wfc-checkout) #order_review_heading { margin-bottom: -8px; }
  body.woocommerce-checkout:not(.wfc-checkout) #order_review { position: sticky; top: 22px; }
}

/* Fast Cart: preserve every control, while making the modal feel deliberate. */
.wc-fast-cart {
  --wfc-btn-radius: 10px;
  --wfc-btn-bg-color: var(--csw-brand);
  --wfc-btn-border-color: var(--csw-brand);
  --wfc-font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--csw-ink);
}

.wc-fast-cart.is-style-modal {
  max-width: 1040px;
  padding: 30px;
  border: 1px solid rgba(223, 216, 247, .95);
  border-radius: 18px;
  box-shadow: 0 28px 85px rgba(15, 20, 33, .34);
}

.wc-fast-cart > h2 {
  margin: 0;
  padding: 0 50px 20px 0;
  border-bottom: 1px solid var(--csw-line);
  color: var(--csw-ink);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -.025em;
}

.wc-fast-cart .wc-fast-cart__close-btn {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 20;
  border: 1px solid #e0e5ed;
  border-radius: 50%;
  background: #fff;
  color: #536174;
}
.wc-fast-cart .wc-fast-cart__close-btn::before {
  content: "×";
  display: block;
  color: #5e17eb;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}
.wc-fast-cart .wc-fast-cart__close-btn svg { display: none; }
.wc-fast-cart .wc-fast-cart__close-btn:hover { border-color: #c7b9ee; background: #f6f3ff; color: var(--csw-brand); }

.wc-fast-cart .wfc-cart-table { border-color: var(--csw-line); }
.wc-fast-cart .wfc-cart-table .product-thumbnail img { border: 1px solid #edf0f4; border-radius: 10px; }
.wc-fast-cart .wfc-cart-table .product-name > a { color: var(--csw-ink); font-size: 14px; font-weight: 750; line-height: 1.36; text-decoration: none; }
.wc-fast-cart .wfc-cart-table .product-price,
.wc-fast-cart .wfc-cart-table .product-subtotal { color: var(--csw-ink); font-weight: 750; }
.wc-fast-cart .wfc-cart-table .wfc-cart__remove { border-radius: 50%; }

.wc-fast-cart .wfc-coupon { max-width: 390px; }
.wc-fast-cart .wfc-coupon h2 { color: var(--csw-ink); font-size: 14px; font-weight: 750; letter-spacing: -.01em; }
.wc-fast-cart .wfc-coupon input.input-text[type=text] { border: 1px solid #cfd8e5; border-radius: 9px 0 0 9px; color: var(--csw-ink); }
.wc-fast-cart .wfc-coupon button.wfc-button { border-radius: 0 9px 9px 0; background: #344154; color: #fff; font-weight: 700; }

.wc-fast-cart .wfc-cart-totals {
  padding: 20px;
  border: 1px solid #dfd8f7;
  border-radius: 15px;
  background: linear-gradient(155deg, #fbfaff 0%, #fff 70%);
}
.wc-fast-cart .wfc-cart-totals > h2 { margin: 0 0 15px; padding: 0; border: 0; color: var(--csw-ink); font-size: 17px; font-weight: 750; }
.wc-fast-cart .wfc-cart-totals__table { border: 0; }
.wc-fast-cart .wfc-cart-totals__table tr.order-total th,
.wc-fast-cart .wfc-cart-totals__table tr.order-total td { color: var(--csw-ink); font-size: 18px; font-weight: 750; }
.wc-fast-cart .wfc-checkout-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wc-fast-cart .wfc-exit {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  order: 2;
  border: 1px solid #6c23ed;
  border-radius: 10px;
  color: #4e2aa2;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.wc-fast-cart .wfc-exit:hover { background: #f6f3ff; }

@media (max-width: 781px) {
  body.woocommerce-cart table.shop_table { border-radius: 13px; }
  body.woocommerce-cart table.shop_table td { padding: 16px 12px; }
  body.woocommerce-cart .cart-collaterals .cart_totals,
  body.woocommerce-checkout:not(.wfc-checkout) .woocommerce-billing-fields,
  body.woocommerce-checkout:not(.wfc-checkout) .woocommerce-additional-fields { padding: 19px; }
  body.woocommerce-checkout:not(.wfc-checkout) #order_review { padding: 0 19px 19px; }
  body.woocommerce-checkout:not(.wfc-checkout) #order_review table.shop_table { margin: 0 -19px 18px; }
  body.woocommerce-checkout:not(.wfc-checkout) #order_review table.shop_table th,
  body.woocommerce-checkout:not(.wfc-checkout) #order_review table.shop_table td { padding: 13px 19px; }
  .wc-fast-cart.is-style-modal { margin: 12px; padding: 22px 18px; border-radius: 15px; }
  .wc-fast-cart > h2 { padding-bottom: 17px; font-size: 21px; }
  .wc-fast-cart .wc-fast-cart__close-btn { top: 14px; right: 14px; }
  .wc-fast-cart dl.variation { grid-template-columns: 1fr; gap: 2px; }
  .wc-fast-cart dl.variation dt { margin-top: 5px; }
  .wc-fast-cart .wfc-cart-totals { padding: 17px; }
}
