/* =========================================================
   GOOD FOOD — MODERN UI
   Mobile-first / PWA-ready / drop-in replacement
   Keeps the existing HTML + JS class names intact.
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #2f8f45;
  --primary-dark: #237238;
  --primary-deep: #195d2d;
  --primary-light: #eaf7ed;
  --primary-soft: #f3faf4;

  --accent: #f4b740;
  --danger: #e05245;
  --danger-soft: #fff0ee;

  --ink: #18221b;
  --ink-2: #303a33;
  --muted: #778179;
  --muted-2: #a1aaa4;

  --surface: #ffffff;
  --surface-2: #f7f9f7;
  --surface-3: #f1f4f1;
  --line: #e7ece8;
  --line-strong: #dce4de;

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(24, 34, 27, 0.04);
  --shadow-sm: 0 4px 16px rgba(24, 34, 27, 0.06);
  --shadow: 0 10px 30px rgba(24, 34, 27, 0.08);
  --shadow-lg: 0 20px 55px rgba(24, 34, 27, 0.14);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 220ms;

  --content-max: 430px;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

html {
  background: #edf1ed;
  color-scheme: light;
}

body {
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(47, 143, 69, 0.09),
      transparent 34%
    ),
    #edf1ed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

button,
[role="button"] {
  -webkit-user-select: none;
  user-select: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(47, 143, 69, 0.18);
  color: var(--ink);
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cfd8d1;
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: #b8c4ba;
}

/* =========================================================
   APP
   ========================================================= */

.app-container {
  width: 100%;
  max-width: var(--content-max);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 70px rgba(24, 34, 27, 0.08);
}

/* Hidden H1 remains accessible to search engines without
   affecting layout. */
.seo-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =========================================================
   TOP BAR
   ========================================================= */

.topbar {
  max-height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(9px, env(safe-area-inset-top)) 10px 10px;
  background: rgba(47, 143, 69, 0.2);
  border-bottom: 1px solid rgba(231, 236, 232, 0.85);
  position: relative;
  z-index: 20;
}

.logo {
  opacity: 0.9;
  margin-top: 5px;
  width: auto;
  height: 110px;
  object-fit: contain;
  object-position: left center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.icon-btn,
.cart-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  background: rgb(47 143 69 / 15%);
  color: var(--ink-2);
  cursor: pointer;
  transition:
    background var(--duration) var(--ease-soft),
    color var(--duration) var(--ease-soft),
    transform var(--duration) var(--ease);
}

.icon-btn i,
.cart-btn i {
  font-size: 27px;
  line-height: 1;
}

.icon-btn:hover,
.cart-btn:hover {
  color: var(--primary);
}

.icon-btn:active,
.cart-btn:active {
  transform: scale(0.9);
  color: var(--primary-dark);
}

.balance-badge {
  min-height: 34px;
  display: none;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(47, 143, 69, 0.2);
  cursor: pointer;
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.balance-badge:hover {
  box-shadow: 0 7px 18px rgba(47, 143, 69, 0.26);
}

.balance-badge:active {
  transform: scale(0.95);
}

.cart-badge {
  position: absolute;
  top: 0px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #d5e9da;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  transform: translate(2px, -2px);
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
  flex-shrink: 0;
  padding: 10px 20px 5px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(255, 255, 255, 0.94)
    ),
    var(--surface);
}

.hero-title {
  max-width: 390px;
  font-size: clamp(18px, 1.2vw, 25px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.5px;
  color: #5e7164;
}

.hero-tagline {
  font-style: italic;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.3;
  letter-spacing: 0.5px;
}

/* =========================================================
   STATUS + SEARCH
   ========================================================= */

.banner-wrap {
  flex-shrink: 0;
  padding: 5px 10px 10px;
  background: var(--surface);
}

.banner {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border: 1px solid rgb(69 189 97 / 25%);
  border-radius: 25px;
  background: #e9f2eb;
  box-shadow: var(--shadow-xs);
  transition: background var(--duration) var(--ease-soft);
}

.banner:focus-within {
  border-color: rgb(69 189 97 / 50%);
  background: #fff;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #35b85a;
  box-shadow: 0 0 0 4px rgba(53, 184, 90, 0.1);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.status-dot.closed {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(224, 82, 69, 0.1);
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(0.88);
  }
}

.status-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-wrap {
  min-width: 0;
  flex: 1;
  display: none;
  align-items: center;
}

.search-input {
  width: 100%;
  min-width: 0;
  padding: 3px 5px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #195d2d;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.search-input::placeholder {
  color: var(--muted-2);
}

.search-btn,
.close-search-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  background: rgb(47 143 69 / 15%);
  color: var(--muted);
  cursor: pointer;
  transition:
    background var(--duration) var(--ease-soft),
    color var(--duration) var(--ease-soft),
    transform var(--duration) var(--ease);
}

.search-btn i,
.close-search-btn i {
  font-size: 20px;
}

.search-btn:hover,
.close-search-btn:hover {
  color: var(--primary);
}

.search-btn:active,
.close-search-btn:active {
  transform: scale(0.9);
}

.close-search-btn {
  display: none;
}

.banner.search-active .search-wrap {
  display: flex;
}

.banner.search-active .search-btn {
  display: none;
}

.banner.search-active .close-search-btn {
  display: inline-flex;
}

.banner.search-active .status-text,
.banner.search-active .status-dot {
  display: none;
}

/* =========================================================
   MAIN SCROLL AREA
   ========================================================= */

.main-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 10px 10px 0px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  background: rgb(47 143 69 / 10%);
}

.grid-view,
.cards-view,
.news-view,
.info-view {
  display: none;
  animation: view-in 280ms var(--ease);
}

.grid-view.active,
.cards-view.active,
.news-view.active,
.info-view.active {
  display: block;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   CATEGORIES
   ========================================================= */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0px 0 15px;
}

.category-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  isolation: isolate;
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 48%,
    rgba(20, 30, 22, 0.035)
  );
  opacity: 0;
  transition: opacity var(--duration) var(--ease-soft);
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: #dce7de;
  box-shadow: var(--shadow);
}

.category-card:hover::after {
  opacity: 1;
}

.category-card:active {
  transform: scale(0.975);
  box-shadow: var(--shadow-sm);
}

.category-card .category-image {
  width: 100%;
  height: 170px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  overflow: hidden;
}

.category-card .category-image img {
  opacity: 0.95;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.category-card:hover .category-image img {
  transform: scale(0.99);
}

.category-card .category-name {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 5px;
  color: #526156;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
}

/* =========================================================
   PRODUCTS
   ========================================================= */

.cards-header {
  border-radius: 25px;
  position: sticky;
  top: 0;
  /* z-index: 4; */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0px 10px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.93);
}

.cards-title {
  min-width: 0;
  overflow: hidden;
  color: #637065;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 35px;
  padding: 5px 15px;
  border-radius: var(--radius-pill);
  background: rgba(47, 143, 69, 0.25);
  color: #6e957a;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background var(--duration) var(--ease-soft),
    color var(--duration) var(--ease-soft),
    transform var(--duration) var(--ease);
}

.back-btn i {
  font-size: 20px;
}

.back-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.back-btn:active {
  transform: scale(0.95);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 24px;
}

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: #dce7de;
  box-shadow: var(--shadow);
}

.product-card:active {
  transform: scale(0.975);
}

.product-card .product-image {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-3), #eaf0eb);
}

.product-card .product-image img {
  opacity: 0.9;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(0.99);
}

.product-card .product-info {
  padding: 11px 12px 13px;
}

.product-card .product-name {
  margin-bottom: 5px;
  display: -webkit-box;
  overflow: hidden;
  color: #5c7463;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card .product-price {
  color: #7ed391;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

/* =========================================================
   NEWS
   ========================================================= */

.news-view,
.info-view {
  padding: 3px 0 22px;
}

.news-item {
  overflow: hidden;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.news-item:last-child {
  margin-bottom: 0;
}

.news-item .news-date {
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
}

.news-item .news-title {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.3;
}

.news-item .news-content {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 450;
  line-height: 1.6;
}

/* =========================================================
   INFO
   ========================================================= */

.info-content {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.info-content h2 {
  font-size: 15px !important;
  font-weight: 550 !important;
  line-height: 1.3;
}

.info-content p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 450;
  line-height: 1.75;
  white-space: pre-line;
}

.info-content .info-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.info-content .info-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition:
    background var(--duration) var(--ease-soft),
    transform var(--duration) var(--ease);
}

.info-content .info-links a:hover {
  background: #dff1e3;
}

.info-content .info-links a:active {
  transform: scale(0.96);
}

/* =========================================================
   BOTTOM NAV
   ========================================================= */

.bottom-menu {
  min-height: 66px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  padding: 7px 8px max(7px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(231, 236, 232, 0.9);
  background: rgba(255, 255, 255, 0.96);
  position: relative;
  z-index: 100;
  box-shadow: 0 -8px 25px rgba(24, 34, 27, 0.035);
}

.bottom-btn {
  min-width: 74px;
  min-height: 50px;
  display: inline-flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 5px;
  border-radius: 25px;
  background: transparent;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    color var(--duration) var(--ease-soft),
    background var(--duration) var(--ease-soft),
    transform var(--duration) var(--ease);
}

.bottom-btn i {
  font-size: 21px;
  line-height: 1;
}

.bottom-btn.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.bottom-btn:hover:not(.active) {
  background: var(--surface-2);
  color: var(--muted);
}

.bottom-btn:active {
  transform: scale(0.94);
}

.drawer-overlay,
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 17, 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  transition:
    opacity 0.2s ease,
    visibility 0s linear 0.3s;
}

.drawer-overlay.open,
.cart-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transition:
    opacity 0.2s ease,
    visibility 0s linear 0s;
}

.drawer,
.cart-drawer {
  width: 100%;
  max-width: var(--content-max);
  max-height: min(94dvh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);

  transform: translateY(100%);
  transition: transform 0.3s ease;
  will-change: transform;
}

.drawer-overlay.open .drawer,
.cart-overlay.open .cart-drawer {
  transform: translateY(0);
}

.drawer-handle {
  width: 42px;
  height: 4px;
  flex: 0 0 auto;
  margin: 10px auto 5px;
  border-radius: var(--radius-pill);
  background: #d5ddd7;
}

.drawer-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 16px 18px;
  -webkit-overflow-scrolling: touch;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0 11px;
}

.drawer-info {
  min-width: 0;
  flex: 1;
}

.drawer-title {
  color: var(--ink);
  font-size: 19px;
  font-weight: 750;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.drawer-sku {
  margin: 3px 0 5px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 550;
}

.drawer-price {
  color: var(--primary-dark);
  font-size: 21px;
  font-weight: 850;
  line-height: 1.2;
}

.drawer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.drawer-close-btn,
.drawer-share-btn,
.cart-close-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 21px;
  cursor: pointer;
  transition:
    background var(--duration) var(--ease-soft),
    color var(--duration) var(--ease-soft),
    transform var(--duration) var(--ease);
}

.drawer-close-btn:hover,
.drawer-share-btn:hover,
.cart-close-btn:hover {
  background: var(--surface-3);
  color: var(--ink-2);
}

.drawer-close-btn:active,
.drawer-share-btn:active,
.cart-close-btn:active {
  transform: scale(0.9);
}

.drawer-image {
  width: 100%;
  height: clamp(180px, 45vw, 235px);
  overflow: hidden;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface-3), #eaf0eb);
  color: var(--muted-2);
  font-size: 60px;
}

.drawer-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   PRODUCT OPTIONS
   ========================================================= */

.drawer-options {
  padding: 1px 0 5px;
}

.option-group {
  margin: 14px 0 18px;
}

.option-group:last-child {
  margin-bottom: 0;
}

.option-label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.3;
}

.option-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-choice {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition:
    border-color var(--duration) var(--ease-soft),
    background var(--duration) var(--ease-soft),
    color var(--duration) var(--ease-soft),
    transform var(--duration) var(--ease);
  user-select: none;
}

.option-choice:hover {
  border-color: #b8cfbd;
  background: var(--primary-soft);
}

.option-choice:active {
  transform: scale(0.96);
}

.option-choice.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px rgba(47, 143, 69, 0.06);
}

.option-choice .option-price {
  margin-left: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.option-choice.selected .option-price {
  color: var(--primary);
}

/* =========================================================
   PRODUCT FOOTER / CTA
   ========================================================= */

.drawer-footer {
  flex-shrink: 0;
  padding: 10px 16px max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 25px rgba(24, 34, 27, 0.045);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.add-btn,
.checkout-btn {
  width: 100%;
  min-height: 50px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 8px 20px rgba(47, 143, 69, 0.2);
  cursor: pointer;
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    filter var(--duration) var(--ease);
}

.add-btn:hover:not(.disabled),
.checkout-btn:hover:not(:disabled) {
  filter: brightness(1.025);
  box-shadow: 0 10px 24px rgba(47, 143, 69, 0.25);
}

.add-btn:active:not(.disabled),
.checkout-btn:active:not(:disabled) {
  transform: scale(0.985);
  box-shadow: 0 5px 14px rgba(47, 143, 69, 0.18);
}

.add-btn.disabled,
.checkout-btn:disabled {
  background: #dfe5e0;
  color: #9aa49d;
  box-shadow: none;
  cursor: not-allowed;
}

/* =========================================================
   CART
   ========================================================= */

.cart-header {
  min-height: 57px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 6px;
  border-bottom: 1px solid var(--line);
}

.cart-title {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  font-size: 19px;
  font-weight: 750;
}

.cart-clear-btn {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background var(--duration) var(--ease-soft),
    transform var(--duration) var(--ease);
}

.cart-clear-btn:hover {
  background: #ffe5e1;
}

.cart-clear-btn:active {
  transform: scale(0.95);
}

.cart-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px 12px;
  -webkit-overflow-scrolling: touch;
}

.cart-empty {
  padding: 58px 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.5;
  text-align: center;
}

.cart-item {
  display: flex;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item-image {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  color: var(--muted-2);
  font-size: 24px;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  min-width: 0;
  flex: 1;
}

.cart-item-name {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.cart-item-options {
  margin: 3px 0 5px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.cart-item-price {
  color: var(--primary-dark);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.cart-qty-btn {
  width: 29px;
  height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition:
    background var(--duration) var(--ease-soft),
    border-color var(--duration) var(--ease-soft),
    transform var(--duration) var(--ease);
}

.cart-qty-btn:hover {
  border-color: #bdd0c1;
  background: var(--primary-light);
}

.cart-qty-btn:active {
  transform: scale(0.9);
}

.cart-qty-btn.remove-btn {
  border-color: rgba(224, 82, 69, 0.35);
  color: var(--danger);
}

.cart-qty-btn.remove-btn:hover {
  background: var(--danger-soft);
}

.cart-qty {
  min-width: 18px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.cart-item-total {
  margin-left: auto;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 800;
}

.cart-footer {
  flex-shrink: 0;
  padding: 11px 16px max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 25px rgba(24, 34, 27, 0.045);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 750;
}

.cart-total-price {
  color: var(--primary-dark);
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (min-width: 431px) {
  .app-container {
    border-left: 1px solid rgba(220, 228, 222, 0.8);
    border-right: 1px solid rgba(220, 228, 222, 0.8);
  }
}

@media (max-width: 380px) {
  :root {
    --radius: 17px;
    --radius-sm: 12px;
  }

  .topbar {
    min-height: 57px;
    padding-left: 13px;
    padding-right: 13px;
  }

  .logo {
    height: 31px;
    max-width: 135px;
  }

  .topbar-actions {
    gap: 1px;
  }

  .icon-btn,
  .cart-btn {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .hero-title {
    font-size: 18px;
  }

  .main-view {
    padding-left: 13px;
    padding-right: 13px;
  }

  .categories-grid,
  .cards-grid {
    gap: 9px;
  }

  .category-card .category-image {
    height: 96px;
  }

  .product-card .product-image {
    height: 116px;
  }

  .bottom-menu {
    padding-left: 5px;
    padding-right: 5px;
  }

  .bottom-btn {
    min-width: 66px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .drawer-scroll,
  .cart-body {
    padding-left: 13px;
    padding-right: 13px;
  }

  .drawer-footer,
  .cart-footer {
    padding-left: 13px;
    padding-right: 13px;
  }
}

@media (min-width: 700px) {
  body {
    padding: 18px 0;
  }

  .app-container {
    height: calc(100dvh - 36px);
    min-height: 620px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(24, 34, 27, 0.13);
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .topbar {
    min-height: 47px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .logo {
    height: 28px;
  }

  .hero {
    padding-top: 7px;
    padding-bottom: 4px;
  }

  .hero-title {
    font-size: 17px;
  }

  .hero-tagline {
    display: none;
  }

  .banner-wrap {
    padding-top: 4px;
    padding-bottom: 7px;
  }

  .main-view {
    padding-bottom: 8px;
  }

  .category-card .category-image {
    height: 82px;
  }

  .product-card .product-image {
    height: 92px;
  }

  .bottom-menu {
    min-height: 50px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .bottom-btn {
    min-height: 42px;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 9px;
  }

  .bottom-btn i {
    font-size: 18px;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* =========================================================
   UTILITIES
   ========================================================= */

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted);
}

.mt-1 {
  margin-top: 8px;
}

.mb-1 {
  margin-bottom: 8px;
}

.gap-1 {
  gap: 8px;
}

.search-input::-webkit-search-cancel-button {
  display: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.search-input::-webkit-search-decoration {
  display: none !important;
}

.search-input::-webkit-search-results-button {
  display: none !important;
}

.search-input::-webkit-search-results-decoration {
  display: none !important;
}

/* Для Firefox */
.search-input::-moz-search-clear-button {
  display: none !important;
}

/* Для Edge / IE */
.search-input::-ms-clear {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.search-input::-ms-reveal {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
/* Скрываем основной контент до загрузки */
.app-container {
  opacity: 0 !important;
  transition: opacity 0.5s ease;
}

/* Когда приветствие показано - контент скрыт */
.app-container.hidden {
  opacity: 0 !important;
}

/* Когда контент нужно показать */
.app-container.visible {
  opacity: 1 !important;
}

/* =========================================================
   ADMIN MODAL
   ========================================================= */

.admin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.admin-modal {
  background: #ffffff;
  border-radius: 25px;
  padding: 20px 20px 20px;
  max-width: 385px;
  width: 92%;
  animation: admin-modal-in 0.3s ease;
}

@keyframes admin-modal-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.admin-modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  color: #666;
  transition:
    background 0.2s,
    transform 0.2s;
}

.admin-modal-close:hover {
  background: #eee;
}

.admin-modal-close:active {
  transform: scale(0.92);
}

.admin-modal-body p {
  font-size: 14px;
  color: #666;
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.admin-modal-body input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 14px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.admin-modal-body input:focus {
  border-color: #3d8b37;
}

.admin-modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.admin-modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}

.admin-modal-btn:active {
  transform: scale(0.97);
}

.admin-modal-btn-cancel {
  background: #f0f0f0;
  color: #555;
}

.admin-modal-btn-cancel:hover {
  background: #e5e5e5;
}

.admin-modal-btn-enter {
  background: #3d8b37;
  color: #fff;
}

.admin-modal-btn-enter:hover {
  background: #347a2e;
}

/* =========================================================
   EDIT MODE — КАРАНДАШИКИ
   ========================================================= */

.edit-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #3d8b37;
  z-index: 10;
  opacity: 0;
  transition:
    opacity 0.25s ease,
    transform 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.edit-icon.visible {
  opacity: 1;
}

.edit-icon:hover {
  transform: scale(1.05);
  background: #ffffffd7;
}

.edit-icon:active {
  transform: scale(0.88);
}

/* Для карточек категорий */
.category-card {
  position: relative;
}

/* Для карточек товаров */
.product-card {
  position: relative;
}

/* Режим редактирования — подсветка */
.edit-mode .category-card:hover,
.edit-mode .product-card:hover {
  outline: 2px dashed #3d8b37;
  outline-offset: 2px;
}

/* Поля ввода при редактировании */
.edit-input {
  width: 100%;
  padding: 4px 8px;

  border-radius: 8px;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  background: #fafffa;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
}

.edit-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  padding: 5px 5px;
  color: #347a2e;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
  line-height: 1;
  min-height: 32px;
}

.edit-save-btn:hover {
  background: #347a2e;
}

.edit-save-btn:active {
  transform: scale(0.95);
}

/* Кнопка выхода из режима админа */
.admin-exit-btn {
  background: #e0524575;
  color: #ffefef;
  border: none;
  padding: 10px 11px;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 450;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}

.admin-exit-btn:hover {
  background: #c94438;
}

.admin-exit-btn:active {
  transform: scale(0.95);
}

/* Превью выбранной картинки */
.edit-image-preview {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.edit-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Модальное окно редактирования товара */
.product-edit-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 20px;
}

.product-edit-modal-overlay .product-edit-close:hover {
  background: #e8e8e8;
}

.product-edit-modal-overlay .product-edit-save:hover {
  background: #347a2e;
}

.product-edit-modal-overlay .product-edit-cancel:hover {
  background: #e5e5e5;
}

.product-edit-modal-overlay input:focus,
.product-edit-modal-overlay textarea:focus {
  border-color: #3d8b37 !important;
  box-shadow: 0 0 0 3px rgba(61, 139, 55, 0.12);
}
/* Анимация вращения для иконки загрузки */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
/* Обёртка для карточки и кнопки */
.category-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.change-image-btn {
  display: block !important;
  width: 100% !important;
  padding: 5px 5px !important;
  background: #5b9968 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 15px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: background 0.2s !important;
  text-align: center !important;
  margin-top: 0px !important;
}

.change-image-btn:hover {
  background: #347a2e !important;
}
/* =========================================================
   ABOUT PAGE — С ЛОГОТИПОМ
   ========================================================= */

/* Герой-блок (приветствие) */
.about-hero {
  text-align: center;
  padding: 24px 20px 20px;
  background: linear-gradient(0deg, #d5e9da, #ffffff);
  border-radius: 20px;
  margin-bottom: 15px;
}

.about-hero-logo {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-hero-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
}

.about-hero-title {
  font-size: 20px;
  color: #2f8f45;
  font-weight: 750;
}

.about-hero-text {
  font-weight: 550;
  margin: 0;
  color: #555;
  line-height: 1.7;
  font-size: 15px;
}

/* Сетка для карточек (адрес + часы работы) */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

/* Карточки в сетке */
.about-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #f0f4f0;
  text-align: center;
}

.about-card-icon {
  margin-bottom: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-card-title {
  font-size: 15px;
  color: #2f8f45;
  font-weight: 700;
}

.about-card-text {
  margin: 0;
  color: #555;
  font-size: 13px;
  line-height: 1.6;
}

/* Полные карточки (контакты, соцсети) */
.about-card-full {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #f0f4f0;
}

.about-card-full .about-card-icon {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-card-full .about-card-title {
  font-size: 15px;
  color: #2f8f45;
  font-weight: 700;
}

.about-card-full .about-card-text {
  margin: 0;
  color: #555;
  font-size: 13px;
  line-height: 1.7;
}

.about-card-full .about-card-text strong {
  color: #333;
  font-weight: 600;
}

/* Блок соцсетей */
.about-social-links {
  opacity: 0.9;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.about-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 20px;
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s ease;
  border: none;
  cursor: pointer;
}

.about-social-btn i {
  font-size: 18px !important;
}

.about-social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.about-social-btn:active {
  transform: scale(0.96);
}

.about-social-instagram {
  background: linear-gradient(
    135deg,
    #f09433,
    #e6683c,
    #dc2743,
    #cc2366,
    #bc1888
  );
}

.about-social-telegram {
  background: linear-gradient(135deg, #0088cc, #005f8a);
}

/* Карта */
.about-map {
  margin-bottom: 12px;
}

.about-map .about-card-title {
  font-size: 14px;
  margin: 0 0 8px 0;
  color: #2f8f45;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.about-map iframe {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  width: 100%;
  height: 220px;
}

/* Адаптация для маленьких экранов */
@media (max-width: 430px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .about-card {
    padding: 14px 12px;
  }

  .about-hero {
    padding: 0px 10px 10px;
  }

  .about-hero-title {
    font-size: 18px;
  }

  .about-hero-text {
    font-size: 14px;
  }

  .about-social-btn {
    padding: 6px 14px;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
