/*
 * Commerce Auth Storefront Global Styles
 * Shared design tokens, scoped resets, shared storefront structure,
 * and location tools.
 */

:root {
  --commerce-auth-font-sans: "DM Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --commerce-auth-font-display: "Sora", "Trebuchet MS", sans-serif;
  --commerce-auth-storefront-muted: var(--commerce-auth-storefront-text, #617086);
}

/* Shared storefront foundation. */
.commerce-auth-storefront {
  --commerce-auth-ui-accent: var(--commerce-auth-storefront-accent, #0f766e);
  --commerce-auth-ui-heading: var(--commerce-auth-storefront-heading, #172033);
  --commerce-auth-ui-text: var(--commerce-auth-storefront-text, #617086);
  --commerce-auth-ui-surface: var(--commerce-auth-storefront-surface, #ffffff);
  --commerce-auth-ui-surface-alt: var(--commerce-auth-storefront-surface-alt, #f8fbff);
  --commerce-auth-ui-border: var(--commerce-auth-storefront-border, #d9e2ef);
  --commerce-auth-ui-card-radius: var(--commerce-auth-storefront-card-radius, 28px);
  --commerce-auth-ui-button-radius: var(--commerce-auth-storefront-button-radius, 18px);
  width: 100vw;
  max-width: 100vw;
  margin: 32px calc(50% - 50vw);
  width: 100dvw;
  max-width: 100dvw;
  margin: 32px calc(50% - 50dvw);
  padding-inline: clamp(16px, 2.5vw, 40px);
  color: var(--commerce-auth-ui-text);
}

.commerce-auth-storefront,
.commerce-auth-storefront * ,
.commerce-auth-storefront *::before,
.commerce-auth-storefront *::after {
  box-sizing: border-box;
}

body.commerce-auth-managed-page #primary,
body.commerce-auth-managed-page .content-area,
body.commerce-auth-managed-page .site-content,
body.commerce-auth-managed-page .site-main,
body.commerce-auth-managed-page .entry-content,
body.commerce-auth-managed-page article.page,
body.commerce-auth-managed-page main {
  width: 100%;
  max-width: none;
  min-width: 0;
  float: none;
}

body.commerce-auth-managed-page .site-content [class*="container"],
body.commerce-auth-managed-page .content-area [class*="container"],
body.commerce-auth-managed-page #primary [class*="container"] {
  width: 100%;
  max-width: none;
  min-width: 0;
}

body.commerce-auth-managed-page #scroll-to-top {
  background: var(--commerce-auth-storefront-heading, #172033) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2) !important;
}

body.commerce-auth-managed-page #scroll-to-top:hover,
body.commerce-auth-managed-page #scroll-to-top:focus-visible {
  background: var(--commerce-auth-storefront-accent, #0f766e) !important;
  color: #ffffff !important;
}

.commerce-auth-storefront__shell {
  display: grid;
  gap: 28px;
  width: min(1480px, 100%);
  min-width: 0;
  margin-inline: auto;
}

.commerce-auth-storefront__hero {
  padding: 28px;
  border: 1px solid var(--commerce-auth-ui-border);
  border-radius: var(--commerce-auth-ui-card-radius);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--commerce-auth-ui-accent) 8%, transparent), transparent 40%),
    linear-gradient(180deg, var(--commerce-auth-ui-surface-alt) 0%, var(--commerce-auth-ui-surface) 100%);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.06);
}

.commerce-auth-storefront__eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--commerce-auth-ui-accent);
}

.commerce-auth-storefront__title {
  margin: 0;
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--commerce-auth-ui-heading);
}

.commerce-auth-storefront .commerce-auth-storefront__title,
.commerce-auth-storefront .commerce-auth-cart__title,
.commerce-auth-storefront .commerce-auth-cart-totals__title,
.commerce-auth-storefront .commerce-auth-cart-empty__title,
.commerce-auth-storefront .commerce-auth-checkout-identity__title,
.commerce-auth-storefront .commerce-auth-thankyou__title,
.commerce-auth-storefront .commerce-auth-thankyou__panel-title {
  color: var(--commerce-auth-ui-heading) !important;
}

.commerce-auth-storefront__copy {
  margin: 12px 0 0;
  max-width: 820px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--commerce-auth-ui-text);
}

.commerce-auth-storefront__body {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--commerce-auth-ui-border);
  border-radius: var(--commerce-auth-ui-card-radius);
  background: var(--commerce-auth-ui-surface);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.05);
}

.commerce-auth-storefront__body :where(h1, h2, h3, h4, h5, h6) {
  color: var(--commerce-auth-ui-heading);
}

.commerce-auth-storefront__body :where(p, li, td, th, label, small, .woocommerce-info, .woocommerce-form__label) {
  color: var(--commerce-auth-ui-text);
}

.commerce-auth-storefront__body :where(a, .button, button, input[type="submit"], input[type="button"], .wc-forward) {
  border-radius: var(--commerce-auth-ui-button-radius);
  text-decoration: none;
}

.commerce-auth-storefront__body :where(button, input, select, textarea) {
  font: inherit;
}

.commerce-auth-storefront__body :where(.woocommerce-error, .woocommerce-info, .woocommerce-message) {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--commerce-auth-ui-border);
  border-radius: var(--commerce-auth-ui-button-radius);
  background: var(--commerce-auth-ui-surface-alt);
  color: var(--commerce-auth-ui-heading);
  list-style: none;
  box-shadow: none;
}

.commerce-auth-storefront__body :where(.woocommerce-error) {
  border-color: color-mix(in srgb, #b42318 22%, var(--commerce-auth-ui-border));
  background: #fff7f7;
}

.commerce-auth-storefront__body :where(.woocommerce-error, .woocommerce-info, .woocommerce-message) li,
.commerce-auth-storefront__body :where(.woocommerce-error, .woocommerce-info, .woocommerce-message) p {
  margin: 0;
  color: inherit;
}

.commerce-auth-storefront__body :where(table.shop_table, table.shop_table_responsive) {
  width: 100%;
  margin: 0;
  border-spacing: 0;
  border-collapse: separate;
  border: 1px solid var(--commerce-auth-ui-border);
  background: var(--commerce-auth-ui-surface);
}

.commerce-auth-storefront__body :where(table.shop_table, table.shop_table_responsive) th,
.commerce-auth-storefront__body :where(table.shop_table, table.shop_table_responsive) td {
  padding: 16px 18px;
  border-top: 1px solid var(--commerce-auth-ui-border);
  vertical-align: top;
}

.commerce-auth-storefront__body :where(table.shop_table, table.shop_table_responsive) tr:first-child > :is(th, td) {
  border-top: 0;
}

.commerce-auth-storefront__body :where(ul, ol) {
  margin: 0;
  padding-left: 0;
}

.commerce-auth-storefront__body :where(.button, button, input[type="submit"], input[type="button"], .wc-forward) {
  background: var(--commerce-auth-ui-heading);
  border-color: var(--commerce-auth-ui-heading);
  color: #ffffff;
}

.commerce-auth-storefront__body :where(.button:hover, button:hover, input[type="submit"]:hover, input[type="button"]:hover, .wc-forward:hover) {
  background: var(--commerce-auth-ui-accent);
  border-color: var(--commerce-auth-ui-accent);
}

.commerce-auth-storefront__body :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border-radius: var(--commerce-auth-ui-button-radius);
}

.commerce-auth-storefront__body :where(.shop_table, .woocommerce-checkout-review-order, .woocommerce-order, .woocommerce-customer-details address, .cart-collaterals .cart_totals) {
  border-radius: var(--commerce-auth-ui-card-radius);
}

.commerce-auth-storefront--account {
  margin: 32px calc(50% - 50vw);
  margin: 32px calc(50% - 50dvw);
}

.commerce-auth-storefront--account > * {
  width: min(1480px, 100%);
  margin-inline: auto;
}


/* Shared location detection and map picker. */
.commerce-auth-location-detect {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--commerce-auth-ui-border);
  border-radius: var(--commerce-auth-ui-button-radius);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--commerce-auth-ui-accent) 7%, transparent), transparent 42%),
    var(--commerce-auth-ui-surface);
}

.commerce-auth-location-detect__header {
  display: grid;
  gap: 6px;
}

.commerce-auth-location-detect__eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--commerce-auth-ui-accent);
}

.commerce-auth-location-detect__copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--commerce-auth-ui-text);
}

.commerce-auth-location-detect__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--commerce-auth-ui-border);
  border-radius: var(--commerce-auth-ui-button-radius);
  background: var(--commerce-auth-ui-surface);
  color: var(--commerce-auth-ui-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.commerce-auth-location-detect__button:hover,
.commerce-auth-location-detect__button:focus {
  border-color: var(--commerce-auth-ui-accent);
  background: color-mix(in srgb, var(--commerce-auth-ui-accent) 8%, var(--commerce-auth-ui-surface));
  color: var(--commerce-auth-ui-accent);
  transform: translateY(-1px);
}

.commerce-auth-location-detect__button.is-busy::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: commerceAuthSpin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.commerce-auth-location-detect__status {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.commerce-auth-location-detect__status.is-loading {
  color: var(--commerce-auth-ui-text);
}

.commerce-auth-location-detect__status.is-success {
  color: var(--commerce-auth-ui-accent);
}

.commerce-auth-location-detect__status.is-error {
  color: #b42318;
}

body.commerce-auth-map-modal-open {
  overflow: hidden;
}

.commerce-auth-map-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
}

.commerce-auth-map-modal[hidden] {
  display: none;
}

.commerce-auth-map-modal__dialog {
  width: min(920px, 100%);
  max-height: min(92vh, 880px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 30%),
    linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
  box-shadow: 0 40px 120px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.commerce-auth-map-modal__header {
  position: relative;
  padding: 28px 32px 16px;
}

.commerce-auth-map-modal__title {
  margin: 0;
  font-family: var(--commerce-auth-font-display);
  font-size: 30px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--commerce-auth-storefront-text);
}

.commerce-auth-map-modal__copy {
  margin: 10px 0 0;
  max-width: 62ch;
  font-family: var(--commerce-auth-font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--commerce-auth-storefront-muted);
}

.commerce-auth-map-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 26px;
  line-height: 1;
  color: var(--commerce-auth-storefront-text);
  cursor: pointer;
}

.commerce-auth-map-modal__body {
  padding: 0 32px 24px;
}

.commerce-auth-map-modal__canvas-wrap {
  position: relative;
}

.commerce-auth-map-modal__canvas {
  width: 100%;
  min-height: 440px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(226, 232, 240, 0.45));
  overflow: hidden;
}

.commerce-auth-map-modal__center-pin {
  --commerce-auth-map-pin-scale: 0.54;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 76px;
  transform: translate(-50%, calc(-100% + 13px)) scale(var(--commerce-auth-map-pin-scale));
  transform-origin: center bottom;
  pointer-events: none;
  z-index: 4;
  transition: transform 0.18s ease;
  will-change: transform;
}

.commerce-auth-map-modal__center-pin.is-moving {
  transform: translate(-50%, calc(-100% + 4px)) scale(var(--commerce-auth-map-pin-scale));
}

.commerce-auth-map-modal__center-pin-head {
  position: absolute;
  top: 0;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, #ff8c95 0%, #ff5461 34%, #e31222 62%, #a10213 100%);
  box-shadow:
    inset 0 -8px 14px rgba(145, 0, 18, 0.28),
    inset 0 6px 10px rgba(255, 255, 255, 0.24),
    0 14px 28px rgba(15, 23, 42, 0.22);
}

.commerce-auth-map-modal__center-pin-head::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 6px;
  width: 20px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  transform: rotate(-8deg);
}

.commerce-auth-map-modal__center-pin-needle {
  position: absolute;
  top: 27px;
  left: 50%;
  width: 8px;
  height: 40px;
  transform: translateX(-50%);
  clip-path: polygon(50% 0%, 100% 0%, 62% 100%, 38% 100%, 0% 0%);
  background: linear-gradient(90deg, #737373 0%, #f5f5f5 48%, #4b5563 100%);
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.28);
}

.commerce-auth-map-modal__center-pin-shadow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.16);
  filter: blur(4px);
}

.commerce-auth-map-modal__footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 0 32px 28px;
}

.commerce-auth-map-modal__status {
  margin: 0;
  font-family: var(--commerce-auth-font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--commerce-auth-storefront-muted);
}

.commerce-auth-map-modal__status.is-error {
  color: #b91c1c;
}

.commerce-auth-map-modal__status.is-loading {
  color: #0f766e;
}

.commerce-auth-map-modal__action {
  min-height: 46px;
  border-radius: 14px;
}

@media (max-width: 767px) {
  .commerce-auth-map-modal {
    padding: 12px;
  }

  .commerce-auth-map-modal__dialog {
    max-height: min(96vh, 920px);
    border-radius: 22px;
  }

  .commerce-auth-map-modal__header {
    padding: 24px 20px 14px;
  }

  .commerce-auth-map-modal__title {
    padding-right: 44px;
    font-size: 24px;
  }

  .commerce-auth-map-modal__body {
    padding: 0 20px 18px;
  }

  .commerce-auth-map-modal__canvas {
    min-height: 360px;
  }

  .commerce-auth-map-modal__center-pin {
    width: 42px;
    height: 66px;
    transform: translate(-50%, calc(-100% + 10px)) scale(var(--commerce-auth-map-pin-scale));
  }

  .commerce-auth-map-modal__center-pin.is-moving {
    transform: translate(-50%, calc(-100% + 2px)) scale(var(--commerce-auth-map-pin-scale));
  }

  .commerce-auth-map-modal__center-pin-head {
    width: 30px;
    height: 30px;
  }

  .commerce-auth-map-modal__center-pin-needle {
    top: 24px;
    height: 34px;
  }

  .commerce-auth-map-modal__footer {
    grid-template-columns: 1fr;
    padding: 0 20px 20px;
  }

  .commerce-auth-map-modal__action {
    width: 100%;
  }
}

