/* ===== 3mH Food — Modern Food E-commerce Styles ===== */

:root {
  --primary: #e85d04;
  --primary-dark: #d00000;
  --primary-light: #fff3e6;
  --secondary: #2d6a4f;
  --secondary-light: #d8f3dc;
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
  --header-height: 96px;
  --font: 'Cairo', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden { display: none !important; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-full { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 16px; }

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  direction: ltr;
  padding-left: calc(var(--header-height) + 12px);
  padding-right: calc(var(--header-height) + 12px);
}

.logo {
  position: absolute;
  left: 0;
  top: 0;
  height: var(--header-height);
  width: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.logo-img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;
  filter: none;
}

.search-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 15px;
  outline: none;
}

.search-btn {
  background: var(--primary);
  border: none;
  color: white;
  padding: 10px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.lang-btn {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--header-height);
  height: var(--header-height);
  background: var(--surface);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.lang-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.lang-icon {
  display: block;
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.cart-btn {
  position: relative;
  background: var(--primary-light);
  border: none;
  color: var(--primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.cart-btn:hover {
  background: var(--primary);
  color: white;
}

.budget-filter-wrap {
  position: relative;
}

.budget-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  background: var(--bg);
  border-radius: 50px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.budget-btn:hover,
.budget-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.budget-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  z-index: 150;
}

.budget-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.budget-panel-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.budget-close {
  width: 32px;
  height: 32px;
}

.budget-range-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-bottom: 16px;
}

.budget-slider-group {
  margin-bottom: 14px;
}

.budget-slider-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.budget-slider {
  width: 100%;
  height: 6px;
  accent-color: var(--primary);
  cursor: pointer;
}

.budget-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.budget-inputs input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.budget-inputs input:focus {
  outline: none;
  border-color: var(--primary);
}

.budget-separator {
  color: var(--text-muted);
  font-weight: 700;
}

.budget-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-count {
  position: absolute;
  top: -4px;
  inset-inline-start: -4px;
  background: var(--primary-dark);
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  background-size: 200% 200%;
  color: white;
  padding: 48px 0;
  animation: heroGradientShift 8s ease-in-out infinite;
}

.hero-content h1,
.hero-content p,
.hero-stats .stat {
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeUp 0.7s ease forwards;
}

.hero-content h1 {
  animation-delay: 0.1s;
}

.hero-content h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-content p {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 28px;
  animation-delay: 0.25s;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.hero-stats .stat:nth-child(1) { animation-delay: 0.4s; }
.hero-stats .stat:nth-child(2) { animation-delay: 0.55s; }
.hero-stats .stat:nth-child(3) { animation-delay: 0.7s; }

.stat strong {
  font-size: 24px;
  font-weight: 800;
}

.stat span {
  font-size: 13px;
  opacity: 0.8;
}

@keyframes heroGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero {
    animation: none;
  }

  .hero-content h1,
  .hero-content p,
  .hero-stats .stat {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ===== Categories ===== */
.categories-section {
  padding: 24px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-height);
  z-index: 50;
}

.categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar { display: none; }

.category-btn {
  flex-shrink: 0;
  padding: 10px 20px;
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: 50px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}

.category-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ===== Products ===== */
.main {
  padding: 32px 0 60px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
}

.product-count {
  color: var(--text-muted);
  font-size: 14px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.pagination-btn:hover:not(:disabled):not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-arrow {
  padding: 0 16px;
}

.pagination-info {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
  user-select: none;
}

/* ===== Login Gate ===== */
body.login-locked {
  overflow: hidden;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 16px;
}

.login-card h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}

.auth-form {
  text-align: start;
}

.auth-form .form-group {
  margin-bottom: 14px;
}

.login-error {
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.login-switch {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.login-switch-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-inline-start: 4px;
}

.login-switch-btn:hover {
  text-decoration: underline;
}

.user-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 4px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.logout-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

.cart-special-request {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.cart-special-request label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.cart-special-request textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
}

.cart-special-request textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.review-section {
  max-width: 420px;
  margin: 28px auto;
  padding: 24px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  text-align: center;
}

.review-section h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.review-section p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.star-rating {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--border);
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
  padding: 0;
  line-height: 1;
}

.star-btn:hover,
.star-btn.active {
  color: #f59e0b;
  transform: scale(1.1);
}

.review-section textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  margin-bottom: 14px;
  resize: vertical;
}

.review-section textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.review-thanks {
  margin: 24px 0;
  color: var(--primary);
  font-weight: 700;
  font-size: 18px;
}

.orders-card {
  max-width: 900px;
  margin: 0 auto;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--bg);
  transition: border-color var(--transition);
}

.order-card.delivered {
  border-color: var(--secondary);
  background: var(--secondary-light);
}

.order-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.order-card-header h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.order-date {
  font-size: 13px;
  color: var(--text-muted);
}

.order-status {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 50px;
  white-space: nowrap;
}

.status-pending {
  background: var(--primary-light);
  color: var(--primary);
}

.status-delivered {
  background: var(--secondary-light);
  color: var(--secondary);
}

.order-customer {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.order-customer p {
  margin-bottom: 4px;
}

.order-user {
  font-size: 13px;
}

.order-items-list {
  list-style: none;
  font-size: 14px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
}

.order-items-list li {
  padding: 4px 0;
}

.order-special {
  font-size: 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--primary-light);
  border-radius: var(--radius);
}

.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.order-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.order-review {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 14px;
}

.review-stars {
  color: #f59e0b;
  font-size: 18px;
  margin: 0 8px;
}

.order-review p {
  margin-top: 6px;
  color: var(--text-muted);
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.product-image {
  height: 160px;
  background: linear-gradient(135deg, var(--primary-light), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  position: relative;
}

.product-badge {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  background: var(--secondary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
}

.product-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.product-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.product-price small {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.add-to-cart {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.product-open-btn {
  flex-shrink: 0;
}

/* Product modal */
.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.product-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: min(480px, 100%);
  max-height: min(90vh, 720px);
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.product-modal-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 2;
}

.product-modal-hero {
  height: 180px;
  background: linear-gradient(135deg, var(--primary-light), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 88px;
}

.product-modal-body {
  padding: 24px;
}

.product-modal-body h2 {
  font-size: 22px;
  margin: 8px 0 6px;
}

.product-modal-body p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.product-modal-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
}

.product-modal-price small {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.variation-group {
  margin-bottom: 16px;
}

.variation-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.variation-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variation-option {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 50px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}

.variation-option:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.variation-option.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.product-modal-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.product-modal-qty label {
  font-weight: 700;
  font-size: 14px;
}

.cart-item-variations,
.order-item-variations {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.order-item-info .order-item-variations {
  display: block;
  margin-top: 2px;
}

.qty-control {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 50px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  color: var(--primary);
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: var(--primary-light);
}

.qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.qty-value {
  width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}

.add-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.add-btn:hover {
  background: var(--primary-dark);
}

/* ===== Cart Sidebar ===== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

[dir="rtl"] .cart-sidebar {
  left: 0;
  transform: translateX(-100%);
}

[dir="ltr"] .cart-sidebar {
  right: 0;
  transform: translateX(100%);
}

.cart-sidebar.active {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.close-btn {
  background: var(--bg);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.close-btn:hover {
  background: var(--border);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-emoji {
  font-size: 40px;
  width: 56px;
  height: 56px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.cart-item-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.cart-item .qty-control {
  transform: scale(0.9);
  transform-origin: inline-end center;
}

.remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 500;
}

.remove-btn:hover {
  text-decoration: underline;
}

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.cart-empty .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.cart-summary {
  margin-bottom: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.summary-row.total {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  border-top: 2px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 20px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Footer ===== */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 32px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: white;
  font-size: 18px;
}

.footer-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}

.footer-hotline {
  margin-top: 8px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

/* ===== Admin ===== */
.admin-main {
  padding: 40px 0 60px;
}

.admin-header {
  margin-bottom: 32px;
}

.admin-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.admin-header p {
  color: var(--text-muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.admin-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.admin-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  transition: border-color var(--transition);
  background: var(--surface);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emoji-btn {
  width: 44px;
  height: 44px;
  font-size: 22px;
  border: 2px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.emoji-btn:hover,
.emoji-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.admin-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
}

.admin-products-list {
  max-height: 500px;
  overflow-y: auto;
}

.admin-product-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: background var(--transition);
}

.admin-product-item:hover {
  background: var(--bg);
}

.admin-product-emoji {
  font-size: 32px;
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-product-info {
  flex: 1;
  min-width: 0;
}

.admin-product-info h4 {
  font-size: 15px;
  font-weight: 600;
}

.admin-product-info span {
  font-size: 13px;
  color: var(--text-muted);
}

.admin-product-price {
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
}

.admin-product-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 16px;
}

.icon-btn:hover {
  background: var(--bg);
}

.icon-btn.delete:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
}

/* ===== Checkout ===== */
.checkout-main {
  padding: 40px 0 60px;
}

.checkout-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 15px;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.step-label {
  white-space: nowrap;
  line-height: 1.3;
}

.step.active {
  color: var(--primary);
}

.step.active .step-number {
  background: var(--primary);
  color: white;
}

.step.active .step-label {
  color: var(--primary);
}

.step-line {
  width: 60px;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: start;
}

.checkout-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.checkout-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-option input {
  display: none;
}

.payment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.payment-card span:first-child {
  font-size: 28px;
}

.payment-card strong {
  display: block;
  font-size: 14px;
}

.payment-card small {
  color: var(--text-muted);
  font-size: 12px;
}

.payment-option input:checked + .payment-card {
  border-color: var(--primary);
  background: var(--primary-light);
}

.order-summary {
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.order-items {
  margin-bottom: 16px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.order-item-emoji {
  font-size: 28px;
}

.order-item-info {
  flex: 1;
}

.order-item-info span {
  color: var(--text-muted);
  font-size: 12px;
}

.order-item-total {
  font-weight: 700;
  color: var(--primary);
}

.order-totals {
  padding-top: 8px;
}

.order-success {
  text-align: center;
  padding: 60px 20px;
}

.success-icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.order-success h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}

.order-success p {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.success-note {
  margin-bottom: 28px !important;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .admin-grid,
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: static;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px calc(var(--header-height) + 8px) 12px calc(var(--header-height) + 8px);
    height: auto;
  }

  .header {
    height: auto;
    min-height: var(--header-height);
  }

  .logo {
    height: var(--header-height);
    width: var(--header-height);
  }

  .search-bar {
    order: 2;
    flex: 1 1 100%;
    width: 100%;
  }

  .admin-link span,
  .nav-link span,
  .budget-btn span {
    display: none;
  }

  .budget-panel {
    width: min(300px, calc(100vw - 32px));
    right: -8px;
  }

  .hero {
    padding: 32px 0;
  }

  .hero-stats {
    gap: 20px;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .pagination {
    gap: 8px;
    margin-top: 28px;
  }

  .pagination-info {
    width: 100%;
    text-align: center;
    order: 3;
  }

  .pagination-arrow {
    flex: 1;
  }

  .product-image {
    height: 120px;
    font-size: 52px;
  }

  .product-name {
    font-size: 15px;
  }

  .product-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .add-to-cart {
    justify-content: space-between;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .cart-sidebar {
    width: 100vw;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
