/* ============================================================
   Checkout page (classic WooCommerce form on /checkout/).
   Enqueued by wordpress/mu-plugins/explorecity-checkout.php only
   on the checkout form (not on order-received). The plugin also
   prints the top bar (.ec-co-header), wraps the form into
   .ec-co-aside (order summary) + .ec-co-main (fields, promo
   code, pay button) and adds the inline promo-code block.
   ============================================================ */

/* ---------- Page ---------- */

body.ec-checkout {
  box-sizing: border-box;
  min-height: 100vh; /* the gradient must cover the viewport even on a short page */
  font-family: 'Manrope', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text-dark);
  background:
    radial-gradient(circle at top left, rgba(249, 225, 76, 0.22), transparent 28rem),
    var(--bg-light);
  padding-top: var(--header-height);
}

/* WooCommerce ships a bare "Checkout Header" template part (site title only);
   the branded bar below replaces it. */
body.ec-checkout .wp-site-blocks > header.wp-block-template-part {
  display: none;
}

body.ec-checkout main.wp-block-group {
  max-width: var(--container) !important;
  margin: 0 auto !important;
  padding: 0 clamp(1rem, 4vw, var(--gutter)) 4rem !important;
}

body.ec-checkout .entry-content {
  max-width: none !important;
  margin: 1.25rem 0 0 !important;
}

body.ec-checkout .entry-content > .woocommerce {
  max-width: 64rem;
  margin: 0 auto;
}

@media (min-width: 60rem) {
  body.ec-checkout .entry-content {
    margin-top: 2.5rem !important;
  }
}

/* ---------- Top bar ---------- */

.ec-co-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-height);
  background: var(--bg-dark);
  color: #fff;
}

.ec-co-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, var(--gutter));
}

.ec-co-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.ec-co-logo img {
  width: 1.625rem;
  height: auto;
}

.ec-co-logo__text {
  display: inline-flex;
  flex-direction: column;
  gap: 0.125rem;
  font-size: 0.875rem;
  line-height: 1;
}

.ec-co-logo__sub {
  letter-spacing: 0.18em;
}

.ec-co-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.ec-co-back:hover {
  color: var(--accent);
}

/* ---------- Form grid: summary + main ---------- */

body.ec-checkout form.checkout.woocommerce-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

/* Validation errors are prepended to the form by WooCommerce. */
body.ec-checkout form.checkout > .woocommerce-NoticeGroup {
  order: -1;
  grid-column: 1 / -1;
  margin: 0;
}

.ec-co-aside {
  order: 0;
  box-sizing: border-box;
  padding: 1.125rem 1.25rem;
  background: var(--card-light-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-light);
}

.ec-co-main {
  order: 1;
  box-sizing: border-box;
  padding: 1.5rem 1.25rem;
  background: var(--card-light-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-light);
}

@media (min-width: 60rem) {
  body.ec-checkout form.checkout.woocommerce-checkout {
    grid-template-columns: minmax(0, 1fr) 24rem;
    column-gap: 2.5rem;
  }

  .ec-co-main {
    order: 0;
    grid-column: 1;
    padding: 2rem 2.25rem 2.25rem;
  }

  .ec-co-aside {
    order: 1;
    grid-column: 2;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    padding: 1.5rem;
  }
}

/* ---------- Order summary (review-order table restyled as a card) ---------- */

.ec-co-aside__title {
  margin: 0 0 0.875rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dark-dim);
}

body.ec-checkout .ec-co-aside table.shop_table {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: none;
}

body.ec-checkout .ec-co-aside table.shop_table thead {
  display: none;
}

body.ec-checkout .ec-co-aside table.shop_table tbody,
body.ec-checkout .ec-co-aside table.shop_table tfoot,
body.ec-checkout .ec-co-aside table.shop_table tr,
body.ec-checkout .ec-co-aside table.shop_table th,
body.ec-checkout .ec-co-aside table.shop_table td {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-weight: inherit;
}

body.ec-checkout .ec-co-aside table.shop_table tr.cart_item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

/* The template appends a stray &nbsp; after the item markup; zero it out. */
body.ec-checkout .ec-co-aside table.shop_table td.product-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0;
  line-height: 0;
}

body.ec-checkout .ec-co-aside table.shop_table td.product-total {
  flex: 0 0 auto;
  padding-top: 0.125rem;
  font-weight: 800;
  white-space: nowrap;
}

.ec-co-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.ec-co-item__cover {
  flex: 0 0 4rem;
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: 0.625rem;
  background: var(--bg-light);
}

.ec-co-item__body {
  min-width: 0;
}

.ec-co-item__name {
  font-weight: 700;
  line-height: 1.3;
}

.ec-co-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-dark-muted);
}

.ec-co-item__meta i {
  margin-right: 0.2em;
  font-size: 0.75rem;
  color: var(--text-dark-dim);
}

body.ec-checkout .ec-co-aside table.shop_table tfoot {
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.ec-checkout .ec-co-aside table.shop_table tfoot tr {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
}

body.ec-checkout .ec-co-aside table.shop_table tfoot tr.cart-subtotal {
  display: none;
}

body.ec-checkout .ec-co-aside table.shop_table tfoot tr.cart-discount {
  color: #1f9d8a;
}

body.ec-checkout .ec-co-aside table.shop_table tfoot tr.cart-discount .woocommerce-remove-coupon {
  margin-left: 0.4em;
  font-size: 0.75rem;
  color: var(--text-dark-dim);
}

body.ec-checkout .ec-co-aside table.shop_table tfoot tr.order-total {
  font-size: 1.0625rem;
  font-weight: 800;
}

/* On phones the single item already shows its price; the totals block is
   only worth the height once a promo code changes the sum. */
@media (max-width: 59.99rem) {
  body.ec-checkout .ec-co-aside table.shop_table tfoot:not(:has(tr.cart-discount)) {
    display: none;
  }
}

/* ---------- Main column: fields ---------- */

body.ec-checkout #customer_details,
body.ec-checkout #customer_details .col-1,
body.ec-checkout .woocommerce-billing-fields,
body.ec-checkout .woocommerce-billing-fields__field-wrapper {
  float: none;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.ec-checkout #customer_details .col-2,
body.ec-checkout #ship-to-different-address,
body.ec-checkout .woocommerce-additional-fields,
body.ec-checkout #order_review_heading,
body.ec-checkout .woocommerce-privacy-policy-text,
body.ec-checkout .woocommerce-terms-and-conditions-wrapper,
body.ec-checkout .form-row .required {
  display: none !important;
}

body.ec-checkout .woocommerce-billing-fields h3 {
  margin: 0 0 1.125rem;
  font-family: inherit;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

body.ec-checkout .woocommerce form .form-row {
  display: block;
  float: none;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
}

body.ec-checkout .woocommerce form .form-row label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
}

body.ec-checkout .woocommerce form .form-row .woocommerce-input-wrapper {
  display: block;
}

body.ec-checkout .woocommerce form .form-row input.input-text {
  box-sizing: border-box;
  width: 100%;
  height: 3.25rem;
  margin: 0;
  padding: 0 1rem;
  font: inherit;
  font-size: 1rem; /* 16px keeps iOS from zooming into the field */
  line-height: normal;
  color: var(--text-dark);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: var(--radius-md);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.ec-checkout .woocommerce form .form-row input.input-text::placeholder {
  color: var(--text-dark-dim);
  opacity: 1;
}

body.ec-checkout .woocommerce form .form-row input.input-text:focus {
  border-color: var(--text-dark);
  box-shadow: 0 0 0 0.1875rem rgba(249, 225, 76, 0.55);
}

body.ec-checkout .woocommerce form .form-row.woocommerce-invalid input.input-text {
  border-color: #d64545;
}

.ec-co-hint {
  margin: -0.5rem 0 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-dark-muted);
}

/* ---------- Promo code ---------- */

.ec-co-coupon {
  margin: 0.25rem 0 1.5rem;
}

.ec-co-coupon__toggle {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.ec-co-coupon__toggle:hover {
  color: var(--text-dark-muted);
}

.ec-co-coupon__form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ec-co-coupon__form[hidden] {
  display: none;
}

.ec-co-coupon__input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  height: 2.875rem;
  padding: 0 0.875rem;
  font: inherit;
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--text-dark);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: var(--radius-md);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.ec-co-coupon__input:focus {
  border-color: var(--text-dark);
  box-shadow: 0 0 0 0.1875rem rgba(249, 225, 76, 0.55);
}

.ec-co-coupon__apply {
  flex: 0 0 auto;
  height: 2.875rem;
  padding: 0 1.125rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--dark-btn);
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ec-co-coupon__apply:hover {
  background: var(--dark-btn-hover);
}

.ec-co-coupon__apply[disabled] {
  opacity: 0.6;
  cursor: default;
}

.ec-co-coupon__notice:empty {
  display: none;
}

.ec-co-coupon__notice {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.ec-co-coupon__notice .wc-block-components-notice-banner,
.ec-co-coupon__notice .woocommerce-error,
.ec-co-coupon__notice .woocommerce-message {
  margin: 0;
}

/* ---------- Pay button ---------- */

body.ec-checkout #order_review {
  float: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.ec-checkout #payment {
  margin: 0;
  padding: 0 !important;
  background: none !important;
  border-radius: 0;
}

body.ec-checkout #payment ul.payment_methods,
body.ec-checkout #payment .payment_box {
  display: none !important;
}

body.ec-checkout #payment .place-order {
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

body.ec-checkout #payment .place-order noscript {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* Two ids: woocommerce-layout.css floats the button right on wide screens. */
body.ec-checkout #payment #place_order {
  display: block;
  float: none;
  width: 100%;
  height: 3.5rem;
  margin: 0;
  padding: 0 1.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #111;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0.5rem 1.375rem rgba(249, 225, 76, 0.25);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

body.ec-checkout #payment #place_order:hover {
  background: var(--accent-hover);
  transform: translateY(-0.0625rem);
}

body.ec-checkout #payment #place_order:disabled {
  opacity: 0.7;
  cursor: default;
}

.ec-co-trust {
  clear: both;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-dark-muted);
}

.ec-co-trust i {
  margin-top: 0.2em;
  color: #1f9d8a;
}

.ec-co-legal {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-dark-dim);
}

.ec-co-legal a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ---------- Notices ---------- */

body.ec-checkout .woocommerce-notices-wrapper:empty {
  display: none;
}

body.ec-checkout .woocommerce-NoticeGroup .wc-block-components-notice-banner,
body.ec-checkout .woocommerce-notices-wrapper .wc-block-components-notice-banner,
body.ec-checkout .woocommerce-NoticeGroup .woocommerce-error,
body.ec-checkout .woocommerce-notices-wrapper .woocommerce-error {
  margin: 0 0 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
}
