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

:root {
  --orange:        #FF6B1A;
  --orange-light:  #FF8C42;
  --orange-dark:   #D94F00;
  --gold:          #F5C518;
  --gold-light:    #FFD966;
  --gold-dark:     #C8960C;
  --light-bg:      #FFFFFF;
  --light-bg-2:    #F9F6F2;
  --light-bg-3:    #F0EDE8;
  --text-dark:     #2D2D2D;
  --text-muted:    #757575;
  --border-light:  #E8E8E8;
  --font-display: 'Lato', sans-serif;
  --font-body:    'Lato', sans-serif;
  --radius:    12px;
  --radius-lg: 24px;
  --shadow:    0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--orange);
  color: white;
}

.btn-primary:hover { background: var(--orange-dark); }

.btn-outline {
  border: 2px solid var(--orange);
  color: var(--orange);
  background: transparent;
}

.btn-outline:hover { background: rgba(255, 107, 26, 0.1); }

/* --- NAVBAR --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  z-index: 100;
  border-bottom: 1px solid var(--border-light);
  padding: 0 24px;
}

.navbar-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.navbar-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--orange);
}

.navbar-sede {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-cart-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--gold);
  color: var(--text-dark);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  margin-top: 72px;
  padding: 40px 0;
  min-height: calc(100vh - 72px);
}

/* --- SEDES PAGE --- */
.sedes-header {
  text-align: center;
  margin-bottom: 40px;
}

.sedes-header h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  margin-bottom: 8px;
}

.sedes-header p {
  font-size: 18px;
  color: var(--text-muted);
}

.sedes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.sede-card {
  background: white;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.sede-card:hover:not(.sede-card--disabled) {
  border-color: var(--orange);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.sede-card--disabled {
  opacity: 0.6;
  pointer-events: none;
}

.sede-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}

.sede-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.sede-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sede-horario {
  font-size: 13px;
  color: var(--orange);
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 16px;
}

.sede-card .btn {
  width: 100%;
  justify-content: center;
}

.sede-badge {
  display: inline-block;
  background: var(--light-bg-3);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
}

/* --- MENU PAGE --- */
.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.menu-sede-info h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.menu-sede-info p {
  font-size: 14px;
  color: var(--text-muted);
}

.search-box {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 26, 0.1);
}

.breadcrumb {
  font-size: 14px;
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--orange);
  font-weight: 600;
}

/* --- TABS --- */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 32px;
  padding-bottom: 12px;
  scroll-behavior: smooth;
}

.category-tabs::-webkit-scrollbar {
  height: 4px;
}

.category-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.category-tabs::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}

.tab-btn {
  padding: 10px 20px;
  border: 1px solid var(--border-light);
  border-radius: 50px;
  background: white;
  color: var(--text-dark);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s;
  border-color: var(--border-light);
}

.tab-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.tab-btn.active {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}

/* --- PRODUCT GRID --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.product-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.product-image {
  width: 100%;
  height: 160px;
  background: var(--light-bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-image-placeholder {
  position: absolute;
  font-size: 64px;
  color: var(--text-muted);
  font-weight: 800;
  display: none;
}

.product-image.no-image {
  position: relative;
}

.product-image.no-image img {
  display: none;
}

.product-image.no-image .product-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

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

.product-price {
  color: var(--orange);
  font-weight: 700;
  font-size: 18px;
}

.product-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
}

.product-counter {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--light-bg-2);
  border-radius: var(--radius);
  padding: 2px;
}

.product-counter button {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-weight: 700;
  color: var(--orange);
  border-radius: 4px;
  transition: background 0.2s;
}

.product-counter button:hover {
  background: white;
}

.product-counter span {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
}

/* --- TOAST --- */
.toast {
  position: fixed;
  top: 100px;
  right: 24px;
  background: #4CAF50;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  transform: translateX(450px);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

/* --- CHECKOUT PAGE --- */
.checkout-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.checkout-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.checkout-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  max-height: 400px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.cart-item-qty {
  font-size: 12px;
  color: var(--text-muted);
}

.cart-item-counter {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-item-counter button {
  background: var(--light-bg-2);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--orange);
  transition: background 0.2s;
}

.cart-item-counter button:hover {
  background: var(--gold-light);
}

.cart-item-price {
  color: var(--orange);
  font-weight: 700;
  min-width: 60px;
  text-align: right;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 24px;
  font-weight: 800;
  padding: 20px 0;
  border-top: 2px solid var(--border-light);
  color: var(--orange);
}

.cart-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.cart-links a {
  font-size: 13px;
  color: var(--orange);
  font-weight: 600;
  padding: 8px 12px;
}

/* --- FORM --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.form-input {
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 26, 0.1);
}

.form-input.error {
  border-color: #F44336;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.form-checkbox input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.security-badges {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

.security-badges span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- CONFIRMACION --- */
.confirmation-hero {
  text-align: center;
  margin-bottom: 40px;
}

.confirmation-hero .icon {
  font-size: 80px;
  margin-bottom: 16px;
}

.confirmation-hero h1 {
  font-size: 40px;
  font-weight: 800;
  color: #4CAF50;
  margin-bottom: 8px;
}

.confirmation-hero p {
  font-size: 16px;
  color: var(--text-muted);
}

.confirmation-card {
  max-width: 560px;
  margin: 0 auto;
  background: white;
  border: 2px solid var(--orange);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.order-code {
  font-size: 32px;
  font-weight: 800;
  color: var(--orange);
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  margin: 20px 0;
  padding: 16px;
  background: var(--light-bg-2);
  border-radius: var(--radius);
}

.pickup-info {
  text-align: left;
  margin: 24px 0;
}

.pickup-info p {
  font-size: 14px;
  margin-bottom: 8px;
}

.pickup-info strong {
  color: var(--orange);
  font-weight: 700;
}

.cta-button {
  margin-top: 32px;
}

/* --- CART DRAWER --- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 380px;
  background: white;
  z-index: 400;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-drawer-footer {
  padding: 20px;
  border-top: 1px solid var(--border-light);
  background: white;
}

.cart-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* --- FAB --- */
.cart-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
}

.cart-fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--orange);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  font-size: 24px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cart-fab-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

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

/* --- SEDE WARNING DIALOG --- */
.sede-warning-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.sede-warning-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.sede-warning-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  max-width: 400px;
}

.sede-warning-box h2 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #d97706;
}

.sede-warning-box p {
  margin: 8px 0;
  color: #374151;
}

.sede-warning-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.sede-warning-actions button {
  flex: 1;
}

.btn-secondary {
  background: var(--light-bg-3);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* --- ALERTS --- */
.alert {
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: #FFEBEE;
  border: 1px solid #EF5350;
  color: #C62828;
}

.alert-success {
  background: #E8F5E9;
  border: 1px solid #66BB6A;
  color: #2E7D32;
}

.alert-warning {
  background: #FFF3E0;
  border: 1px solid #FFA726;
  color: #E65100;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .checkout-container {
    grid-template-columns: 1fr;
  }

  .menu-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-box {
    max-width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cart-drawer {
    width: 100%;
    height: 90vh;
    bottom: 0;
    top: auto;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  .cart-drawer.open {
    transform: translateY(0);
  }

  .cart-fab {
    bottom: 16px;
    right: 16px;
  }

  .cart-fab-btn {
    width: 48px;
    height: 48px;
  }
}

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

  .sedes-grid {
    grid-template-columns: 1fr;
  }

  .navbar-content {
    height: 64px;
    padding: 0 16px;
  }

  main {
    margin-top: 64px;
    padding: 20px 0;
  }

  .checkout-container {
    gap: 20px;
  }

  .checkout-card {
    padding: 20px;
  }

  .menu-header {
    padding: 0 0;
  }

  .order-code {
    font-size: 24px;
  }
}
