
:root {
  --hamil-brown: #8f452b;
  --hamil-cream: #f1d8cc;
}

.hamil-sw-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(27, 12, 7, .72);
  backdrop-filter: blur(3px);
}

.hamil-sw-overlay.is-open {
  display: flex;
}

.hamil-sw-modal {
  --hamil-bg: #8f452b;
  --hamil-accent: #f1d8cc;
  position: relative;
  width: min(1040px, 96vw);
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.08) 0 3px, transparent 4px),
    radial-gradient(circle at 84% 17%, rgba(255,255,255,.08) 0 3px, transparent 4px),
    linear-gradient(135deg, color-mix(in srgb, var(--hamil-bg), white 5%), var(--hamil-bg));
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  color: white;
}

.hamil-sw-modal::after {
  content: "";
  position: absolute;
  width: 430px;
  height: 430px;
  right: -180px;
  bottom: -210px;
  border-radius: 50%;
  border: 62px solid rgba(255,255,255,.07);
  pointer-events: none;
}

.hamil-sw-close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: white;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.hamil-sw-wheel-col {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 60px 30px;
  background: rgba(65, 24, 12, .12);
}

.hamil-sw-wheel-wrap {
  width: min(430px, 40vw);
  aspect-ratio: 1;
  filter: drop-shadow(0 18px 22px rgba(0,0,0,.25));
}

.hamil-sw-wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border: 10px solid #fff8f4;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 5px rgba(77,31,17,.22),
    0 0 0 4px rgba(255,255,255,.25);
  transition: transform 5.2s cubic-bezier(.12,.62,.08,1);
  will-change: transform;
  overflow: hidden;
}

.hamil-sw-wheel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 36% 28%, rgba(255,255,255,.16), transparent 35%);
  pointer-events: none;
}

.hamil-sw-pointer {
  position: absolute;
  z-index: 4;
  top: calc(50% - min(215px, 20vw) - 18px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 32px solid #fff8f4;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.22));
}

.hamil-sw-hub {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 88px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff8f4;
  box-shadow: 0 0 0 7px rgba(255,255,255,.35), 0 7px 18px rgba(0,0,0,.22);
}

.hamil-sw-hub span {
  color: var(--hamil-bg);
  font: 700 34px/1 Georgia, serif;
}

.hamil-sw-label {
  --angle: 0deg;
  --label-color: white;
  position: absolute;
  inset: 50% auto auto 50%;
  width: 35%;
  transform-origin: 0 0;
  transform: rotate(var(--angle)) translateY(-155px);
  color: var(--label-color);
  text-align: center;
  pointer-events: none;
}

.hamil-sw-label span {
  display: inline-block;
  max-width: 120px;
  transform: translate(-50%, -50%) rotate(calc(var(--angle) * -1));
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}

.hamil-sw-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 70px 58px 58px 38px;
}

.hamil-sw-eyebrow {
  margin-bottom: 10px;
  color: var(--hamil-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
}

.hamil-sw-content h2 {
  margin: 0 0 13px;
  color: white;
  font-size: clamp(34px, 4vw, 52px);
  line-height: .98;
  letter-spacing: -.035em;
}

.hamil-sw-subtitle {
  margin: 0 0 4px;
  max-width: 420px;
  color: rgba(255,255,255,.9);
  font-size: 17px;
  line-height: 1.55;
}

.hamil-sw-note {
  margin: 0 0 25px;
  color: var(--hamil-accent);
  font-size: 13px;
}

#hamil-sw-form {
  display: grid;
  gap: 12px;
}

#hamil-sw-form input {
  width: 100%;
  height: 50px;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 9px;
  outline: 0;
  background: #fffaf7;
  color: #4e281c;
  padding: 0 16px;
  font-size: 15px;
}

#hamil-sw-form input:focus {
  border-color: var(--hamil-accent);
  box-shadow: 0 0 0 3px rgba(241,216,204,.22);
}

#hamil-sw-submit,
.hamil-sw-result-close {
  min-height: 52px;
  border: 0;
  border-radius: 9px;
  background: var(--hamil-accent);
  color: var(--hamil-bg);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
}

#hamil-sw-submit:hover,
.hamil-sw-result-close:hover {
  background: white;
}

#hamil-sw-submit:disabled {
  opacity: .65;
  cursor: wait;
}

.hamil-sw-no-thanks {
  margin-top: 15px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.74);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.hamil-sw-error {
  min-height: 18px;
  color: #fff4ee;
  font-size: 13px;
}

.hamil-sw-result-view {
  width: 100%;
}

.hamil-sw-result-view p {
  color: rgba(255,255,255,.9);
  font-size: 16px;
  line-height: 1.55;
}

.hamil-sw-coupon-box {
  display: flex;
  margin: 24px 0 15px;
  overflow: hidden;
  border: 1px dashed rgba(255,255,255,.5);
  border-radius: 10px;
  background: rgba(255,255,255,.1);
}

#hamil-sw-coupon {
  flex: 1;
  padding: 15px 16px;
  color: white;
  font-weight: 900;
  letter-spacing: .08em;
}

#hamil-sw-copy {
  min-width: 86px;
  border: 0;
  background: var(--hamil-accent);
  color: var(--hamil-bg);
  font-weight: 900;
  cursor: pointer;
}

.hamil-sw-result-close {
  width: 100%;
}

body.hamil-sw-lock {
  overflow: hidden !important;
}

@media (max-width: 900px) {
  .hamil-sw-overlay {
    padding: 12px;
  }

  .hamil-sw-modal {
    width: min(520px, 96vw);
    max-height: 94vh;
    overflow-y: auto;
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .hamil-sw-wheel-col {
    padding: 54px 24px 16px;
  }

  .hamil-sw-wheel-wrap {
    width: min(320px, 75vw);
  }

  .hamil-sw-pointer {
    top: 38px;
  }

  .hamil-sw-label {
    transform: rotate(var(--angle)) translateY(-116px);
  }

  .hamil-sw-label span {
    max-width: 90px;
    font-size: 11px;
  }

  .hamil-sw-hub {
    width: 68px;
  }

  .hamil-sw-content {
    padding: 26px 26px 34px;
    text-align: center;
  }

  .hamil-sw-content h2 {
    font-size: 38px;
  }

  .hamil-sw-subtitle {
    margin-inline: auto;
  }
}

@media (max-width: 420px) {
  .hamil-sw-wheel-wrap {
    width: min(285px, 78vw);
  }

  .hamil-sw-label {
    transform: rotate(var(--angle)) translateY(-102px);
  }

  .hamil-sw-label span {
    font-size: 10px;
  }

  .hamil-sw-content {
    padding-inline: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hamil-sw-wheel {
    transition-duration: .01ms !important;
  }
}
