:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f1f3f5;
  --surface-warm: #fff7d6;
  --text: #17191c;
  --muted: #68717b;
  --line: #e4e8ee;
  --accent: #111111;
  --accent-dark: #000000;
  --accent-soft: #fff0a8;
  --green: #087857;
  --green-soft: #e8f6ef;
  --gold: #ffd400;
  --danger: #b4382d;
  --shadow-sm: 0 8px 22px rgba(24, 31, 41, 0.07);
  --shadow-md: 0 18px 46px rgba(24, 31, 41, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 212, 0, 0.1), rgba(255, 255, 255, 0) 260px),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

body.preview-open {
  overflow: hidden;
}

body.category-sheet-open {
  position: fixed;
  right: 0;
  left: 0;
  overflow: hidden;
  width: 100%;
  touch-action: none;
}

body.has-floating-cart main {
  padding-bottom: 148px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  min-width: 320px;
  padding: 22px;
  place-items: center;
  background:
    linear-gradient(160deg, rgba(255, 212, 0, 0.26), rgba(232, 246, 239, 0.72) 46%, rgba(255, 255, 255, 0.96)),
    var(--bg);
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease;
}

.loading-screen.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-card {
  display: grid;
  width: min(360px, 100%);
  gap: 14px;
  justify-items: center;
  padding: 26px 20px;
  border: 1px solid rgba(228, 232, 238, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.loading-card img {
  width: 72px;
  height: 72px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #000;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.14);
}

.loading-pulse {
  display: flex;
  gap: 6px;
  align-items: center;
}

.loading-pulse span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #111;
  animation: loading-dot 0.9s ease-in-out infinite;
}

.loading-pulse span:nth-child(2) {
  animation-delay: 0.12s;
}

.loading-pulse span:nth-child(3) {
  animation-delay: 0.24s;
}

.loading-card h2 {
  font-size: 22px;
}

.loading-card p {
  max-width: 270px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

@keyframes loading-dot {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px max(16px, calc((100vw - 1220px) / 2 + 16px));
  border-bottom: 1px solid rgba(228, 232, 238, 0.82);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #000;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

h1 {
  overflow: hidden;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar p {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
}

.topbar p::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  content: "";
  box-shadow: 0 0 0 4px var(--green-soft);
}

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

.language-switch {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.language-switch button {
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.language-switch button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.favorites-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #111;
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.favorites-toggle.active {
  border-color: rgba(255, 212, 0, 0.7);
  background: var(--gold);
}

.favorites-icon {
  color: #111;
  font-size: 17px;
  line-height: 1;
}

.favorites-label {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#favoritesCount {
  display: grid;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #111;
  font-size: 12px;
  font-weight: 900;
}

.favorites-toggle.active #favoritesCount,
.favorites-toggle.has-items #favoritesCount {
  background: #111;
  color: #fff;
}

.cart-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 104px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.18);
}

.cart-button:hover {
  background: var(--accent-dark);
}

.cart-icon {
  font-size: 13px;
}

#cartCount {
  min-width: 27px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
  text-align: center;
}

main {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 18px 16px 34px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #fff7ce 64%, #eef8f0 100%);
  box-shadow: var(--shadow-sm);
}

.hero-text {
  min-width: 0;
}

.hero h2 {
  max-width: 720px;
  font-size: 28px;
  line-height: 1.16;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 650px;
  margin-top: 8px;
  color: #4e5963;
  font-size: 15px;
  line-height: 1.45;
}

.hero-stat {
  display: grid;
  min-width: 104px;
  justify-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(255, 212, 0, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.hero-stat strong {
  font-size: 24px;
  line-height: 1;
}

.hero-stat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.hero-stat.is-loading strong {
  min-width: 44px;
  color: transparent;
  border-radius: 8px;
  background: linear-gradient(100deg, #edf0f4 0%, #ffffff 48%, #edf0f4 100%);
  background-size: 220% 100%;
  animation: count-shimmer 1.1s ease-in-out infinite;
}

.hero-stat.is-loading span {
  color: #7b8591;
}

.hero-stat.is-error {
  border-color: rgba(205, 46, 46, 0.28);
}

.hero-stat.is-error strong {
  color: #cd2e2e;
}

@keyframes count-shimmer {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.search-row {
  position: sticky;
  top: 77px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px 0;
  background: rgba(245, 246, 248, 0.95);
  backdrop-filter: blur(14px);
}

.search-row input,
.order-form input,
.order-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.search-row input {
  min-height: 48px;
  padding: 0 15px;
  box-shadow: var(--shadow-sm);
}

.order-form input,
.order-form textarea {
  padding: 13px 12px;
}

.search-row input::placeholder,
.order-form input::placeholder,
.order-form textarea::placeholder {
  color: #8a939d;
}

.search-row input:focus,
.order-form input:focus,
.order-form textarea:focus {
  border-color: #111;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-row button,
.primary,
.add {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.search-row button {
  min-width: 112px;
  padding: 0 18px;
  box-shadow: 0 10px 22px rgba(17, 17, 17, 0.15);
}

.search-row button:hover,
.primary:hover,
.add:hover {
  background: var(--accent-dark);
}

.category-bar {
  position: sticky;
  top: 145px;
  z-index: 19;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  overflow: visible;
  padding: 2px 0 12px;
  background: rgba(245, 246, 248, 0.95);
}

.category-bar.open {
  z-index: 70;
}

.category-backdrop {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: none;
  min-height: 0;
  border-radius: 0;
  background: rgba(17, 19, 22, 0.42);
  backdrop-filter: blur(3px);
  touch-action: none;
}

.category-bar.open .category-backdrop {
  display: block;
}

.category-reset,
.category-trigger,
.category-option {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(24, 31, 41, 0.04);
}

.category-reset {
  justify-content: center;
  min-height: 50px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 900;
}

.category-picker {
  position: relative;
  min-width: 0;
}

.category-trigger {
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  gap: 12px;
  padding: 8px 14px;
  text-align: left;
}

.category-trigger:hover {
  background: #fbfcfd;
}

.category-trigger-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.category-trigger-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.category-trigger-label,
.category-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-trigger-label {
  font-size: 15px;
}

.category-count {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.category-chevron {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #111;
  transition: transform 0.18s ease;
}

.category-chevron::before,
.category-chevron::after {
  position: absolute;
  top: 8px;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.category-chevron::before {
  left: 1px;
  transform: rotate(45deg);
}

.category-chevron::after {
  right: 1px;
  transform: rotate(-45deg);
}

.category-bar.open .category-chevron {
  transform: rotate(180deg);
}

.category-menu {
  position: fixed;
  right: max(12px, calc((100vw - 720px) / 2));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, calc((100vw - 720px) / 2));
  z-index: 60;
  display: none;
  max-height: min(620px, 78vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  padding: 56px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
  touch-action: pan-y;
}

.category-menu::before {
  position: absolute;
  top: 18px;
  left: 18px;
  color: #17191c;
  content: attr(aria-label);
  font-size: 20px;
  font-weight: 900;
}

.category-menu::after {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #d7dce3;
  content: "";
  transform: translateX(-50%);
}

.category-bar.open .category-menu {
  display: grid;
}

.category-option {
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 11px;
  font-size: 14px;
}

.category-label {
  max-width: 100%;
}

.category-reset.active,
.category-option.active {
  border-color: #111;
  background: #111;
  color: #fff;
}

.category-trigger .category-count,
.category-option.active .category-count {
  background: var(--gold);
  color: #111;
}

.status {
  min-height: 36px;
  padding: 6px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 14px;
}

.product {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(24, 31, 41, 0.06);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.product:hover {
  border-color: #cfd6df;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-card:hover {
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(24, 31, 41, 0.06);
  transform: none;
}

.skeleton-image,
.skeleton-line,
.skeleton-button {
  position: relative;
  overflow: hidden;
  background: #eef1f5;
}

.skeleton-image::after,
.skeleton-line::after,
.skeleton-button::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.72) 45%, transparent 78%);
  content: "";
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.25s ease-in-out infinite;
}

.skeleton-image {
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 212, 0, 0.18), transparent 38%),
    #eef1f5;
}

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

.skeleton-line {
  display: block;
  height: 13px;
  border-radius: 999px;
}

.skeleton-chip {
  width: 44%;
  height: 24px;
}

.skeleton-title {
  width: 86%;
  height: 18px;
  margin-top: 2px;
}

.skeleton-short {
  width: 62%;
}

.skeleton-price {
  width: 50%;
  height: 22px;
  margin-top: 4px;
}

.skeleton-button {
  display: block;
  height: 42px;
  margin-top: 2px;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.product-image {
  position: relative;
  display: grid;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  place-items: center;
  background: #f7f8fa;
  background-position: center;
  background-size: cover;
}

.product-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.product-image.has-image img {
  opacity: 1;
}

.product-image span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: #111;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(24, 31, 41, 0.08);
}

.product-image.has-image span {
  display: none;
}

.product-image.is-clickable {
  cursor: zoom-in;
}

.product-image.is-clickable::before {
  position: absolute;
  right: 15px;
  bottom: 15px;
  z-index: 2;
  width: 10px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
  content: "";
  pointer-events: none;
  transform: rotate(45deg);
  transform-origin: center;
}

.product-image.is-clickable::after {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 43% 42%, transparent 0 6px, #fff 7px 9px, transparent 10px),
    rgba(17, 17, 17, 0.78);
  content: "";
  display: grid;
  pointer-events: none;
}

.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  width: 38px;
  min-height: 38px;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(24, 31, 41, 0.12);
}

.favorite-button.active {
  border-color: rgba(255, 212, 0, 0.6);
  background: var(--gold);
  color: #111;
}

.product-body {
  display: grid;
  grid-template-rows: auto minmax(42px, auto) minmax(40px, auto) auto auto;
  gap: 9px;
  padding: 12px;
}

.category {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product h3 {
  min-height: 42px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.3;
}

.description {
  display: -webkit-box;
  overflow: hidden;
  min-height: 39px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta {
  display: block;
  min-height: 31px;
}

.price {
  color: #111;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.add {
  width: 100%;
  min-height: 42px;
}

.add:disabled {
  background: #eef2f8;
  color: #7b8591;
  cursor: not-allowed;
  box-shadow: none;
}

.product.out-of-stock .product-image,
.product.out-of-stock h3,
.product.out-of-stock .description,
.product.out-of-stock .price {
  opacity: 0.62;
}

.product-actions {
  align-self: end;
  min-height: 42px;
}

.product-stepper {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid #e4e8ee;
  border-radius: 8px;
  background: #eef2f8;
}

.product-stepper[hidden] {
  display: none;
}

.product-stepper button {
  min-height: 42px;
  background: transparent;
  color: #17191c;
  font-size: 20px;
  font-weight: 900;
}

.product-stepper button:hover {
  background: #fff;
}

.product-stepper strong {
  color: #8a00c4;
  font-size: 17px;
  font-weight: 900;
  text-align: center;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(17, 19, 22, 0.42);
  backdrop-filter: blur(3px);
}

.floating-cart {
  position: fixed;
  right: max(14px, calc((100vw - 1220px) / 2 + 16px));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, calc((100vw - 1220px) / 2 + 16px));
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 14px 10px 18px;
  border: 1px solid rgba(255, 212, 0, 0.46);
  border-radius: 8px;
  background: #111;
  color: #fff;
  box-shadow: 0 18px 46px rgba(17, 17, 17, 0.28);
}

.floating-cart[hidden] {
  display: none;
}

.floating-cart-main {
  display: grid;
  min-width: 0;
  gap: 3px;
  text-align: left;
}

.floating-cart-main span {
  font-size: 16px;
  font-weight: 900;
}

.floating-cart-main strong {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.floating-cart-total {
  max-width: 42vw;
  overflow: hidden;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--gold);
  color: #111;
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer.open {
  display: block;
}

.image-preview {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  min-width: 320px;
  padding: 18px;
  place-items: center;
}

.image-preview.open {
  display: grid;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 0;
  background: rgba(10, 12, 15, 0.78);
  cursor: zoom-out;
}

.image-preview-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

.image-preview-media {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
}

.image-preview-panel img {
  width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  border-radius: 7px;
  background: #f7f8fa;
}

.image-preview-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  min-height: 42px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
  box-shadow: 0 10px 24px rgba(24, 31, 41, 0.16);
}

.image-preview-nav[hidden] {
  display: none;
}

.image-preview-prev {
  left: 10px;
}

.image-preview-next {
  right: 10px;
}

.image-preview-count {
  justify-self: center;
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.image-preview-panel p {
  overflow: hidden;
  color: #17191c;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.image-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  min-height: 42px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(24, 31, 41, 0.16);
}

.drawer-panel {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  width: min(520px, 100%);
  height: 100%;
  margin-left: auto;
  overflow-y: auto;
  background: var(--surface);
  padding: 18px;
  box-shadow: -16px 0 42px rgba(24, 31, 41, 0.2);
}

.drawer-head,
.cart-total,
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-head h2 {
  font-size: 24px;
}

.ghost {
  background: var(--surface-soft);
  color: var(--text);
  padding: 0 14px;
  font-weight: 800;
}

.ghost:hover {
  background: #e7ebef;
}

.cart-items {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 0 8px;
}

.empty-cart {
  margin: 18px 0;
  padding: 20px;
  border: 1px dashed #cfd6df;
  border-radius: 8px;
  background: #fafbfc;
  color: var(--muted);
  text-align: center;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 154px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(24, 31, 41, 0.04);
}

.cart-line-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.cart-line-image {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  background: #f7f8fa;
}

.cart-line-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.cart-line-image.has-image img {
  opacity: 1;
}

.cart-line-image span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: #111;
  font-size: 12px;
  font-weight: 900;
}

.cart-line-image.has-image span {
  display: none;
}

.cart-line-info {
  min-width: 0;
}

.cart-line-title {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 800;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.cart-line-price {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.cart-line-actions {
  display: grid;
  grid-template-columns: 104px 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: end;
  gap: 7px;
}

.qty-stepper {
  display: grid;
  grid-template-columns: 31px 28px 31px;
  align-items: center;
  min-height: 38px;
  padding: 3px;
  border-radius: 8px;
  background: #eef2f8;
}

.qty-stepper button {
  width: 31px;
  min-height: 32px;
  background: transparent;
  color: #22262b;
  font-size: 18px;
  font-weight: 900;
}

.qty-stepper button:hover {
  background: #fff;
}

.qty-stepper strong {
  text-align: center;
  color: #8a00c4;
  font-size: 17px;
  font-weight: 900;
}

.remove {
  width: 36px;
  min-height: 38px;
  background: #fff1f0;
  color: var(--danger);
  font-size: 16px;
  font-weight: 900;
}

.remove:hover {
  background: #ffe3e0;
}

.cart-total {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding: 15px 0;
  font-size: 18px;
}

.cart-total strong {
  font-size: 21px;
}

.order-limit-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 56, 45, 0.18);
  border-radius: 8px;
  background: rgba(180, 56, 45, 0.07);
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.order-limit-status[hidden] {
  display: none;
}

.order-form {
  display: grid;
  gap: 10px;
}

.order-form textarea {
  min-height: 86px;
  resize: vertical;
}

#locationButton {
  background: #263238;
  color: #fff;
  font-weight: 800;
}

#locationButton:hover {
  background: #11191d;
}

.location-status {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    flex: 1 1 0;
    gap: 9px;
  }

  .brand > div {
    min-width: 0;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  h1 {
    font-size: 21px;
  }

  .topbar p {
    overflow: visible;
    font-size: 14px;
    white-space: normal;
  }

  .topbar p::before {
    display: none;
  }

  .top-actions {
    width: 132px;
    max-width: 132px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
  }

  .language-switch {
    order: 3;
  }

  .favorites-toggle {
    order: 1;
    min-width: 50px;
    padding: 0 9px;
  }

  .favorites-label {
    display: none;
  }

  .cart-button {
    order: 2;
    min-width: 50px;
    padding: 0 11px;
  }

  .cart-icon {
    display: none;
  }

  main {
    padding: 12px 11px 24px;
  }

  body.has-floating-cart main {
    padding-bottom: calc(150px + env(safe-area-inset-bottom));
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px;
  }

  .hero h2 {
    font-size: 22px;
  }

  .hero-copy {
    font-size: 14px;
  }

  .hero-stat {
    width: fit-content;
    min-width: 0;
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 8px;
  }

  .hero-stat strong {
    font-size: 22px;
  }

  .search-row {
    top: 74px;
    grid-template-columns: minmax(0, 1fr) 86px;
  }

  .search-row button {
    min-width: 0;
    padding: 0 10px;
  }

  .category-bar {
    top: 137px;
  }

  .category-menu {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    max-height: 74vh;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 54px 9px 9px;
  }

  .category-option {
    min-height: 48px;
    padding: 0 9px;
    font-size: 13px;
  }

  .favorite-button {
    top: 8px;
    right: 8px;
    width: 34px;
    min-height: 34px;
    font-size: 20px;
  }

  .floating-cart {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    min-height: 58px;
    padding: 9px 10px 9px 14px;
  }

  .floating-cart-main span {
    font-size: 15px;
  }

  .floating-cart-total {
    max-width: 46vw;
    padding: 8px 10px;
    font-size: 14px;
  }

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

  .product-body {
    grid-template-rows: 28px minmax(54px, auto) 26px 42px;
    gap: 8px;
    padding: 10px;
  }

  .category {
    min-height: 25px;
    font-size: 11px;
  }

  .category[hidden] {
    display: block;
    visibility: hidden;
  }

  .product h3 {
    min-height: 54px;
    font-size: 14px;
  }

  .description {
    display: none;
  }

  .meta {
    min-height: 24px;
  }

  .price {
    font-size: 16px;
  }

  .product-stepper {
    grid-template-columns: 38px 1fr 38px;
  }

  .drawer-panel {
    padding: 15px;
  }
}

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

  h1 {
    font-size: 19px;
  }

  .language-switch button {
    padding: 0 8px;
  }

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

  .product-image img {
    padding: 8px;
  }

  .cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 144px;
    align-items: start;
  }

  .cart-line-actions {
    grid-template-columns: 100px 36px;
    justify-content: end;
    gap: 6px;
  }

  .cart-line-image {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  .qty-stepper {
    grid-template-columns: 30px 28px 30px;
  }
}
