/* Reservation section: intro with the phone number beside the inline form */
.booking {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
  gap: var(--space-xl);
}

.booking__intro h2 {
  margin-bottom: var(--space-s);
}

.booking__lead {
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.45;
}

.booking__phone {
  margin-top: var(--space-l);
  padding-top: var(--space-m);
  border-top: 1px solid var(--cellar-line);
}

.booking__phone-lead {
  margin-bottom: var(--space-xs);
  color: var(--muted);
}

.booking__phone-number {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.2;
  text-decoration: none;
}

.booking__phone-number:hover {
  color: var(--vino-light);
}

/* Form */
/* A shade lighter than the band and lifted off it, so the form stands out */
.reservation {
  padding: var(--space-l);
  border: 1px solid rgb(245 237 219 / 0.14);
  border-radius: var(--radius);
  background: #45172c;
  box-shadow: 0 1.5rem 3rem -1rem rgb(0 0 0 / 0.5);
}

.reservation__hint {
  color: var(--muted);
  font-size: var(--step--1);
}

.reservation__privacy {
  margin: var(--space-m) 0 0;
}

.reservation__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.reservation__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-s) var(--space-m);
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--step--1);
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--cellar-line);
  border-radius: var(--radius);
  background: var(--night);
  color: var(--paper);
  font: inherit;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #8f7784;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: transparent;
  outline-offset: 0;
}

/* The browser's own arrow is replaced, so the list looks like the other fields */
.field select {
  padding-right: 2.4rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5eddb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.8rem center;
  background-repeat: no-repeat;
  background-size: 1.1rem;
  cursor: pointer;
}

.field select:invalid {
  color: #8f7784;
}

.field select option {
  color: var(--paper);
}

.field [aria-invalid='true'] {
  border-color: var(--danger);
}

/* "Co byste rádi ochutnali?": optional picks as pills, the same shape as the menu's category pills.
   The real checkbox stays in the pill (invisible) for the keyboard and screen readers. */
.choices {
  margin: var(--space-xs) 0 0;
  padding: var(--space-s) 0 0;
  border: 0;
  border-top: 1px solid var(--cellar-line);
}

.choices + .choices {
  margin-top: 0;
  padding-top: var(--space-xs);
  border-top: 0;
}

.choices legend {
  float: left; /* lets the fieldset's top padding apply above the legend */
  width: 100%;
  margin-bottom: 0.65rem;
  padding: 0;
  font-family: var(--font-display);
  font-size: var(--step-0);
  line-height: 1.3;
}

.choices__list {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.field .choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgb(245 237 219 / 0.3);
  border-radius: var(--radius-pill);
  color: var(--paper);
  font-size: var(--step--1);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 180ms var(--ease),
    border-color 180ms var(--ease),
    color 180ms var(--ease);
}

.field .choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  opacity: 0;
  cursor: pointer;
}

/* Every pill leads with a small circle (an empty ring, or a wine's own colour) and a tick
   appears inside it when picked, so picking never changes the pill's width */
.choice::after {
  content: '';
  order: -1;
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--swatch, transparent);
  box-shadow: inset 0 0 0 1.5px currentColor;
  transition:
    background-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.choice::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0.9rem; /* = the pill's left padding, right over the circle */
  width: 0.95rem;
  height: 0.95rem;
  background: var(--tick, var(--ochre));
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.65rem no-repeat;
  transform: translateY(-50%) scale(0);
  transition: transform 200ms var(--ease);
  pointer-events: none;
}

.field .choice:hover {
  border-color: var(--paper);
}

.field .choice:has(input:checked) {
  border-color: var(--ochre);
  background: var(--ochre);
  color: var(--ink);
}

.choice:has(input:checked)::after {
  background: var(--swatch, var(--ink));
}

.choice:has(input:checked)::before {
  transform: translateY(-50%) scale(1);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}

/* Wines: the circle is a drop of the wine's colour, with a tick that stays readable on it */
.choice:has([name='wine'])::after {
  box-shadow: inset 0 0 0 1px rgb(30 10 18 / 0.3);
}

.choice:has([value='red']) { --swatch: #9b1d3a; --tick: var(--paper); }
.choice:has([value='white']) { --swatch: #eadc9b; --tick: var(--ink); }
.choice:has([value='rose']) { --swatch: #f1a3b5; --tick: var(--ink); }
.choice:has([value='sparkling']) {
  --swatch: radial-gradient(circle at 30% 32%, #fffbe8 0 14%, transparent 16%),
    radial-gradient(circle at 70% 68%, #fffbe8 0 11%, transparent 13%), #e4cf7c;
  --tick: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .field .choice,
  .choice::before,
  .choice::after {
    transition: none;
  }
}

.field__error {
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: var(--step--1);
}

.field__error:empty {
  display: none;
}

.reservation__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-l);
}

/* Outcome of sending, shown right under the button that was pressed */
.reservation__result {
  display: flex;
  align-items: flex-start;
  gap: var(--space-s);
  margin-top: var(--space-m);
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--ochre);
  border-radius: var(--radius);
}

.reservation__result.is-error {
  border-color: var(--danger);
}

.reservation__result-icon {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--ochre);
}

.is-error .reservation__result-icon {
  color: var(--danger);
}

.reservation__result-title {
  margin: 0 0 0.2rem;
  font-weight: 600;
}

.reservation__result-text {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 45rem) {
  .booking {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-l);
  }

  .reservation {
    padding: var(--space-m);
  }

  .reservation__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .reservation__actions .btn {
    width: 100%;
  }
}
