/*
  Restaurante Casa Grande - Historic fine dining mansion
  Barva, Heredia, Costa Rica
  Cuisine type: Fine dining costarricense / historic upscale
  Palette: Heritage Manor - emerald + antique gold + warm parchment
  Fonts: Prata (heading) + Inter (body)
  Mood: heritage, elegance, romance, candlelit garden, historic luxury
  Design style: D (Apple Dramatic, photo-led) + refined premium touches
*/

:root {
  --color-primary: #234E3C;
  --color-primary-dark: #17382A;
  --color-primary-light: #3A6B56;
  --color-gold: #C7A25A;
  --color-gold-light: #E2C988;
  --color-gold-dark: #9E7F3E;
  --color-bg: #F5EEDB;
  --color-bg-warm: #EFE6D0;
  --color-bg-card: #FFFFFF;
  --color-bg-dark: #0D1F18;
  --color-bg-darker: #081811;
  --color-surface: #FAF4E3;
  --color-text: #1A1F1C;
  --color-text-muted: #6B7265;
  --color-text-inv: #F5EEDB;
  --color-border: rgba(26, 31, 28, 0.1);
  --color-border-gold: rgba(199, 162, 90, 0.3);

  --shadow-sm: 0 2px 8px rgba(35, 78, 60, 0.06);
  --shadow-md: 0 10px 30px rgba(35, 78, 60, 0.1);
  --shadow-lg: 0 24px 60px rgba(35, 78, 60, 0.15);
  --shadow-xl: 0 40px 100px rgba(35, 78, 60, 0.2);
  --shadow-gold: 0 10px 40px rgba(199, 162, 90, 0.3);
}

* { -webkit-tap-highlight-color: transparent; }
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.font-heading { font-family: 'Prata', Georgia, serif; letter-spacing: -0.01em; }
.font-body { font-family: 'Inter', system-ui, sans-serif; }

/* ===== DECORATIVE ELEMENTS ===== */

/* Ornamental divider - thin gold line with center mark */
.divider-ornate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--color-gold);
}
.divider-ornate::before,
.divider-ornate::after {
  content: '';
  height: 1px;
  width: 60px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}
.divider-ornate svg { width: 14px; height: 14px; opacity: 0.7; }

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
}

/* Gold gradient text */
.gold-text {
  background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 50%, var(--color-gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Dot grid background */
.dot-grid {
  background-image: radial-gradient(rgba(35, 78, 60, 0.1) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Subtle paper grain */
.grain {
  position: relative;
}
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
}

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  padding: 14px 28px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
  white-space: nowrap;
}

/* Primary: emerald filled, elegant shadow */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inv);
  box-shadow: 0 10px 24px rgba(35, 78, 60, 0.28);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(35, 78, 60, 0.38);
}

/* Gold outline - for hero secondary actions */
.btn-gold-outline {
  background: transparent;
  color: var(--color-gold-light);
  border: 1px solid var(--color-gold-light);
}
.btn-gold-outline:hover {
  background: var(--color-gold);
  color: var(--color-bg-darker);
  border-color: var(--color-gold);
}

/* Gold filled */
.btn-gold {
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
  color: var(--color-bg-darker);
  box-shadow: 0 10px 24px rgba(199, 162, 90, 0.35);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(199, 162, 90, 0.5);
  filter: brightness(1.05);
}

/* Ghost (outline on bg) */
.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-ghost:hover {
  background: var(--color-primary);
  color: var(--color-text-inv);
}

.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-lg { padding: 18px 36px; font-size: 16px; }

/* ===== HEADER ===== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
  padding: 20px 0;
}
.site-header.scrolled {
  background: rgba(245, 238, 219, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(35, 78, 60, 0.06);
  padding: 12px 0;
}
.site-header .nav-link {
  color: var(--color-text-inv);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s ease;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.site-header.scrolled .nav-link {
  color: var(--color-text);
  text-shadow: none;
}
.site-header .nav-link:hover { color: var(--color-gold); }

.site-header .brand-name {
  color: var(--color-text-inv);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.site-header.scrolled .brand-name {
  color: var(--color-text);
  text-shadow: none;
}

/* ===== HERO ===== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 31, 24, 0.5) 0%, rgba(13, 31, 24, 0.35) 35%, rgba(13, 31, 24, 0.75) 75%, rgba(8, 24, 17, 0.92) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-title {
  font-family: 'Prata', Georgia, serif;
  color: var(--color-text-inv);
  font-size: clamp(2.75rem, 7vw, 5.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
}

.hero-subtitle {
  color: rgba(245, 238, 219, 0.92);
  font-size: clamp(1.05rem, 1.6vw, 1.375rem);
  line-height: 1.5;
  max-width: 620px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(245, 238, 219, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(199, 162, 90, 0.3);
  color: var(--color-gold-light);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ===== SECTIONS ===== */

.section {
  position: relative;
  padding: 96px 0;
}
@media (max-width: 768px) {
  .section { padding: 72px 0; }
}

.section-dark {
  background: var(--color-bg-dark);
  color: var(--color-text-inv);
}
.section-dark .section-title { color: var(--color-text-inv); }
.section-dark .section-kicker { color: var(--color-gold-light); }
.section-dark .text-muted-adaptive { color: rgba(245, 238, 219, 0.72); }

.section-warm {
  background: var(--color-bg-warm);
}

.section-title {
  font-family: 'Prata', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--color-text);
}

.section-kicker {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
}

.text-muted-adaptive { color: var(--color-text-muted); }

/* ===== DISH CARDS ===== */

.dish-card {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow 0.4s ease;
}
.dish-card:hover {
  box-shadow: var(--shadow-lg);
}
.dish-card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.dish-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
}
.dish-card:hover .dish-card-img { transform: scale(1.08); }

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  background: var(--color-bg-card);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--color-border-gold);
}
.badge.badge-gold {
  background: var(--color-gold);
  color: var(--color-bg-darker);
  border-color: var(--color-gold);
}
.badge.badge-chef {
  background: var(--color-primary);
  color: var(--color-text-inv);
  border-color: var(--color-primary);
}

/* ===== REVIEW CARDS ===== */

.review-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}
.review-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.review-stars { color: var(--color-gold); letter-spacing: 2px; }

/* ===== GALLERY ===== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}
.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: block;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(13, 31, 24, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item:hover::after { background: rgba(13, 31, 24, 0.25); }

/* ===== COUNTERS ===== */

.counter-value {
  font-family: 'Prata', Georgia, serif;
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 1;
  color: var(--color-gold);
}

/* ===== FOOTER ===== */

.site-footer {
  background: var(--color-bg-darker);
  color: rgba(245, 238, 219, 0.8);
  padding: 72px 0 32px;
}
.site-footer h4 { color: var(--color-gold-light); font-family: 'Prata', Georgia, serif; font-size: 20px; margin-bottom: 16px; }
.site-footer a { color: rgba(245, 238, 219, 0.7); transition: color 0.2s ease; }
.site-footer a:hover { color: var(--color-gold); }

/* ===== ANIMATIONS ===== */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(199, 162, 90, 0.5); }
  50% { box-shadow: 0 0 0 16px rgba(199, 162, 90, 0); }
}

/* ===== MOBILE MENU (drawer) ===== */

.mobile-drawer {
  position: fixed;
  inset: 0;
  background: var(--color-bg-darker);
  z-index: 100;
  padding: 32px 24px;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer a {
  color: var(--color-text-inv);
  font-family: 'Prata', Georgia, serif;
  font-size: 32px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(199, 162, 90, 0.15);
  display: block;
}
.mobile-drawer a:hover { color: var(--color-gold); }

/* ===== STICKY CTA (mobile) ===== */

.sticky-cta {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: #25D366;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  animation: pulse-gold 2.5s infinite;
}
@media (max-width: 768px) {
  .sticky-cta { display: inline-flex; }
}

/* ===== MENU PAGE SPECIFIC ===== */

.menu-hero {
  position: relative;
  padding: 120px 0 56px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-text-inv);
  overflow: hidden;
}
.menu-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 70%;
  height: 160%;
  background: radial-gradient(circle, rgba(199, 162, 90, 0.25), transparent 70%);
  pointer-events: none;
}

.cat-nav {
  position: sticky;
  top: 58px;
  z-index: 30;
  background: rgba(245, 238, 219, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}
.cat-nav-inner {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  overflow: visible;
  padding: 12px 0;
}
@media (max-width: 640px) {
  .cat-nav-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .cat-nav-inner::-webkit-scrollbar { display: none; }
}
.cat-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cat-btn:hover {
  background: rgba(35, 78, 60, 0.06);
}
.cat-btn.active {
  background: var(--color-primary);
  color: var(--color-text-inv);
  border-color: var(--color-primary);
}

.menu-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.menu-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-gold);
}
.menu-card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.menu-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.menu-card:hover .menu-card-img { transform: scale(1.05); }

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--color-primary);
  border-radius: 999px;
  padding: 4px;
}
.qty-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-text-inv);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  transition: background 0.2s ease;
}
.qty-btn:hover { background: rgba(255, 255, 255, 0.15); }
.qty-value {
  min-width: 32px;
  text-align: center;
  font-weight: 600;
  color: var(--color-text-inv);
  font-size: 15px;
}

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--color-primary);
  color: var(--color-text-inv);
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.add-btn:hover { background: var(--color-primary-dark); transform: translateY(-1px); }

/* Floating cart button */
.floating-cart {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 45;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: var(--color-primary);
  color: var(--color-text-inv);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(35, 78, 60, 0.45);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.floating-cart:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(35, 78, 60, 0.6);
}
.floating-cart.visible { display: inline-flex; animation: cartSlideUp 0.4s ease; }

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

.floating-cart .badge-count {
  background: var(--color-gold);
  color: var(--color-bg-darker);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

/* ===== MODAL ===== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 24, 17, 0.85);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-body {
  background: var(--color-bg-card);
  max-width: 420px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
.modal-backdrop.open .modal-body { transform: scale(1); }

/* ===== CART PAGE ===== */

.cart-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--color-border);
  align-items: center;
}
.cart-item:first-of-type { border-top: none; }
.cart-item-img {
  width: 96px;
  height: 96px;
  object-fit: cover;
}
@media (max-width: 640px) {
  .cart-item { grid-template-columns: 72px 1fr; gap: 12px; }
  .cart-item-img { width: 72px; height: 72px; }
  .cart-item .cart-controls { grid-column: span 2; justify-self: start; margin-top: 8px; }
}

/* ===== ORDER PAGE (waiter) ===== */

.order-page {
  background: var(--color-bg);
  min-height: 100vh;
  padding: 48px 20px;
}
.order-wrap {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(35, 78, 60, 0.08);
}
@media (max-width: 480px) {
  .order-wrap { padding: 32px 24px; }
  .order-page { padding: 24px 12px; }
}
.order-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  gap: 20px;
}
.order-line + .order-line {
  border-top: 1px solid var(--color-border);
}
.order-qty { font-weight: 600; color: var(--color-gold-dark); min-width: 40px; }
.order-name { flex: 1; }
.order-price { font-variant-numeric: tabular-nums; font-weight: 500; }

@media print {
  .no-print { display: none !important; }
  body { background: white !important; }
  .order-wrap { box-shadow: none !important; padding: 20px !important; }
}

/* Utility */
.container-narrow { max-width: 1160px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.container-wide { max-width: 1320px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.cursor-pointer { cursor: pointer; }
