/* ==================================================
   Ebi Food - Marketplace UI
   HTML5 + CSS3 + Vanilla JavaScript + Supabase
   ================================================== */

:root {
  --green-900: #0a5c3a;
  --green-800: #0d7448;
  --green-700: #10945a;
  --green-600: #14b86a;
  --green-500: #24cf7c;
  --green-100: #e9fff3;
  --orange-700: #d85e08;
  --orange-600: #ff7b1a;
  --orange-500: #ff9639;
  --orange-100: #fff1df;
  --red-600: #e5484d;
  --yellow-500: #ffbf3f;
  --gray-950: #17211b;
  --gray-900: #1f2c25;
  --gray-800: #34423a;
  --gray-700: #526158;
  --gray-500: #879189;
  --gray-300: #dfe6e1;
  --gray-200: #edf1ee;
  --gray-100: #f6f8f7;
  --white: #ffffff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --text: #17211b;
  --muted: #66736a;
  --border: rgba(23, 33, 27, 0.1);
  --shadow-sm: 0 10px 24px rgba(21, 48, 34, 0.08);
  --shadow-md: 0 18px 46px rgba(21, 48, 34, 0.12);
  --shadow-lg: 0 30px 80px rgba(21, 48, 34, 0.16);
  --radius: 8px;
  --radius-sm: 6px;
  --navbar-height: 82px;
  --transition: 180ms ease;
}

body.dark {
  --green-100: #123425;
  --orange-100: #3a2615;
  --gray-100: #111815;
  --gray-200: #1a241f;
  --gray-300: #2d3932;
  --surface: rgba(24, 34, 29, 0.82);
  --surface-strong: rgba(25, 35, 30, 0.96);
  --text: #eef7f1;
  --muted: #b4c1b9;
  --border: rgba(238, 247, 241, 0.12);
  --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 20px 46px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.34);
  background: #101713;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 6%, rgba(20, 184, 106, 0.12), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(255, 123, 26, 0.12), transparent 26%),
    linear-gradient(180deg, #fbfefc 0%, var(--gray-100) 100%);
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.particle-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(20, 184, 106, 0.14) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(255, 123, 26, 0.13) 0 2px, transparent 3px);
  background-position: 0 0, 30px 38px;
  background-size: 92px 92px;
  animation: particleDrift 20s linear infinite;
  opacity: 0.65;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--navbar-height);
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 14px 6%;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
}

body.dark .navbar {
  background: rgba(17, 24, 20, 0.82);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand img {
  width: 46px;
  height: 46px;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.05;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.nav-search i {
  position: absolute;
  left: 16px;
  color: var(--green-700);
}

.nav-search input {
  width: 100%;
  height: 48px;
  padding: 0 18px 0 44px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: border var(--transition), box-shadow var(--transition), transform var(--transition);
}

.nav-search input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(20, 184, 106, 0.55);
  box-shadow: 0 0 0 4px rgba(20, 184, 106, 0.12);
}

.nav-menu {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.nav-menu a,
.admin-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  color: var(--gray-800);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

body.dark .nav-menu a,
body.dark .admin-nav a {
  color: var(--muted);
}

.nav-menu a:hover,
.admin-nav a:hover,
.admin-nav a.active {
  color: var(--green-800);
  background: rgba(20, 184, 106, 0.1);
}

.cart-link {
  position: relative;
}

.cart-link span,
.floating-cart span {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  color: #fff;
  background: var(--orange-600);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border var(--transition), background var(--transition);
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 106, 0.35);
}

main {
  width: 100%;
}

.hero-section {
  width: min(1180px, 90%);
  min-height: calc(100vh - var(--navbar-height));
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: 44px;
  margin: 0 auto;
  padding: 54px 0 70px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--orange-700);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: 54px;
  line-height: 1.05;
  font-weight: 800;
}

.hero-copy p {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

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

.btn {
  position: relative;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  box-shadow: 0 12px 28px rgba(20, 184, 106, 0.28);
}

.btn-soft {
  color: var(--green-800);
  background: rgba(20, 184, 106, 0.1);
  border: 1px solid rgba(20, 184, 106, 0.18);
}

.btn-warning {
  color: #fff;
  background: linear-gradient(135deg, var(--orange-700), var(--orange-500));
}

.btn-danger {
  color: #fff;
  background: var(--red-600);
}

.btn-ghost {
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.btn.full {
  width: 100%;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.ripple {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 520ms ease-out forwards;
}

.hero-visual {
  position: relative;
  min-height: 500px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
}

.hero-card-main {
  position: absolute;
  inset: 34px 28px 44px 0;
  display: grid;
  align-content: end;
  overflow: hidden;
}

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

.hero-card-main > div {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
}

body.dark .hero-card-main > div {
  background: rgba(19, 28, 23, 0.8);
}

.hero-card-main strong,
.hero-card-main span {
  display: block;
}

.hero-card-main span {
  color: var(--orange-700);
  font-weight: 800;
}

.hero-mini-card {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-weight: 800;
  animation: floatY 4s ease-in-out infinite;
}

.hero-mini-card i {
  color: var(--orange-600);
}

.hero-mini-card.top {
  top: 0;
  right: 4px;
}

.hero-mini-card.bottom {
  bottom: 12px;
  left: 28px;
  animation-delay: 900ms;
}

.section {
  width: min(1180px, 90%);
  margin: 0 auto;
  padding: 38px 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-head.align-top {
  align-items: flex-start;
}

.section-head.small {
  margin-bottom: 16px;
}

.section-head h1,
.section-head h2,
.page-title h1,
.auth-card h2,
.admin-topbar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
}

.section-head.small h2 {
  font-size: 22px;
}

.slider-actions {
  display: flex;
  gap: 8px;
}

.promo-slider {
  overflow: hidden;
}

.promo-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 390px);
  gap: 16px;
  overflow-x: auto;
  padding: 3px 2px 16px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.promo-card {
  min-height: 180px;
  display: grid;
  grid-template-columns: 1fr 142px;
  gap: 16px;
  padding: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--green-700), #23c579 58%, var(--orange-500));
  border-radius: var(--radius);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.promo-card h3 {
  margin: 5px 0 8px;
  font-size: 22px;
  line-height: 1.2;
}

.promo-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.55;
}

.promo-card strong {
  display: block;
  margin-top: 12px;
  font-size: 20px;
}

.promo-card img {
  width: 142px;
  height: 142px;
  align-self: center;
  object-fit: cover;
  border: 5px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  transform: rotate(3deg);
}

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

.category-card {
  display: grid;
  gap: 10px;
  min-height: 124px;
  padding: 16px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border var(--transition);
}

.category-card:hover,
.product-card:hover,
.cart-item:hover,
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(20, 184, 106, 0.26);
}

.category-card i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: var(--radius);
  font-size: 18px;
}

.category-card strong {
  font-size: 15px;
}

.category-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 760px;
}

select,
input,
textarea {
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
}

select,
input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 100px;
  padding: 12px;
  resize: vertical;
}

.toggle-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
}

.toggle-pill input {
  width: 16px;
  min-height: auto;
  accent-color: var(--green-700);
}

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

.product-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border var(--transition);
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--green-100);
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 360ms ease;
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.06);
}

.wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--red-600);
  background: rgba(255, 255, 255, 0.9);
}

.badge-row {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 62px);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.promo {
  background: var(--orange-600);
}

.badge.best {
  background: var(--green-700);
}

.badge.empty {
  background: var(--red-600);
}

.product-info {
  display: grid;
  gap: 8px;
  padding: 14px;
  flex: 1;
}

.product-category {
  color: var(--green-700);
  font-size: 12px;
  font-weight: 800;
}

.product-card h3 {
  min-height: 45px;
  margin: 0;
  font-size: 16px;
  line-height: 1.38;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-meta i {
  color: var(--yellow-500);
}

.product-price {
  color: var(--green-800);
  font-size: 19px;
  font-weight: 900;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: auto;
}

.load-sentinel {
  display: grid;
  place-items: center;
  min-height: 86px;
}

.skeleton-card {
  min-height: 342px;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.skeleton-line,
.skeleton-img {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--gray-200), var(--gray-100), var(--gray-200));
  background-size: 220% 100%;
  animation: skeleton 1.35s ease-in-out infinite;
}

.skeleton-img {
  aspect-ratio: 4 / 3;
}

.skeleton-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.skeleton-line {
  height: 14px;
  border-radius: 999px;
}

.skeleton-line.short {
  width: 58%;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 16, 0.56);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(86vh, 820px);
  overflow-y: auto;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: modalIn 220ms ease-out;
}

.modal-close {
  position: sticky;
  top: 12px;
  float: right;
  z-index: 3;
  margin: 12px 12px 0 0;
}

.product-detail {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 22px;
  padding: 22px;
}

.product-detail-image {
  position: sticky;
  top: 18px;
  align-self: start;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--green-100);
}

.product-detail-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.detail-content h2 {
  margin: 0 38px 8px 0;
  font-size: 30px;
  line-height: 1.2;
}

.detail-description,
.detail-composition {
  color: var(--muted);
  line-height: 1.7;
}

.choice-group {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.choice-group h3 {
  margin: 0;
  font-size: 16px;
}

.topping-grid,
.spicy-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
  transition: border var(--transition), background var(--transition), transform var(--transition);
}

.choice-chip:hover {
  transform: translateY(-1px);
}

.choice-chip input {
  min-height: auto;
  accent-color: var(--green-700);
}

.choice-chip.active,
.choice-chip:has(input:checked) {
  border-color: rgba(20, 184, 106, 0.5);
  background: rgba(20, 184, 106, 0.11);
}

.qty-control {
  display: inline-grid;
  grid-template-columns: 42px 58px 42px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.qty-control button,
.qty-control span {
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--text);
  background: var(--surface-strong);
  font-weight: 900;
}

.detail-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(20, 184, 106, 0.12), rgba(255, 123, 26, 0.12));
  border-radius: var(--radius);
  font-weight: 800;
}

.detail-total strong {
  color: var(--green-800);
  font-size: 22px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-left: 5px solid var(--green-600);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: slideToast 220ms ease-out;
}

.toast.error {
  border-left-color: var(--red-600);
}

.toast.warning {
  border-left-color: var(--orange-600);
}

.floating-whatsapp,
.floating-cart,
.back-to-top {
  position: fixed;
  z-index: 45;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.floating-whatsapp {
  right: 20px;
  bottom: 92px;
  width: 54px;
  height: 54px;
  color: #fff;
  background: #25d366;
  font-size: 26px;
}

.floating-cart {
  right: 20px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  font-size: 22px;
}

.floating-cart span {
  position: absolute;
  top: -8px;
  right: -8px;
}

.back-to-top {
  right: 88px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  color: var(--green-800);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.fly-clone {
  position: fixed;
  z-index: 300;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  transition: transform 760ms cubic-bezier(.2, .8, .2, 1), opacity 760ms ease;
}

.footer {
  width: min(1180px, 90%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 50px auto 0;
  padding: 30px 0 44px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer strong {
  color: var(--text);
}

.footer p {
  max-width: 560px;
  margin: 8px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-weight: 800;
}

.page-shell {
  width: min(1180px, 90%);
  margin: 0 auto;
  padding: 42px 0 70px;
}

.page-title h1 {
  font-size: 36px;
}

.cart-layout,
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 22px;
}

.cart-list {
  display: grid;
  gap: 14px;
}

.cart-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border var(--transition);
}

.cart-item img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--green-100);
}

.cart-item h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.cart-detail {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.cart-price {
  display: grid;
  justify-items: end;
  align-content: space-between;
  gap: 12px;
}

.cart-price strong {
  color: var(--green-800);
  font-size: 18px;
}

.cart-summary {
  position: sticky;
  top: calc(var(--navbar-height) + 20px);
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.summary-row.total {
  padding-top: 14px;
  color: var(--text);
  border-top: 1px solid var(--border);
  font-size: 18px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 54px 18px;
  text-align: center;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-state.full-screen {
  min-height: 100vh;
  align-content: center;
  background: transparent;
  border: 0;
}

.empty-state h1,
.empty-state h2 {
  margin: 0;
}

.empty-state p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
}

.empty-illustration {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  color: var(--green-700);
  background: linear-gradient(135deg, var(--green-100), var(--orange-100));
  border-radius: var(--radius);
  font-size: 42px;
  animation: floatY 3.6s ease-in-out infinite;
}

.checkout-form,
.auth-card,
.admin-panel {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.checkout-form {
  padding: 18px;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.form-grid label > span,
.inline-form label > span {
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 800;
}

body.dark .form-grid label > span,
body.dark .inline-form label > span {
  color: var(--muted);
}

.span-2 {
  grid-column: 1 / -1;
}

.checkout-submit {
  align-self: end;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-layout {
  width: min(1040px, 92%);
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 22px;
  align-items: stretch;
}

.auth-showcase {
  position: relative;
  min-height: 560px;
  display: grid;
  align-content: end;
  padding: 34px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, rgba(10, 92, 58, 0.96), rgba(20, 184, 106, 0.84)), url("assets/background/hero-food.svg") center/cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.auth-showcase h1 {
  max-width: 610px;
  margin: 0;
  font-size: 40px;
  line-height: 1.15;
}

.auth-showcase p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.7;
}

.auth-brand {
  position: absolute;
  top: 28px;
  left: 28px;
  color: #fff;
}

.auth-brand small {
  color: rgba(255, 255, 255, 0.75);
}

.auth-card {
  align-self: center;
  padding: 24px;
}

.input-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.form-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--green-800);
  font-weight: 800;
}

.admin-body {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 22px;
  background: var(--surface-strong);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.admin-brand img {
  width: 42px;
  height: 42px;
}

.admin-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-nav a {
  justify-content: flex-start;
}

.admin-sidebar-footer {
  display: grid;
  gap: 10px;
}

.admin-main {
  min-width: 0;
  padding: 26px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-search {
  width: min(420px, 44vw);
}

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

.stat-card {
  display: grid;
  gap: 9px;
  padding: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border var(--transition);
}

.stat-card i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: var(--radius);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  font-size: 26px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.admin-panel {
  min-width: 0;
  padding: 18px;
}

.admin-panel + .admin-panel,
.admin-panel#productsAdmin {
  margin-top: 16px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 24px;
}

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

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-table td {
  font-size: 13px;
}

.admin-product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
}

.admin-product-cell img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--green-100);
}

.admin-row-actions {
  display: flex;
  gap: 8px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.pagination button.active {
  color: #fff;
  background: var(--green-700);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.mini-list {
  display: grid;
  gap: 9px;
}

.mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  background: rgba(20, 184, 106, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mini-item strong {
  font-size: 14px;
}

.mini-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-form {
  grid-template-columns: 1fr 1fr 130px auto;
  align-items: end;
  margin-bottom: 14px;
}

.admin-form-panel {
  width: min(780px, 100%);
  padding: 20px;
}

.form-toggle {
  justify-content: flex-start;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

@keyframes particleDrift {
  from {
    background-position: 0 0, 30px 38px;
  }
  to {
    background-position: 92px 92px, 122px 130px;
  }
}

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

@keyframes ripple {
  to {
    transform: translate(-50%, -50%) scale(18);
    opacity: 0;
  }
}

@keyframes skeleton {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 1120px) {
  .navbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nav-menu {
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-section,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .hero-section {
    padding-top: 36px;
  }

  .hero-visual {
    min-height: 420px;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-grid,
  .product-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cart-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }

  .admin-body {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto;
  }

  .admin-nav,
  .admin-sidebar-footer {
    grid-auto-flow: column;
    overflow-x: auto;
  }

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

@media (max-width: 780px) {
  .navbar {
    padding: 12px 4%;
  }

  .brand strong {
    font-size: 16px;
  }

  .admin-link span,
  .nav-menu a:not(.cart-link) {
    font-size: 13px;
  }

  .hero-section,
  .section,
  .page-shell,
  .footer {
    width: min(100% - 28px, 1180px);
  }

  .hero-copy h1 {
    font-size: 38px;
  }

  .hero-copy p {
    font-size: 15px;
  }

  .hero-visual {
    min-height: 340px;
  }

  .hero-card-main {
    inset: 24px 0 34px 0;
  }

  .section-head,
  .admin-panel-head,
  .admin-topbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-bar,
  .admin-actions,
  .admin-top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-bar select,
  .filter-bar .toggle-pill,
  .admin-actions select,
  .admin-actions .btn,
  .admin-search {
    width: 100%;
  }

  .category-grid,
  .product-grid,
  .product-grid.compact,
  .admin-grid,
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .product-detail {
    grid-template-columns: 1fr;
  }

  .product-detail-image {
    position: static;
  }

  .detail-content h2 {
    font-size: 24px;
  }

  .cart-item {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .cart-item img {
    width: 92px;
    height: 92px;
  }

  .cart-price {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    justify-items: start;
    align-items: center;
  }

  .form-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .auth-showcase {
    min-height: 430px;
  }

  .auth-showcase h1 {
    font-size: 32px;
  }
}

@media (max-width: 520px) {
  .hero-copy h1 {
    font-size: 32px;
  }

  .hero-actions,
  .hero-actions .btn,
  .page-title .btn {
    width: 100%;
  }

  .hero-mini-card {
    display: none;
  }

  .hero-card-main > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-grid,
  .product-grid,
  .product-grid.compact,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .promo-card {
    grid-template-columns: 1fr;
  }

  .promo-card img {
    width: 100%;
    height: 170px;
  }

  .modal {
    padding: 10px;
  }

  .product-detail {
    padding: 14px;
  }

  .floating-whatsapp {
    right: 14px;
    bottom: 84px;
  }

  .floating-cart {
    right: 14px;
    bottom: 18px;
  }

  .back-to-top {
    right: 82px;
    bottom: 18px;
  }

  .admin-main {
    padding: 16px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }
}
