/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pink: #ff6b9d;
  --pink-light: #ffa0c4;
  --purple: #c084fc;
  --purple-dark: #7c3aed;
  --gold: #fbbf24;
  --gold-light: #fde68a;
  --coral: #fb7185;
  --mint: #6ee7b7;
  --sky: #7dd3fc;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-500: #737373;
  --gray-700: #404040;
  --gray-900: #171717;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Fredoka', 'Inter', sans-serif;
  font-weight: 600;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* === Buttons === */
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-danger:hover { background: #fecaca; }

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}

/* === Forms === */
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--purple);
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  z-index: 1000;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.toast-visible {
  transform: translateX(-50%) translateY(0);
}
.toast-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}
.toast-error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

/* === Loading === */
.loading {
  text-align: center;
  padding: 60px 20px;
  font-size: 1.2rem;
  color: var(--gray-500);
}

.error-message {
  color: #dc2626;
  font-size: 0.9rem;
  margin-top: 8px;
  min-height: 1.2em;
}

/* === Confetti Background === */
.confetti-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.confetti-bg::before,
.confetti-bg::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle, var(--pink) 2px, transparent 2px),
    radial-gradient(circle, var(--gold) 2px, transparent 2px),
    radial-gradient(circle, var(--purple) 1.5px, transparent 1.5px),
    radial-gradient(circle, var(--coral) 1.5px, transparent 1.5px),
    radial-gradient(circle, var(--sky) 2px, transparent 2px),
    radial-gradient(circle, var(--mint) 1.5px, transparent 1.5px);
  background-size:
    120px 140px,
    160px 180px,
    100px 120px,
    140px 160px,
    180px 200px,
    130px 150px;
  background-position:
    10px 20px,
    50px 60px,
    80px 10px,
    30px 90px,
    120px 40px,
    70px 130px;
  animation: confetti-drift 20s linear infinite;
  opacity: 0.3;
}

.confetti-bg::after {
  animation-duration: 25s;
  animation-direction: reverse;
  opacity: 0.2;
}

@keyframes confetti-drift {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* === Guest Body === */
.guest-body {
  background: linear-gradient(135deg, #fdf2f8 0%, #faf5ff 50%, #f0f9ff 100%);
}

/* === Registration === */
.registration-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.registration-card {
  background: var(--white);
  border-radius: 24px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  animation: card-pop 0.5s ease;
}

@keyframes card-pop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.party-title {
  font-size: 2rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.registration-subtitle {
  color: var(--gray-500);
  margin-bottom: 28px;
  font-size: 1.05rem;
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.register-form input {
  text-align: center;
  font-size: 1.15rem;
  padding: 16px;
  border-radius: var(--radius);
}

/* === Guest Header === */
.guest-header {
  background: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.party-name {
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.guest-badge {
  background: var(--gray-100);
  padding: 8px 16px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 0.9rem;
}

/* === Person Selector === */
.person-selector {
  background: var(--white);
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
}

.person-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 800px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.person-selector-label {
  font-size: 0.85rem;
  color: var(--gray-500);
  font-weight: 500;
  white-space: nowrap;
}

.person-tab {
  padding: 6px 16px;
  border-radius: 100px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.person-tab:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.person-tab-active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  border-color: transparent;
}

.person-tab-active:hover {
  color: white;
}

.person-tab-add {
  border-style: dashed;
  font-size: 1.1rem;
  padding: 6px 14px;
  color: var(--gray-400);
}

.person-tab-add:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.remove-child {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  cursor: pointer;
  padding: 0 2px;
}

.remove-child:hover {
  opacity: 1;
}

.person-tab-active .remove-child {
  color: white;
}

.add-child-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-child-form input {
  text-align: center;
  font-size: 1.05rem;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
}

.add-child-form input:focus {
  border-color: var(--purple);
}

/* === Person Banner === */
.person-banner {
  max-width: 800px;
  margin: 0 auto;
  padding: 10px 20px;
  margin-top: 12px;
  background: linear-gradient(135deg, #ede9fe, #fce7f3);
  border-radius: 12px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
  min-width: 200px;
}

.person-banner-enter {
  animation: banner-slide 0.3s ease;
}

@keyframes banner-slide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Menu === */
.menu-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.category-section {
  margin-bottom: 32px;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.category-name {
  font-size: 1.4rem;
  color: var(--gray-900);
}

.category-limit {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* === Product Cards === */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card.out-of-stock {
  opacity: 0.6;
}

.product-image {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: var(--gray-100);
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.product-info {
  padding: 14px 16px 16px;
}

.product-name {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.product-description {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stock-badge {
  background: #ecfdf5;
  color: #059669;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
}
.stock-badge.stock-empty {
  background: #fee2e2;
  color: #dc2626;
}

.order-btn {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Fredoka', sans-serif;
}
.order-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}
.order-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* === Confirm Dialog === */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fade-in 0.15s ease;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirm-dialog {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: card-pop 0.2s ease;
}
.confirm-text {
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.confirm-subtext {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.confirm-warning {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.4;
}
.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.confirm-actions .btn-primary {
  padding: 10px 24px;
  font-size: 1rem;
}
.confirm-actions .btn-secondary {
  padding: 10px 20px;
}

/* === Empty State === */
.empty-menu {
  text-align: center;
  padding: 80px 20px;
  font-size: 1.1rem;
  color: var(--gray-500);
}
.empty-menu p:first-child {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

/* === Responsive === */
@media (max-width: 600px) {
  .guest-header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .person-tabs {
    justify-content: center;
  }

  .person-selector-label {
    width: 100%;
    text-align: center;
  }

  .party-name {
    font-size: 1.2rem;
  }

  .products-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .product-image {
    height: 120px;
  }

  .product-info {
    padding: 10px 12px 12px;
  }

  .product-name {
    font-size: 0.95rem;
  }

  .product-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .order-btn {
    text-align: center;
  }

  .registration-card {
    padding: 36px 24px;
  }

  .party-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 380px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

