/* Theme variables */
:root {
  --primary: #223047;
  --secondary: #40516b;
  --accent: #d4af37;
  --accent-soft: rgba(212, 175, 55, 0.2);
  --light: #f8f5e6;
  --surface: #ffffff;
  --surface-muted: #f4efe2;
  --text-color: #2c3e50;
  --shadow-lg: 0 24px 48px rgba(34, 48, 71, 0.18);
  --shadow-md: 0 16px 32px rgba(34, 48, 71, 0.12);
  --shadow-sm: 0 8px 16px rgba(34, 48, 71, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Lora', serif;
  background: linear-gradient(145deg, #f8f5e6 0%, #f2ecde 45%, #ede6d4 100%);
  color: var(--text-color);
  margin: 0;
  line-height: 1.6;
  padding: 3rem 1.5rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.header {
  position: relative;
  padding: 3.5rem 3rem;
  background: linear-gradient(135deg, rgba(34, 48, 71, 0.92), rgba(34, 48, 71, 0.75) 55%, rgba(52, 73, 94, 0.85));
  color: #fff;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(212, 175, 55, 0.25), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(255, 255, 255, 0.2), transparent 50%);
}

.header-inner {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.restaurant-name {
  font-family: 'Great Vibes', cursive;
  font-size: 3.5rem;
  margin: 0;
  color: var(--accent);
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  letter-spacing: 3px;
}

.subtitle {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  margin: 0.75rem 0 1.25rem;
}

.instructions {
  margin: 0 auto;
  max-width: 520px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.instructions span {
  font-size: 1.3rem;
}

main {
  padding: 3rem;
}

.controls {
  background: var(--surface-muted);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  margin-top: -2.5rem;
  position: relative;
  z-index: 2;
}

.controls-header h2 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--primary);
}

.controls-header p {
  margin: 0.5rem 0 0;
  color: rgba(34, 48, 71, 0.75);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.control-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid rgba(34, 48, 71, 0.08);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-count-control label {
  font-weight: 600;
  font-family: 'Playfair Display', serif;
  color: var(--primary);
}

.option-count-control input {
  border-radius: 999px;
  border: 1px solid rgba(34, 48, 71, 0.2);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  background: var(--surface-muted);
}

.option-count-control input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.price-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.price-label {
  font-weight: 600;
  font-family: 'Playfair Display', serif;
  color: var(--primary);
  margin-right: 0.25rem;
}

.price-filters label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(34, 48, 71, 0.08);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.price-filters label:hover {
  background: rgba(34, 48, 71, 0.15);
}

.price-filters input {
  accent-color: var(--accent);
}

.sections {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
}

.selection-section {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 2rem;
  border: 1px solid rgba(34, 48, 71, 0.08);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.selection-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0;
}

.add-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(34, 48, 71, 0.9);
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.add-btn:hover {
  transform: translateY(-2px);
  background: var(--accent);
  color: var(--primary);
  box-shadow: 0 8px 16px rgba(212, 175, 55, 0.35);
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
}

.menu-item {
  background: var(--surface-muted);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.menu-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(34, 48, 71, 0.18);
  border-color: var(--accent);
}

.menu-item.selected {
  background: linear-gradient(135deg, rgba(34, 48, 71, 0.95), rgba(64, 81, 107, 0.9));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 18px 36px rgba(34, 48, 71, 0.4);
}

.menu-item.selected .item-price {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.menu-item.selected .item-description {
  color: rgba(255, 255, 255, 0.85);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.item-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.item-price {
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(34, 48, 71, 0.1);
  color: var(--primary);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.08em;
}

.item-description {
  font-size: 0.9rem;
  color: rgba(34, 48, 71, 0.75);
  font-style: italic;
}

.action-buttons {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.btn {
  font-family: 'Playfair Display', serif;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  font-size: 0.95rem;
}

.btn:focus-visible,
.icon-button:focus-visible,
.saved-plan-delete:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 18px 34px rgba(34, 48, 71, 0.25);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 42px rgba(34, 48, 71, 0.28);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: rgba(34, 48, 71, 0.2);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--primary);
  box-shadow: 0 12px 24px rgba(212, 175, 55, 0.25);
}

.btn-ghost {
  background: rgba(34, 48, 71, 0.05);
  color: var(--primary);
}

.btn-ghost:hover {
  background: rgba(34, 48, 71, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 12px 20px rgba(34, 48, 71, 0.15);
}

.choice-display {
  margin-top: 3rem;
  display: none;
}

.plan-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  border: 1px solid rgba(34, 48, 71, 0.1);
  box-shadow: var(--shadow-md);
}

.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.plan-card-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--primary);
  margin: 0;
}

.icon-button {
  background: var(--accent);
  color: var(--primary);
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font-family: 'Playfair Display', serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.icon-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(212, 175, 55, 0.3);
}

.choice-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.selection-summary {
  font-size: 1.15rem;
  font-family: 'Playfair Display', serif;
  color: var(--secondary);
  margin: 0;
}

.selection-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
}

.selection-details dt {
  font-weight: 600;
  color: var(--primary);
}

.selection-details dd {
  margin: 0;
  color: rgba(34, 48, 71, 0.75);
}

.plan-text {
  width: 100%;
  min-height: 150px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(34, 48, 71, 0.15);
  padding: 1.1rem 1.25rem;
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  background: var(--surface-muted);
  resize: vertical;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.plan-text:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  outline: none;
}

.plan-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: rgba(34, 48, 71, 0.65);
}

.saved-plans {
  margin-top: 3.5rem;
}

.saved-plans h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.saved-plans-list {
  display: grid;
  gap: 1.5rem;
}

.saved-plan-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.saved-plan-summary {
  margin: 0;
  font-size: 1rem;
  color: var(--secondary);
}

.saved-plan-meta {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(34, 48, 71, 0.65);
}

.saved-plan-actions {
  display: flex;
  justify-content: flex-end;
}

.saved-plan-delete {
  background: transparent;
  border: none;
  color: rgba(34, 48, 71, 0.45);
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.25s ease;
}

.saved-plan-delete:hover {
  color: var(--primary);
  transform: scale(1.05);
}

.empty-state {
  font-size: 0.95rem;
  color: rgba(34, 48, 71, 0.6);
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.footer {
  padding: 2.5rem 3rem 3rem;
  text-align: center;
  background: var(--surface);
  border-top: 1px solid rgba(34, 48, 71, 0.08);
}

.footer .quote {
  font-style: italic;
  color: rgba(34, 48, 71, 0.7);
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  body {
    padding: 2rem 1rem;
  }

  main {
    padding: 2.5rem 2rem;
  }

  .controls {
    margin-top: -1.5rem;
    padding: 2rem;
  }

  .plan-card {
    padding: 2rem;
  }
}

@media (max-width: 600px) {
  .header {
    padding: 3rem 2rem;
  }

  .restaurant-name {
    font-size: 3rem;
  }

  main {
    padding: 2rem 1.5rem;
  }

  .controls {
    padding: 1.75rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn,
  .icon-button {
    width: 100%;
    text-align: center;
  }

  .selection-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 450px) {
  body {
    padding: 1.5rem 1rem;
  }

  main {
    padding: 1.75rem 1.25rem;
  }

  .controls {
    margin-top: -1rem;
  }
}
