:root {
  --ink: #24170f;
  --muted: #6b5c4f;
  --paper: #fff8ed;
  --cream: #f7ead5;
  --coffee: #4b2818;
  --coffee-2: #7a4a2b;
  --leaf: #486f2d;
  --gold: #c99146;
  --line: rgba(75, 40, 24, 0.16);
  --shadow: 0 18px 50px rgba(36, 23, 15, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fffaf1 0%, #f8ebd8 46%, #fffaf1 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(16px, 4vw, 48px);
  background: rgba(255, 248, 237, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--coffee);
  text-decoration: none;
  font-weight: 800;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a,
.nav-admin {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--coffee);
  background: transparent;
  text-decoration: none;
  font-weight: 700;
}

.nav a:hover,
.nav-admin:hover {
  background: rgba(122, 74, 43, 0.1);
}

.hero {
  position: relative;
  min-height: min(720px, calc(100vh - 72px));
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: clamp(24px, 6vw, 72px);
}

.hero-media,
.hero-shade {
  position: absolute;
  inset: 0;
}

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

.hero-shade {
  background:
    linear-gradient(90deg, rgba(31, 19, 12, 0.82), rgba(31, 19, 12, 0.34) 55%, rgba(31, 19, 12, 0.1)),
    linear-gradient(0deg, rgba(31, 19, 12, 0.5), transparent 52%);
}

.hero-content {
  position: relative;
  width: min(720px, 100%);
  color: white;
  padding-bottom: 26px;
}

.eyebrow,
.section-title p,
.cart-header p,
.admin-top p {
  margin: 0 0 8px;
  color: var(--gold);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
}

.hero h1,
.section-title h2,
.cart-header h2,
.admin-top h1,
.admin-top h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 800;
}

.hero h1 {
  font-size: clamp(3.2rem, 9vw, 7.5rem);
  line-height: 0.92;
}

.hero-text {
  max-width: 560px;
  margin: 18px 0 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-link,
.secondary-link,
.checkout-button,
.admin-login button,
.admin-actions button,
.item-bottom button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 800;
  text-decoration: none;
}

.primary-link,
.checkout-button,
.admin-login button,
.item-bottom button {
  color: #fffaf1;
  background: var(--leaf);
}

.secondary-link,
.admin-actions button {
  color: var(--coffee);
  background: #fff8ed;
}

.toolbar {
  position: sticky;
  top: 69px;
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 14px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: rgba(255, 250, 241, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.category-tabs button {
  flex: 0 0 auto;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--coffee);
  background: white;
  font-weight: 800;
}

.category-tabs button.active {
  color: white;
  background: var(--coffee);
  border-color: var(--coffee);
}

.menu-section,
.gallery-section,
.cart-panel {
  padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px);
}

.section-title {
  margin-bottom: 22px;
}

.section-title h2,
.cart-header h2,
.admin-top h1,
.admin-top h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.menu-card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(75, 40, 24, 0.08);
}

.item-category {
  margin: 0 0 8px;
  color: var(--leaf);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.menu-card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.32;
}

.item-desc {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.item-bottom strong {
  color: var(--coffee);
  font-size: 1.08rem;
}

.cart-panel {
  margin: 0 clamp(16px, 4vw, 48px) clamp(24px, 5vw, 56px);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.cart-header,
.cart-row,
.checkout-total,
.admin-top,
.order-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cart-header {
  margin-bottom: 18px;
}

.cart-header strong {
  color: white;
  background: var(--coffee);
  border-radius: 999px;
  padding: 8px 12px;
}

.cart-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.cart-row {
  padding: 12px;
  background: var(--paper);
  border-radius: 8px;
}

.cart-row h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.cart-row p {
  margin: 0;
  color: var(--muted);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-controls button,
.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--coffee);
  background: white;
  font-weight: 900;
}

.checkout-form {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--coffee);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fffdf8;
}

textarea {
  resize: vertical;
}

.address-field {
  display: none;
}

.address-field.visible {
  display: grid;
}

.checkout-total {
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  font-size: 1.35rem;
  font-weight: 800;
}

.checkout-button {
  width: 100%;
  font-size: 1rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.gallery img {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(22, 14, 9, 0.72);
}

.admin-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.92), rgba(247, 234, 213, 0.94)),
    url("assets/fachada-cafe-vilena.jpeg") center/cover fixed;
}

.admin-screen {
  min-height: 100vh;
  display: grid;
  align-items: start;
  padding: clamp(14px, 4vw, 38px);
}

.admin-panel {
  width: min(1180px, 100%);
  max-height: 92vh;
  overflow: auto;
  justify-self: center;
  padding: clamp(18px, 4vw, 28px);
  background: #fffaf1;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-login {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin-top: 18px;
}

.admin-login small {
  color: var(--muted);
}

.admin-content {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--coffee);
  font-size: 1.45rem;
}

.orders-board {
  display: grid;
  gap: 12px;
}

.order-card {
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-title h3 {
  margin: 0;
}

.order-title p,
.order-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.order-items {
  margin: 12px 0;
  padding-left: 18px;
}

.order-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 10px;
  color: white;
  background: var(--coffee-2);
  font-weight: 800;
  font-size: 0.8rem;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .form-grid,
  .gallery,
  .metrics,
  .order-controls {
    grid-template-columns: 1fr;
  }

  .toolbar {
    top: 117px;
  }

  .hero {
    min-height: 640px;
  }

  .cart-panel {
    margin-inline: 12px;
  }
}

@media (max-width: 520px) {
  .brand img {
    width: 42px;
    height: 42px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .hero {
    padding-inline: 18px;
  }

  .hero-actions a {
    width: 100%;
    text-align: center;
  }

  .cart-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
