/* KidsEatFree.today — v2 */

/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  --bg:          #FFF9F5;
  --surface:     #FFFFFF;
  --text:        #2D1B0E;
  --text-soft:   #7A6555;
  --accent:      #FF6B35;
  --accent-dark: #E55A2B;
  --accent-light:#FFF0E8;
  --green:       #2CB67D;
  --green-light: #E8F8F0;
  --red:         #E53E3E;
  --red-light:   #FFF0F0;
  --stroke:      #F0E6DD;
  --stroke-dark: #E0D3C7;

  --radius:     14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --shadow-sm:  0 1px 3px rgba(45,27,14,0.06);
  --shadow-md:  0 4px 20px rgba(45,27,14,0.08);
  --shadow-lg:  0 12px 40px rgba(45,27,14,0.12);
  --shadow-card:0 2px 12px rgba(255,107,53,0.08);

  --font-display: 'Nunito', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --h1: clamp(24px, 5vw, 36px);
  --h2: clamp(18px, 3.5vw, 24px);
  --h3: clamp(16px, 3vw, 20px);
  --body: clamp(14px, 2.5vw, 16px);
  --small: 13px;
  --xs: 11px;

  --nav-height: 68px;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 16px);
}
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   Hero Carousel
   ============================================================ */
.hero {
  padding: 12px 16px 0;
}
.hero-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(135deg, #FFD4B8, #FF6B35);
  box-shadow: var(--shadow-lg);
}
.hero-slides {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-slides .slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
}
.hero-slides .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slides .slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0) 100%);
}
.hero-slides .slide-text {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  color: #fff;
}
.hero-slides .slide-text h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--h3);
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.hero-slides .slide-text p {
  font-size: var(--small);
  opacity: 0.9;
  margin-top: 2px;
}

.hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}
.hero-content {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 2;
  color: #fff;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--h1);
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-sub {
  font-size: var(--body);
  opacity: 0.92;
  margin-top: 4px;
  font-weight: 500;
}

/* When carousel has actual slides, hide default content */
.hero-carousel.has-slides .hero-gradient,
.hero-carousel.has-slides .hero-content {
  display: none;
}

.hero-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}
.hero-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}
.hero-dots .dot.is-active {
  background: #fff;
  width: 20px;
  border-radius: 4px;
}

/* ============================================================
   Main Content Area
   ============================================================ */
.main-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================
   Day Strip
   ============================================================ */
.day-strip {
  display: flex;
  gap: 6px;
  padding: 16px 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.day-strip::-webkit-scrollbar { display: none; }

.day-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--stroke-dark);
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--small);
  color: var(--text-soft);
  transition: all 0.2s;
  white-space: nowrap;
}
.day-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.day-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(255,107,53,0.3);
}

/* ============================================================
   Status Bar
   ============================================================ */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 14px;
  font-size: var(--small);
  color: var(--text-soft);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   Deal Cards
   ============================================================ */
.deals-grid {
  display: grid;
  gap: 14px;
  padding-bottom: 24px;
}

.deal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  padding: 18px;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.deal-card:active {
  transform: translateY(0);
}

.deal-card .card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.deal-card .card-info { flex: 1; min-width: 0; }
.deal-card .card-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--h3);
  line-height: 1.2;
  color: var(--text);
}
.deal-card .card-cuisine {
  font-size: var(--xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-top: 2px;
  font-weight: 600;
}

.deal-card .card-fav {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--stroke);
  background: var(--surface);
  display: grid;
  place-items: center;
  transition: all 0.2s;
}
.deal-card .card-fav:hover { border-color: var(--red); background: var(--red-light); }
.deal-card .card-fav.is-saved { border-color: var(--red); background: var(--red-light); }
.deal-card .card-fav.is-saved svg { fill: var(--red); stroke: var(--red); }

.deal-card .card-deal {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--green-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--green);
}
.deal-card .deal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--body);
  color: var(--green);
}
.deal-card .deal-desc {
  font-size: var(--small);
  color: var(--text);
  margin-top: 3px;
  line-height: 1.4;
}

.deal-card .card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  font-size: var(--small);
  color: var(--text-soft);
}
.deal-card .card-meta svg {
  flex-shrink: 0;
}
.card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.deal-card .card-terms {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.term-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: var(--xs);
  font-weight: 600;
}

/* ============================================================
   Loading / Empty States
   ============================================================ */
.loading-state, .empty-state {
  text-align: center;
  padding: 48px 24px;
}
.loader {
  width: 36px;
  height: 36px;
  border: 3px solid var(--stroke);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state p { color: var(--text-soft); font-size: var(--body); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--h2);
  margin-bottom: 8px;
}
.empty-state p { color: var(--text-soft); margin-bottom: 20px; }

.btn-submit, .btn-primary {
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--body);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-submit:hover, .btn-primary:hover { background: var(--accent-dark); }
.btn-submit:active, .btn-primary:active { transform: scale(0.97); }

/* ============================================================
   Bottom Nav
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--stroke);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bnav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: var(--xs);
  font-weight: 600;
  transition: color 0.2s;
}
.bnav-btn svg { transition: transform 0.2s; }
.bnav-btn:hover svg { transform: scale(1.1); }
.bnav-btn.is-active {
  color: var(--accent);
}

/* ============================================================
   Overlays (Search, Submit, Detail)
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.overlay-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--stroke);
}
.overlay-header h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--h2);
}
.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-size: 20px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
}
.overlay-body {
  padding: 20px;
  max-width: 720px;
  margin: 0 auto;
}

/* Search */
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--stroke-dark);
  border-radius: 999px;
  padding: 12px 16px;
  margin-bottom: 20px;
}
.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--body);
}
.search-results { display: grid; gap: 10px; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: border-color 0.15s;
}
.search-result-item:hover { border-color: var(--accent); }
.search-result-item .sr-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--body);
}
.search-result-item .sr-sub {
  font-size: var(--small);
  color: var(--text-soft);
}

/* Submit form */
.submit-info {
  color: var(--text-soft);
  margin-bottom: 20px;
  line-height: 1.5;
}
.submit-form {
  display: grid;
  gap: 16px;
}
.submit-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: var(--small);
  color: var(--text-soft);
}
.submit-form input,
.submit-form textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--stroke-dark);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--body);
  color: var(--text);
  transition: border-color 0.2s;
}
.submit-form input:focus,
.submit-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.submit-form textarea {
  min-height: 100px;
  resize: vertical;
}
.submit-success {
  text-align: center;
  padding: 40px 0;
}
.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 28px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}
.submit-success h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--h2);
}
.submit-success p {
  color: var(--text-soft);
  margin-top: 6px;
}

/* ============================================================
   Detail Overlay
   ============================================================ */
.detail-hero {
  padding: 4px 0 20px;
}
.detail-address {
  color: var(--text-soft);
  font-size: var(--small);
  margin-top: 4px;
}
.detail-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: var(--small);
  font-weight: 600;
}
.detail-rating .stars { color: #F59E0B; }
.detail-actions {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}
.detail-actions a, .detail-actions button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius);
  border: 1.5px solid var(--stroke-dark);
  background: var(--surface);
  text-align: center;
  font-weight: 600;
  font-size: var(--small);
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s;
}
.detail-actions a:hover, .detail-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.detail-deals-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--h3);
  margin-bottom: 12px;
}
.detail-deal-row {
  padding: 14px 16px;
  background: var(--green-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--green);
  margin-bottom: 10px;
}
.detail-deal-row .ddr-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--green);
}
.detail-deal-row .ddr-desc {
  font-size: var(--small);
  color: var(--text);
  margin-top: 2px;
}
.detail-deal-row .ddr-days {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ddr-days .day-dot {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--xs);
  font-weight: 700;
  background: #D1FAE5;
  color: #065F46;
}
.ddr-days .day-dot.inactive {
  background: var(--stroke);
  color: var(--text-soft);
}
.detail-deal-row .ddr-terms {
  margin-top: 8px;
  font-size: var(--xs);
  color: var(--text-soft);
  line-height: 1.5;
}
.report-row {
  margin-top: 20px;
  text-align: center;
}
.btn-report {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--stroke-dark);
  background: var(--surface);
  font-size: var(--small);
  font-weight: 600;
  color: var(--text-soft);
  transition: all 0.15s;
}
.btn-report:hover { border-color: var(--red); color: var(--red); }

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 580px) {
  .deals-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 900px) {
  .hero { padding: 16px 24px 0; }
  .main-wrap { padding: 0 24px; }
}

/* ============================================================
   Animations
   ============================================================ */
.deal-card {
  animation: fadeInUp 0.35s ease both;
}
.deal-card:nth-child(1) { animation-delay: 0.03s; }
.deal-card:nth-child(2) { animation-delay: 0.06s; }
.deal-card:nth-child(3) { animation-delay: 0.09s; }
.deal-card:nth-child(4) { animation-delay: 0.12s; }
.deal-card:nth-child(5) { animation-delay: 0.15s; }
.deal-card:nth-child(6) { animation-delay: 0.18s; }
.deal-card:nth-child(7) { animation-delay: 0.21s; }
.deal-card:nth-child(8) { animation-delay: 0.24s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .deal-card { animation: none; }
  .overlay { animation: none; }
  .status-dot { animation: none; }
  .loader { animation-duration: 1.5s; }
}
