:root {
  --page-bg: #f3f4f6;
  --panel-bg: #ffffff;
  --text: #121212;
  --hotel-title-color: #000000;
  --hotel-title-size: 74px;
  --gradient-start: 52%;
  --gradient-opacity: 0.9;
  --muted: #6b7280;
  --accent: #c82245;
  --accent-strong: #be1739;
  --border: #d8dde6;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page-bg);
  overflow-x: hidden;
}

.app-shell {
  width: min(100% - 40px, 1480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0;
  display: grid;
  grid-template-columns: minmax(560px, 1000px) 360px;
  gap: 32px;
  align-items: start;
}

.preview-panel,
.controls-panel {
  min-width: 0;
}

.offer-card {
  position: relative;
  container-type: inline-size;
  width: min(100%, 1000px);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #878787;
  box-shadow: var(--shadow);
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
}

.offer-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--image-position, center center);
  display: none;
}

.offer-image.has-image {
  display: block;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(34, 39, 46, 0.08), rgba(34, 39, 46, 0.28)),
    #8b8b8b;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 700;
}

.empty-state.is-hidden {
  display: none;
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(194, 0, 61, 0) var(--gradient-start), rgba(194, 0, 61, var(--gradient-opacity)) 100%);
  pointer-events: none;
}

.offer-content {
  position: absolute;
  inset: 0;
  padding: 4.8% 6.4% 4.8%;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.location-pill {
  width: fit-content;
  max-width: 72%;
  min-height: 46px;
  padding: 6px 26px 6px 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-size: clamp(19px, 3.2vw, 38px);
  line-height: 1;
  font-weight: 500;
}

.location-pill img {
  width: clamp(19px, 2.55vw, 30px);
  height: clamp(19px, 2.55vw, 30px);
  flex: 0 0 auto;
  object-fit: contain;
}

.location-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-content h1 {
  margin: 22px 0 0;
  max-width: 86%;
  color: var(--hotel-title-color);
  font-size: clamp(35px, var(--hotel-title-size), 84px);
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 700;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.offer-bottom {
  margin-top: auto;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}

.price-block {
  flex: 1 1 auto;
  min-width: 0;
  color: #ffffff;
}

.price-block strong {
  display: block;
  font-size: clamp(54px, 8vw, 94px);
  line-height: 0.92;
  letter-spacing: 0;
  font-weight: 800;
}

.price-block > span {
  display: block;
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 400;
}

.period-pill {
  width: fit-content;
  max-width: 100%;
  margin-top: 26px;
  min-height: 58px;
  padding: 8px 20px;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-button {
  flex: 0 0 auto;
  min-width: 240px;
  min-height: 58px;
  margin-bottom: 0;
  padding: 8px 24px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  font-size: clamp(21px, 2.55vw, 32px);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 800;
  white-space: nowrap;
}

.booking-button.is-hidden {
  display: none;
}

.controls-panel {
  position: sticky;
  top: 32px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.controls-header {
  margin-bottom: 22px;
}

.controls-header p {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.controls-header h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.upload-box {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px dashed #aab3c2;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-box span {
  font-size: 17px;
  font-weight: 800;
}

.upload-box small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.field-group {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field-group label,
.field-label {
  color: #313844;
  font-size: 14px;
  font-weight: 800;
}

.field-group input,
.field-group textarea,
.field-group select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfd6e3;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 16px;
}

.field-group input[type="range"] {
  min-height: 30px;
  padding: 0;
  accent-color: var(--accent);
}

.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.range-label span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.field-group textarea {
  min-height: 76px;
  resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus,
.upload-box:focus-within {
  outline: 3px solid rgba(200, 34, 69, 0.18);
  border-color: var(--accent);
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid #cfd6e3;
  border-radius: 8px;
  background: #f8fafc;
}

.segmented-control-3 {
  grid-template-columns: repeat(3, 1fr);
}

.segmented-control label {
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #364152;
  font-size: 15px;
  font-weight: 800;
}

.segmented-control input:checked + span {
  background: var(--accent);
  color: #ffffff;
}

.download-button {
  width: 100%;
  min-height: 48px;
  margin-top: 22px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
}

.download-button:hover {
  background: var(--accent-strong);
}

.checkbox-control {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #313844;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.checkbox-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    position: static;
    order: -1;
  }

  .offer-card {
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 1000px);
    padding: 20px 0;
    gap: 20px;
  }

  .offer-content {
    padding: 5.4% 6.2%;
  }

  .location-pill {
    min-height: 29px;
    max-width: 86%;
    padding: 5px 14px 5px 10px;
  }

  .offer-content h1 {
    margin-top: 13px;
    max-width: 96%;
    font-size: clamp(24px, calc(var(--hotel-title-size) * 0.6), 45px);
  }

  .offer-bottom {
    gap: 14px;
    align-items: end;
  }

  .price-block strong {
    font-size: clamp(35px, 11vw, 58px);
  }

  .price-block > span {
    font-size: clamp(18px, 6vw, 28px);
  }

  .period-pill {
    margin-top: 14px;
    min-height: 38px;
    padding: 6px 12px;
    border-width: 2px;
    font-size: clamp(14px, 4.4vw, 22px);
  }

  .booking-button {
    min-width: 0;
    width: 34%;
    min-height: 38px;
    padding: 6px 10px;
    font-size: clamp(11px, 3.35vw, 19px);
  }
}

@media (max-width: 480px) {
  .app-shell {
    width: min(100% - 16px, 1000px);
    padding: 12px 0 18px;
    gap: 14px;
  }

  .controls-panel {
    padding: 16px;
  }

  .controls-header {
    margin-bottom: 16px;
  }

  .controls-header h2 {
    font-size: 22px;
  }

  .upload-box {
    padding: 14px;
  }

  .segmented-control {
    gap: 4px;
  }

  .segmented-control span {
    min-height: 36px;
    font-size: 13px;
  }

  .offer-content {
    padding: 5.2% 5.8%;
  }

  .location-pill {
    max-width: 92%;
    gap: 6px;
  }

  .price-block strong {
    font-size: clamp(30px, 10vw, 48px);
  }

  .price-block > span {
    margin-top: 5px;
    font-size: clamp(16px, 5vw, 22px);
  }

  .period-pill,
  .booking-button {
    min-height: 34px;
  }

  .period-pill {
    max-width: 100%;
    margin-top: 10px;
    padding: 5px 10px;
    font-size: clamp(12px, 4vw, 18px);
  }

  .booking-button {
    width: 35%;
    padding: 5px 8px;
    font-size: clamp(9px, 3vw, 14px);
  }
}

@media (max-width: 360px) {
  .offer-bottom {
    gap: 8px;
  }

  .booking-button {
    width: 33%;
    padding-inline: 6px;
    font-size: 9px;
  }
}
