/**
 * Little Bites Menu System - Styles
 *
 * PURPOSE:
 * Complete styling for the Little Bites online menu ordering system.
 * Implements brand colors, responsive layout, and interactive animations.
 *
 * DESIGN SYSTEM:
 * - Primary color: #006dab (blue)
 * - Light accent: #E7F3FB
 * - Border radius: 18px (cards), 28px (pills)
 * - Font family: Poppins, Nunito (Canva Sans equivalents)
 *
 * KEY COMPONENTS:
 * 1. Layout
 *    - Max-width 650px container for readability
 *    - Sticky footer with submit button (mobile-optimized)
 *    - Card-based design with soft shadows
 *
 * 2. Menu Cards
 *    - Meal title, price, description dropdown
 *    - Quantity controls (+/- buttons)
 *    - Per-instance option selectors (pills)
 *
 * 3. Interactive Elements
 *    - Quantity buttons: Hover inverts colors, active scales down
 *    - Pills: Hover lifts with border, selected gets blue background
 *    - Submit button: Hover lifts, active presses, submitting pulses
 *
 * 4. Animations
 *    - All transitions: 0.15-0.2s ease timing
 *    - Transform effects: translateY, scale for press feedback
 *    - Pulse animation for submit button during processing
 *
 * 5. Validation & Error States
 *    - Red borders and background for invalid fields
 *    - Animated error messages with slideDown effect
 *    - Focus states clear errors automatically
 *
 * MOBILE OPTIMIZATIONS:
 * - Sticky footer uses left/right positioning for full width
 * - Box-sizing ensures elements fit within viewport
 * - Subtotal left-justified with "Tax not included" note
 * - Submit button centered with max-width constraints
 *
 * RECENT UPDATES (v2.1):
 * - Fixed sticky footer overflow on mobile devices
 * - Redesigned subtotal layout (left-justified with tax note)
 * - Added proper box-sizing to prevent horizontal scrolling
 * - Enhanced customer info validation styling
 *
 * @version 2.1
 * @date 2026-01-09
 */

/* Little Bites Online Menu */

:root {
  --blue: #006dab;
  --light: #E7F3FB;
  --radius: 18px;
  --pill: 28px;
}

body {
  font-family: 'Poppins', 'Nunito', sans-serif;
  margin: 0;
  background: #fafafa;
}

header {
  background: var(--blue);
  color: white;
  padding: 32px 20px;
  text-align: center;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
}

.container {
  max-width: 650px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 140px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--blue);
  margin: 26px 0 14px;
}

.card {
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

input, textarea {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #ddd;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Error state for validation */
input.field-error, textarea.field-error {
  border: 2px solid #dc3545;
  background-color: #fff5f5;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

input.field-error:focus, textarea.field-error:focus {
  outline: none;
  border-color: #dc3545;
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}

/* Error message styling */
.error-message {
  color: #dc3545;
  font-size: 13px;
  margin-top: -8px;
  margin-bottom: 10px;
  padding-left: 4px;
  font-weight: 500;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.meal-card {
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.meal-title {
  font-weight: 600;
  font-size: 17px;
}

.price {
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 8px;
}

.qty-box {
  display: flex;
  gap: 10px;
  align-items: center;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--light);
  border: 1px solid var(--blue);
  color: var(--blue);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qty-btn:hover {
  background: var(--blue);
  color: white;
  transform: scale(1.05);
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-input {
  width: 50px;
  text-align: center;
  padding: 6px 0;
  border-radius: 10px;
  border: 1px solid #ccc;
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.pill {
  padding: 10px 16px;
  border-radius: var(--pill);
  background: var(--light);
  color: var(--blue);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.pill:hover:not(.selected) {
  background: #d0e8f7;
  transform: translateY(-1px);
  border-color: var(--blue);
}

.pill:active {
  transform: scale(0.96);
}

.pill.selected {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0, 109, 171, 0.3);
}

.instance-options {
  margin-top: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 12px;
  border-left: 3px solid var(--blue);
}

.instance-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 6px;
}

.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 16px 20px;
  border-top: 1px solid #ddd;
  box-sizing: border-box;
  max-width: 100vw;
  overflow: hidden;
}

.subtotal-container {
  margin-bottom: 12px;
}

.subtotal-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 18px;
  font-weight: 600;
}

.subtotal-label {
  color: #333;
}

.subtotal-amount {
  color: var(--blue);
}

.tax-note {
  font-size: 13px;
  color: #666;
  font-style: italic;
  font-weight: 400;
  margin-top: 2px;
}

.submit-btn {
  width: 100%;
  max-width: 100%;
  background: var(--blue);
  color: white;
  padding: 14px;
  border-radius: var(--radius);
  border: none;
  font-size: 18px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 109, 171, 0.3);
  box-sizing: border-box;
}

.submit-btn:hover:not(:disabled) {
  background: #005a8f;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 109, 171, 0.4);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 109, 171, 0.2);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.submit-btn.submitting {
  background: #4a86e8;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
.desc-toggle {
  font-size: 14px;
  color: #006dab;
  cursor: pointer;
  margin-bottom: 8px;
}

/* Full working dropdown description (fixed height clipping issue) */
.desc-content {
  font-size: 14px;
  line-height: 1.45;
  background: #f8f8f8;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;

  /* Fix: allow full expansion */
  display: none;
  max-height: none;
  overflow: visible;

  /* Fix for iOS Safari clipping inside flex/relative containers */
  position: relative;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* OPTIONAL: If using animated .open class, include this */
/* .desc-content.open {
  display: block;
} */

.desc-content.open {
  max-height: 200px; /* enough room */
}
