:root {
  --clo-ink: #17201d;
  --clo-muted: #64716c;
  --clo-paper: #fbfdfc;
  --clo-panel: #f4f8f6;
  --clo-line: #dbe6e1;
  --clo-accent: #0b7a55;
  --clo-accent-deep: #07583e;
  --clo-accent-soft: #e8f6f0;
  --clo-hero: #086345;
  --clo-hero-deep: #063f31;
  --clo-warm: #e99b35;
  --clo-shadow: 0 28px 80px rgba(7, 27, 20, 0.28);
}

[data-etc-theme="dark"] {
  --clo-ink: #edf7f2;
  --clo-muted: #aebdb6;
  --clo-paper: #111b17;
  --clo-panel: #17231e;
  --clo-line: #2b3d35;
  --clo-accent: #46d39a;
  --clo-accent-deep: #7be8ba;
  --clo-accent-soft: #19382c;
  --clo-hero: #0d6248;
  --clo-hero-deep: #082f25;
  --clo-warm: #f1b65f;
  --clo-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.clo-modal-open,
.clo-modal-open body {
  overflow: hidden !important;
}

.clo-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  background: rgba(6, 17, 13, 0.66);
  touch-action: none;
  animation: clo-fade 180ms ease-out both;
}

/* etc-custom.css positions every direct body child relatively. These more
   specific rules keep cart UI anchored to the viewport instead of the footer. */
html.etc-shop-redesign body > .clo-backdrop {
  position: fixed;
  z-index: 2147482000;
}

html.etc-shop-redesign body > .clo-reminder--floating {
  position: fixed;
  z-index: 2147481000;
}

@supports (backdrop-filter: blur(4px)) {
  .clo-backdrop {
    backdrop-filter: blur(10px) saturate(0.78);
  }
}

.clo-modal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(255px, 0.78fr) minmax(360px, 1.22fr);
  width: min(100%, 780px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: 0;
  overflow: hidden;
  color: var(--clo-ink);
  background: var(--clo-paper);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 24px;
  box-shadow: var(--clo-shadow);
  font-family: inherit;
  text-align: left;
  touch-action: pan-y;
  animation: clo-rise 220ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

html.etc-poster-v3 .clo-modal:focus-visible {
  outline: none !important;
  outline-offset: 0;
}

.clo-modal::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 86px;
  height: 4px;
  background: linear-gradient(90deg, var(--clo-warm), #f3c776);
}

.clo-modal__hero {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  padding: 36px 32px 32px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at -4% 108%, rgba(250, 190, 91, 0.25), transparent 38%),
    linear-gradient(145deg, var(--clo-hero), var(--clo-hero-deep));
}

.clo-modal__hero::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -66px;
  width: 178px;
  height: 178px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(255, 255, 255, 0.035);
  pointer-events: none;
}

.clo-modal__details {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 64px 32px 26px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 100% 0, rgba(11, 122, 85, 0.07), transparent 40%),
    var(--clo-paper);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.clo-modal__close {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  color: var(--clo-muted);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid transparent;
  border-radius: 50%;
  font: 300 28px/1 inherit;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.clo-modal__close:hover {
  color: var(--clo-ink);
  background: var(--clo-accent-soft);
  transform: rotate(4deg);
}

[data-etc-theme="dark"] .clo-modal__close {
  background: rgba(17, 27, 23, 0.72);
}

.clo-eyebrow {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.clo-modal__title {
  position: relative;
  z-index: 1;
  max-width: 270px;
  margin: -18px 0 0;
  color: #fff !important;
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.clo-modal__price {
  position: relative;
  z-index: 1;
}

.clo-modal__lead {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.clo-modal__saving {
  margin: 0;
  color: #fff;
  font-size: clamp(40px, 5vw, 52px);
  font-weight: 820;
  line-height: 1;
  letter-spacing: -0.045em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}

html.etc-shop-redesign .clo-modal__hero .clo-modal__title {
  color: #fff !important;
}

.clo-code {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 13px 13px 13px 16px;
  background: var(--clo-accent-soft);
  border: 1px solid color-mix(in srgb, var(--clo-accent) 32%, var(--clo-line));
  border-radius: 14px;
}

.clo-code__meta {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.clo-code__label {
  color: var(--clo-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clo-code__value {
  overflow: hidden;
  color: var(--clo-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
  letter-spacing: 0.075em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clo-code__copy {
  min-height: 44px;
  padding: 0 12px;
  color: var(--clo-accent-deep);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  font: 700 12px/1 inherit;
  cursor: pointer;
}

.clo-code__copy:hover {
  background: rgba(255, 255, 255, 0.82);
}

[data-etc-theme="dark"] .clo-code__copy {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.08);
}

.clo-modal__scope {
  margin: 9px 2px 0;
  color: var(--clo-muted);
  font-size: 12px;
  line-height: 1.45;
}

.clo-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 17px 0 0;
  padding: 13px 15px;
  background: color-mix(in srgb, var(--clo-warm) 10%, var(--clo-paper));
  border-left: 3px solid var(--clo-warm);
  border-radius: 3px 12px 12px 3px;
}

.clo-timer__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.clo-timer__label {
  color: var(--clo-ink);
  font-size: 13px;
  font-weight: 760;
}

.clo-timer__note {
  color: var(--clo-muted);
  font-size: 10px;
  line-height: 1.35;
}

.clo-timer__clock {
  flex: 0 0 auto;
  color: var(--clo-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}

.clo-modal__status {
  margin: 13px 1px 0;
  color: var(--clo-muted);
  font-size: 12px;
  line-height: 1.4;
}

.clo-modal__status:empty {
  display: none;
}

.clo-modal__status--ok {
  color: var(--clo-accent-deep);
  font-weight: 680;
}

.clo-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  padding-top: 18px;
}

.clo-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font: 700 13px/1 inherit;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.clo-button:focus-visible,
.clo-code__copy:focus-visible,
.clo-modal__close:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--clo-accent) 45%, transparent);
  outline-offset: 2px;
}

.clo-button--primary {
  width: 100%;
  color: #fff;
  background: var(--clo-accent);
  border: 1px solid var(--clo-accent);
  box-shadow: 0 9px 20px rgba(11, 122, 85, 0.16);
}

.clo-button--primary:hover {
  background: var(--clo-accent-deep);
  border-color: var(--clo-accent-deep);
  transform: translateY(-1px);
}

[data-etc-theme="dark"] .clo-button--primary,
[data-etc-theme="dark"] .clo-button--compact {
  color: #07140f;
}

.clo-button--secondary {
  width: 100%;
  color: var(--clo-muted);
  background: transparent;
  border: 1px solid transparent;
}

.clo-button--secondary:hover,
.clo-button--quiet:hover {
  color: var(--clo-ink);
  background: var(--clo-accent-soft);
}

.clo-reminder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  color: var(--clo-ink);
  background: var(--clo-paper);
  border: 1px solid var(--clo-line);
  border-radius: 15px;
  box-shadow: 0 12px 32px rgba(8, 35, 25, 0.13);
  font-family: inherit;
}

.clo-reminder--inline {
  width: 100%;
  margin: 0 0 18px;
  padding: 12px 13px;
}

.clo-reminder--floating {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 2147481000;
  width: min(460px, calc(100vw - 40px));
  padding: 12px 13px;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  animation: clo-rise 220ms ease-out both;
}

html.clo-modal-open .clo-reminder--floating {
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.clo-reminder__mark {
  display: grid;
  place-items: center;
  width: 54px;
  min-height: 46px;
  color: #fff;
  background: linear-gradient(145deg, var(--clo-accent), var(--clo-accent-deep));
  border-radius: 11px;
  font-size: 15px;
  font-weight: 820;
}

[data-etc-theme="dark"] .clo-reminder__mark {
  color: #07140f;
}

.clo-reminder__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.clo-reminder__saving {
  overflow: hidden;
  color: var(--clo-ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clo-reminder__detail {
  overflow: hidden;
  color: var(--clo-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clo-reminder__code,
.clo-reminder__clock {
  color: var(--clo-accent-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.clo-reminder__code {
  letter-spacing: 0.035em;
}

.clo-reminder__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.clo-button--compact {
  color: #fff;
  background: var(--clo-accent);
  border: 1px solid var(--clo-accent);
}

.clo-button--quiet {
  padding: 0 9px;
  color: var(--clo-muted);
  background: transparent;
  border: 1px solid transparent;
}

.clo-copy-fallback {
  position: fixed;
  top: -9999px;
  left: -9999px;
}

@keyframes clo-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes clo-rise {
  from { opacity: 0; transform: translateY(14px) scale(0.987); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-height: 700px) {
  .clo-modal__hero {
    gap: 22px;
    padding: 26px 28px 24px;
  }

  .clo-modal__title {
    margin-top: -10px;
    font-size: 28px;
  }

  .clo-modal__saving {
    font-size: 44px;
  }

  .clo-modal__details {
    padding: 56px 28px 20px;
  }

  .clo-timer {
    margin-top: 12px;
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .clo-timer__note {
    display: none;
  }

  .clo-modal__actions {
    padding-top: 13px;
  }
}

@media (max-width: 720px) {
  .clo-backdrop {
    align-items: flex-end;
    padding: 12px 0 0;
  }

  .clo-modal {
    display: block;
    width: 100%;
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    overflow-x: hidden;
    overflow-y: auto;
    border-width: 1px 0 0;
    border-radius: 24px 24px 0 0;
    overscroll-behavior: contain;
    scrollbar-gutter: auto;
  }

  .clo-modal__hero {
    display: block;
    padding: 23px 20px 20px;
  }

  .clo-eyebrow {
    margin-right: 48px;
  }

  .clo-modal__title {
    max-width: calc(100% - 36px);
    margin: 16px 0 0;
    font-size: 27px;
  }

  .clo-modal__price {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
  }

  .clo-modal__lead {
    max-width: 100px;
    margin-bottom: 3px;
    line-height: 1.2;
  }

  .clo-modal__saving {
    flex: 0 0 auto;
    font-size: 42px;
  }

  .clo-modal__details {
    display: block;
    padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .clo-modal__close,
  [data-etc-theme="dark"] .clo-modal__close {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .clo-modal__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
  }

  .clo-code {
    min-height: 66px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .clo-timer {
    margin-top: 13px;
  }

  .clo-timer__note {
    display: none;
  }

  .clo-modal__status {
    margin-top: 11px;
  }

  .clo-modal__actions {
    gap: 3px;
    padding-top: 13px;
  }

  .clo-reminder--floating {
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
  }
}

@media (max-width: 640px) {
  .clo-reminder {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .clo-reminder__actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .clo-reminder__actions .clo-button {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .clo-modal__hero {
    padding: 20px 16px 16px;
  }

  .clo-modal__title {
    margin-top: 12px;
    font-size: 24px;
  }

  .clo-modal__price {
    margin-top: 14px;
  }

  .clo-modal__saving {
    font-size: 37px;
  }

  .clo-modal__details {
    padding: 15px 16px calc(14px + env(safe-area-inset-bottom));
  }

  .clo-code {
    gap: 6px;
    padding-right: 8px;
    padding-left: 12px;
  }

  .clo-code__value {
    font-size: 17px;
  }

  .clo-code__copy {
    padding: 0 8px;
    font-size: 10px;
  }

  .clo-timer__clock {
    font-size: 22px;
  }

  .clo-reminder--floating {
    right: 8px;
    left: 8px;
  }
}

@media (max-height: 600px) and (max-width: 720px) {
  .clo-modal__hero {
    padding-top: 18px;
    padding-bottom: 15px;
  }

  .clo-modal__title {
    margin-top: 10px;
    font-size: 23px;
  }

  .clo-modal__price {
    margin-top: 11px;
  }

  .clo-modal__saving {
    font-size: 36px;
  }

  .clo-modal__details {
    padding-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .clo-backdrop,
  .clo-modal,
  .clo-reminder--floating {
    animation: none;
  }

  .clo-button,
  .clo-modal__close,
  .clo-reminder--floating {
    transition: none;
  }
}
