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

:root {
  --color-brand-yellow: #fbd614; /* Ajustado mas cerca al amarillo huevo del logo */
  --color-brand-green: #1f4a2d;
  --color-brand-orange: #f25c05;
  
  --color-bg: #f8f9fa; /* Un gris muy claro super limpio tipo iOS */
  --color-surface: #ffffff;
  --color-surface-muted: #f1f3f5;
  --color-border: #e9ecef;
  --color-text: #212529;
  --color-text-muted: #868e96;
  
  --color-primary: var(--color-brand-orange);
  --color-primary-hover: #d94d04;

  --font-family-base: "Outfit", -apple-system, sans-serif;
  
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.12);
  --shadow-orange: 0 8px 24px rgba(242, 92, 5, 0.25);
  
  --bottom-bar-height: 80px;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--bottom-bar-height) + 20px);
}

button, input, select, textarea { font: inherit; outline: none; border: none; }
button { cursor: pointer; background: transparent; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.skip-link { display: none; }

.app-wrapper {
  max-width: 500px;
  margin: 0 auto;
  background: var(--color-bg);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 50px rgba(0,0,0,0.05);
}

.public-mini-nav-wrap {
  padding: 12px 20px 0;
}

.public-mini-nav {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.public-mini-nav summary {
  list-style: none;
  min-height: 42px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-brand-green);
  font-weight: 800;
  cursor: pointer;
}

.public-mini-nav summary::-webkit-details-marker {
  display: none;
}

.public-mini-nav summary::after {
  content: '+';
  font-size: 1rem;
}

.public-mini-nav[open] summary::after {
  content: '-';
}

.public-mini-nav-menu {
  display: grid;
  gap: 1px;
  padding: 0 10px 10px;
}

.public-mini-nav-menu a {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  background: #fff;
  color: var(--color-brand-green);
  font-weight: 700;
}

/* Header Premium Blanco con sombra */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* El logo "Paint" lo convertimos en un Avatar moderno */
.brand-logo {
  height: 160px;
  width: 160px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  border: 4px solid #fff;
  background: var(--color-brand-yellow);
  transform: scale(1.05); /* Ligeramente menos para que no se corte tanto a este tamano */
  margin-bottom: -50px; 
}

/* Hero Section: Banner Premium */
.hero-section {
  padding: 16px 20px;
}

.hero-banner {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: var(--radius-lg);
  background: url('/assets/hero.png') center/cover no-repeat;
  background-color: var(--color-brand-yellow);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 24px;
}
.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 20%, rgba(31, 74, 45, 0.8) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
}
.hero-content h1 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.hero-content p {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.9;
}

/* Category Slider */
.categories-container {
  padding: 4px 20px 16px;
}

.category-tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.category-tab.is-active {
  background: var(--color-brand-green);
  color: var(--color-brand-yellow);
  box-shadow: 0 8px 16px rgba(31, 74, 45, 0.2);
}

/* Products Grid */
.products-wrapper {
  padding: 0 20px;
}

.products-grid {
  display: grid;
  gap: 16px;
}

.product-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  align-items: stretch;
}

.product-visual {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-md);
  background-color: var(--color-surface-muted);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
}

.product-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-info h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.2;
}

.product-info p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--color-brand-green);
}

/* Aggregation Stepper for App */
.add-action-wrapper {
  display: flex;
  align-items: center;
  height: 36px;
}

.button-add-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-brand-orange);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-orange);
}

.mini-stepper {
  display: flex;
  align-items: center;
  background: var(--color-surface-muted);
  border-radius: var(--radius-pill);
  height: 36px;
  padding: 0 4px;
}

.qty-button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-brand-green);
  font-weight: 900;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.product-meta-note-qty {
  font-weight: 800;
  color: var(--color-text);
  min-width: 20px;
  text-align: center;
  font-size: 1rem;
}

/* UI Botones y Textos Genéricos */
.button-primary {
  background: var(--color-brand-orange);
  color: #fff;
  min-height: 52px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 1.05rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-orange);
}

.button-secondary {
  background: var(--color-surface-muted);
  color: var(--color-text);
  min-height: 52px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 1rem;
  width: 100%;
}

/* Checkout */
.checkout-section { padding: 4px 20px; }
.section-head { margin-bottom: 20px; }
.checkout-section h2 { font-size: 1.6rem; font-weight: 900; color: var(--color-brand-green); }
.checkout-section p.section-copy { color: var(--color-text-muted); font-size: 0.95rem; }

.surface-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 16px;
}

.field { display: grid; gap: 8px; }
.field span { font-size: 0.85rem; font-weight: 700; color: var(--color-text-muted); }
input, select, textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  background: var(--color-surface-muted);
  border-radius: 12px;
  font-weight: 600;
  border: 2px solid transparent;
}
input:focus, select:focus, textarea:focus { border-color: var(--color-brand-yellow); background: #fff; }

.location-tools {
  display: grid;
  gap: 10px;
  margin-top: -4px;
}

.button-location {
  min-height: 46px;
  border-radius: 14px;
  background: rgba(31, 74, 45, 0.08);
  color: var(--color-brand-green);
  font-weight: 800;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(31, 74, 45, 0.14);
}

.button-location.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.location-help {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.location-help.is-success {
  color: var(--color-brand-green);
  font-weight: 600;
}

.location-help.is-error {
  color: #b42318;
  font-weight: 600;
}

/* Floating Bottom Bar Navigation */
.floating-cart-button {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  width: calc(100% - 32px);
  max-width: 440px;
  height: 64px;
  background: var(--color-brand-green);
  color: var(--color-brand-yellow);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-lg);
  z-index: 29;
}
.floating-cart-button::before {
  content: 'Ver pedido';
  font-size: 1.15rem;
  font-weight: 800;
}
.floating-cart-button strong {
  background: var(--color-brand-yellow);
  color: var(--color-brand-green);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-weight: 900;
  font-size: 1rem;
}

/* Modern Cart Panel Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(33, 37, 41, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.cart-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  bottom: 0;
  z-index: 40;
  width: 100%;
  max-width: 500px;
  height: 85vh;
  background: #fff;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cart-panel.is-open { transform: translateX(-50%) translateY(0); }

.cart-panel-head {
  padding: 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-panel-head h2 { font-weight: 900; font-size: 1.4rem; color: var(--color-brand-green); }
.cart-close-button {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-surface-muted);
  display: grid; place-items: center;
  font-size: 1.4rem; font-weight: bold; color: var(--color-text-muted);
}

.cart-items {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  display: grid;
  gap: 16px;
  align-content: start;
}
.cart-item {
  background: var(--color-surface-muted);
  padding: 16px;
  border-radius: var(--radius-lg);
}
.item-top { display: flex; justify-content: space-between; align-items: flex-start; }
.item-name { font-weight: 800; font-size: 1.05rem; }
.item-line-total { font-weight: 900; color: var(--color-brand-green); font-size: 1.1rem; }

.cart-summary {
  padding: 20px 24px 0;
  border-top: 1px solid var(--color-border);
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600;}
.summary-total { padding-top: 12px; font-weight: 900; font-size: 1.3rem; color: var(--color-brand-green); }

.cart-panel-actions { padding: 16px 24px 32px; display: grid; gap: 12px; }

/* Status banners */
.toast {
  position: fixed; top: 100px; left: 50%; transform: translate(-50%, -20px);
  background: #212529; color: #fff; font-weight: 700; padding: 12px 24px;
  border-radius: var(--radius-pill); z-index: 100; opacity: 0; transition: all 0.2s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
