/* ===========================
   AKA-UKA MARKET — Style System
   Mobile-first, appetite-stimulating design
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* --- Design Tokens --- */
:root {
  --primary: #C62828;
  --primary-light: #EF5350;
  --primary-dark: #8E0000;
  --secondary: #E65100;
  --secondary-light: #FF8F00;
  --accent: #F9A825;
  --accent-glow: #FFD54F;

  --bg: #FFF8E1;
  --bg-warm: #FFF3E0;
  --bg-section: #FFFDE7;
  --white: #FFFFFF;

  --text: #2D2D2D;
  --text-secondary: #5D4037;
  --text-muted: #8D6E63;
  --text-on-dark: #FFFFFF;

  --shadow-sm: 0 1px 4px rgba(78,42,20,0.06);
  --shadow: 0 4px 16px rgba(78,42,20,0.08);
  --shadow-lg: 0 8px 32px rgba(78,42,20,0.12);
  --shadow-xl: 0 16px 48px rgba(78,42,20,0.16);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-full: 999px;

  --header-h: 60px;
  --bottom-btn-h: 64px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-btn-h) + 16px);
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  height: var(--header-h);
  box-shadow: 0 2px 12px rgba(198,40,40,0.3);
}

.header-inner {
  max-width: 600px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-on-dark);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-icon {
  font-size: 1.5rem;
}

.logo span {
  color: var(--accent);
}

.header-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  font-size: 1.2rem;
  transition: var(--transition);
}

.header-phone:active {
  background: rgba(255,255,255,0.3);
  transform: scale(0.92);
}

/* --- Hero --- */
.hero {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.65) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 20px;
}

.hero h1 {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-on-dark);
  line-height: 1.25;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 14px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgba(249,168,37,0.4);
  transition: var(--transition);
  align-self: flex-start;
}

.btn-hero:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(249,168,37,0.3);
}

/* --- Info Bar --- */
.info-bar {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--white);
  border-bottom: 1px solid rgba(141,110,99,0.08);
}
.info-bar::-webkit-scrollbar { display: none; }

.info-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  border-right: 1px solid rgba(141,110,99,0.08);
}

.info-item:last-child { border-right: none; }

.info-icon {
  font-size: 1.1rem;
}

/* --- Section Titles --- */
.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  padding: 20px 16px 4px;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Categories Tabs --- */
.categories {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--bg);
  padding: 12px 0 8px;
  border-bottom: 1px solid rgba(141,110,99,0.06);
}

.categories-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 16px;
  max-width: 600px;
  margin: 0 auto;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.cat-tab {
  flex: 0 0 auto;
  padding: 9px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--white);
  border: 1.5px solid rgba(141,110,99,0.12);
  transition: var(--transition);
  white-space: nowrap;
}

.cat-tab.active {
  background: var(--primary);
  color: var(--text-on-dark);
  border-color: var(--primary);
  box-shadow: 0 3px 12px rgba(198,40,40,0.25);
}

.cat-tab:active {
  transform: scale(0.95);
}

/* --- Products Grid --- */
.products {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 12px 24px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* --- Product Card --- */
.food-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.food-card:active {
  transform: scale(0.97);
  box-shadow: var(--shadow);
}

.food-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-warm);
}

.food-card-body {
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.food-card-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.food-card-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.food-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.food-card-price {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--primary);
  white-space: nowrap;
}

.food-card-price small {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: var(--text-on-dark);
  border-radius: var(--radius-xs);
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(198,40,40,0.2);
}

.btn-cart:active {
  background: var(--primary-dark);
  transform: scale(0.9);
}

/* --- Unavailable food --- */
.food-card.unavailable {
  opacity: 0.5;
  pointer-events: none;
}

.food-card.unavailable .food-card-img {
  filter: grayscale(0.7);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* --- Telegram CTA Section --- */
.telegram-cta {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px 32px;
  text-align: center;
}

.telegram-cta-inner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
}

.telegram-cta h2 {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-on-dark);
  margin-bottom: 8px;
}

.telegram-cta p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 20px;
  line-height: 1.5;
}

.btn-telegram {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  color: var(--primary);
  font-weight: 800;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.btn-telegram svg {
  width: 22px;
  height: 22px;
  fill: var(--primary);
}

/* --- Footer --- */
.footer {
  background: var(--text);
  padding: 32px 16px 24px;
  margin-top: 8px;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer-brand {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 16px;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.footer-info p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-info a {
  color: rgba(255,255,255,0.85);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin-bottom: 16px;
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

/* --- Fixed Bottom Button --- */
.fixed-order-btn {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--bottom-btn-h);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-on-dark);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 -4px 24px rgba(198,40,40,0.3);
  transition: var(--transition);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.fixed-order-btn:active {
  background: var(--primary-dark);
}

.fixed-order-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, #f0e6d6 25%, #faf0e0 50%, #f0e6d6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 1;
}

.skeleton-text {
  height: 14px;
  margin: 12px;
  border-radius: 4px;
}

.skeleton-text-sm {
  height: 10px;
  width: 60%;
  margin: 0 12px 12px;
  border-radius: 4px;
}

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

.food-card {
  animation: fadeInUp 0.4s ease-out both;
}

.food-card:nth-child(1) { animation-delay: 0s; }
.food-card:nth-child(2) { animation-delay: 0.05s; }
.food-card:nth-child(3) { animation-delay: 0.1s; }
.food-card:nth-child(4) { animation-delay: 0.15s; }
.food-card:nth-child(5) { animation-delay: 0.2s; }
.food-card:nth-child(6) { animation-delay: 0.25s; }
.food-card:nth-child(7) { animation-delay: 0.3s; }
.food-card:nth-child(8) { animation-delay: 0.35s; }

/* --- Responsive (tablets) --- */
@media (min-width: 480px) {
  .hero { height: 300px; }
  .hero h1 { font-size: 1.7rem; }
  .products-grid { gap: 16px; }
}

@media (min-width: 768px) {
  .hero { height: 360px; }
  .hero h1 { font-size: 2rem; }
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
