:root {
  --etw-red: #d92245;
  --etw-red-dark: #b91535;
  --etw-green: #20a916;
  --etw-ink: #192231;
  --etw-muted: #667085;
}

.etw-actions,
.etw-actions *,
.etw-fire-promo,
.etw-fire-promo * {
  box-sizing: border-box;
}

.etw-actions {
  position: fixed;
  z-index: 10040;
  left: 50%;
  bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(410px, calc(100vw - 32px));
  min-height: 48px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
  transform: translateX(-50%);
  font-family: Tahoma, "Noto Sans Thai", Arial, sans-serif;
}

.etw-actions form {
  display: contents;
}

.etw-actions__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 18px;
  border: 0;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font: 700 15px/1.2 Tahoma, "Noto Sans Thai", Arial, sans-serif;
}

.etw-actions__download {
  background: linear-gradient(135deg, #1585ff, #065bd8);
}

.etw-actions__line {
  width: 100%;
  background: linear-gradient(135deg, #22c967, #06a649);
}

.etw-actions__button:hover,
.etw-actions__button:focus-visible {
  filter: brightness(1.06);
  outline: 3px solid rgba(255, 255, 255, .75);
  outline-offset: -4px;
}

.etw-line-mark {
  display: inline-grid;
  place-items: center;
  min-width: 35px;
  height: 22px;
  padding: 0 5px;
  border-radius: 7px;
  background: #fff;
  color: #08a948;
  font-size: 9px;
  font-weight: 900;
}

.etw-fire-promo[hidden] {
  display: none !important;
}

.etw-fire-promo {
  position: fixed;
  z-index: 10050;
  top: 64px;
  right: 18px;
  width: min(356px, calc(100vw - 48px));
  color: var(--etw-ink);
  filter: drop-shadow(0 16px 36px rgba(3, 13, 29, .26));
  font-family: Tahoma, "Noto Sans Thai", Arial, sans-serif;
  transition: transform .28s ease;
}

.etw-fire-promo__surface {
  overflow: hidden;
  max-height: calc(100vh - 88px);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(27, 39, 59, .08);
}

.etw-fire-promo__tab {
  position: absolute;
  top: 105px;
  right: calc(100% - 2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 58px;
  min-height: 190px;
  padding: 14px 10px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-right: 0;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, #e32b4f, var(--etw-red-dark));
  color: #fff;
  box-shadow: -8px 12px 24px rgba(80, 5, 25, .22);
  cursor: pointer;
  font: 700 18px/1.25 Tahoma, "Noto Sans Thai", Arial, sans-serif;
}

.etw-fire-promo__tab span:last-child {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.etw-tag-icon {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 18px;
  flex: 0 0 22px;
  border-radius: 4px 7px 7px 4px;
  background: currentColor;
  transform: rotate(-8deg);
}

.etw-tag-icon::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--etw-red);
}

.etw-fire-promo__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 14px 15px;
  border-bottom: 1px solid #f2dce4;
  background: linear-gradient(135deg, #fff 8%, #fff2f6 55%, #f1eaff 100%);
}

.etw-fire-promo__heading {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
}

.etw-fire-promo__heading > .etw-tag-icon {
  color: var(--etw-red);
}

.etw-fire-promo__heading > .etw-tag-icon::after {
  background: #fff;
}

.etw-fire-promo__heading p {
  margin: 0 0 2px;
  color: #8c5162;
  font-size: 12px;
  font-weight: 700;
}

.etw-fire-promo h2 {
  margin: 0;
  color: #3b1731;
  font-size: 20px;
  line-height: 1.2;
}

.etw-fire-promo__badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4058, #d71636);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.etw-fire-promo__close {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #774656;
  cursor: pointer;
  font: 400 28px/28px Arial, sans-serif;
}

.etw-fire-promo__close:hover,
.etw-fire-promo__close:focus-visible {
  background: rgba(217, 34, 69, .1);
  outline: none;
}

.etw-fire-promo__intro {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 13px 14px 10px;
  padding: 11px 13px;
  border: 1px solid #ffd5df;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff2f5, #fff8fa);
  color: #7c263b;
}

.etw-fire-promo__intro p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.etw-megaphone {
  width: 27px;
  height: 18px;
  flex: 0 0 27px;
  border-radius: 5px 2px 2px 5px;
  background: var(--etw-red);
  clip-path: polygon(0 29%, 33% 29%, 100% 0, 100% 100%, 33% 71%, 0 71%);
}

.etw-fire-promo__status {
  margin: 8px 14px 14px;
  padding: 14px;
  border-radius: 12px;
  background: #f5f7fa;
  color: var(--etw-muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.etw-fire-periods {
  display: grid;
  gap: 9px;
  max-height: max(110px, calc(100vh - 300px));
  overflow-y: auto;
  padding: 3px 14px 14px;
  scrollbar-color: #d9dee7 transparent;
  scrollbar-width: thin;
}

.etw-fire-period {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-areas: "icon main price" "icon main seat";
  align-items: center;
  gap: 3px 9px;
  width: 100%;
  min-height: 88px;
  padding: 12px;
  border: 1px solid #dfe4eb;
  border-radius: 13px;
  background: #fff;
  color: var(--etw-ink);
  box-shadow: 0 3px 10px rgba(31, 42, 61, .06);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.etw-fire-period:hover,
.etw-fire-period:focus-visible,
.etw-fire-period.is-selected {
  border-color: #f08aa0;
  box-shadow: 0 8px 20px rgba(207, 27, 65, .13);
  outline: none;
  transform: translateY(-1px);
}

.etw-fire-period__calendar {
  grid-area: icon;
  position: relative;
  width: 22px;
  height: 21px;
  border: 2px solid #253244;
  border-radius: 4px;
}

.etw-fire-period__calendar::before {
  content: "";
  position: absolute;
  top: 4px;
  right: -2px;
  left: -2px;
  border-top: 2px solid #253244;
}

.etw-fire-period__main {
  grid-area: main;
  min-width: 0;
}

.etw-fire-period__main strong,
.etw-fire-period__main small,
.etw-fire-period__price del,
.etw-fire-period__price strong {
  display: block;
}

.etw-fire-period__main strong {
  font-size: 15px;
  line-height: 1.35;
}

.etw-fire-period__main small {
  margin-top: 3px;
  color: var(--etw-muted);
  font-size: 13px;
}

.etw-fire-period__price {
  grid-area: price;
  text-align: right;
  white-space: nowrap;
}

.etw-fire-period__price del {
  color: #747b87;
  font-size: 12px;
}

.etw-fire-period__price strong {
  margin-top: 2px;
  color: #e20f24;
  font-size: 20px;
  line-height: 1.15;
}

.etw-fire-period__seat {
  grid-area: seat;
  justify-self: end;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #43c526, #19970f);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.etw-fire-promo[data-open="false"] {
  transform: translateX(calc(100% + 20px));
}

.etw-fire-promo[data-open="false"] .etw-fire-promo__tab {
  right: calc(100% + 2px);
}

@media (max-width: 760px) {
  .etw-actions {
    bottom: max(6px, env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 20px);
    min-height: 44px;
  }

  .etw-actions__button {
    min-height: 44px;
    padding: 7px 12px;
    font-size: 14px;
  }

  .etw-fire-promo {
    --etw-mobile-dock-offset: calc(max(6px, env(safe-area-inset-bottom, 0px)) + 56px);
    top: auto;
    right: 10px;
    bottom: var(--etw-mobile-dock-offset);
    width: calc(100vw - 20px);
    filter: drop-shadow(0 -12px 28px rgba(3, 13, 29, .22));
  }

  .etw-fire-promo__surface {
    max-height: min(68vh, 610px);
    border-radius: 18px 18px 12px 12px;
  }

  .etw-fire-promo__tab {
    top: auto;
    right: 14px;
    bottom: calc(100% - 1px);
    flex-direction: row;
    width: auto;
    min-height: 44px;
    padding: 9px 15px;
    border-right: 2px solid rgba(255, 255, 255, .9);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    font-size: 15px;
  }

  .etw-fire-promo__tab span:last-child {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .etw-fire-promo__header {
    min-height: 68px;
    padding: 11px 13px;
  }

  .etw-fire-promo h2 {
    font-size: 18px;
  }

  .etw-fire-promo__intro {
    margin-top: 10px;
    padding: 9px 11px;
  }

  .etw-fire-periods {
    max-height: max(110px, calc(68vh - 220px));
  }

  .etw-fire-period {
    min-height: 78px;
    padding: 10px;
  }

  .etw-fire-promo[data-open="false"] {
    transform: translateY(calc(100% + var(--etw-mobile-dock-offset)));
  }

  .etw-fire-promo[data-open="false"] .etw-fire-promo__tab {
    right: 14px;
    bottom: calc(100% + var(--etw-mobile-dock-offset));
    border-bottom: 2px solid rgba(255, 255, 255, .9);
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(80, 5, 25, .28);
  }
}

@media (max-width: 430px) {
  .etw-actions__button > span:last-child,
  .etw-fire-promo__badge {
    display: none;
  }

  .etw-fire-period {
    grid-template-columns: 23px minmax(0, 1fr) auto;
    gap: 2px 7px;
  }

  .etw-fire-period__main strong {
    font-size: 14px;
  }

  .etw-fire-period__price strong {
    font-size: 18px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .etw-fire-promo {
    top: 48px;
    bottom: auto;
    width: min(356px, calc(100vw - 72px));
  }

  .etw-fire-promo__surface {
    max-height: calc(100vh - 60px);
  }

  .etw-fire-promo__intro {
    display: none;
  }

  .etw-fire-periods {
    max-height: calc(100vh - 155px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .etw-fire-promo,
  .etw-fire-period {
    transition: none;
  }
}

@media print {
  .etw-actions,
  .etw-fire-promo {
    display: none !important;
  }
}
