:root {
  --green: #111;
  --green-dark: #000;
  --danger: #111;
  --ink: #111;
  --muted: #707070;
  --line: #e5e5e5;
}

body {
  color: #111;
  background: #fff;
  font-family: "Manrope", "Noto Sans Georgian", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
}
body[data-language="ka"] { font-family: "Noto Sans Georgian", "Manrope", sans-serif; }
strong, b, h1, h2, h3, h4, button { font-weight: 500; }

.topbar {
  min-height: 72px;
  padding: 12px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid #e5e5e5;
  background: rgb(255 255 255 / 95%);
  box-shadow: none;
  backdrop-filter: blur(18px);
}
.mode-switch { padding: 4px; border: 1px solid #e2e2e2; border-radius: 999px; background: #f5f5f5; }
.mode-btn { min-height: 36px; padding: 7px 16px; border: 0; border-radius: 999px; color: #666; background: transparent; }
.mode-btn.active { color: #fff; background: #111; box-shadow: none; }
.top-actions { gap: 8px; }
.text-action, .start-over-action, .danger-link { color: #333; background: transparent; text-decoration: none; }
.text-action:hover, .start-over-action:hover, .danger-link:hover { color: #000; background: #f3f3f3; }
.language-toggle { display: grid; width: 38px; height: 38px; padding: 0; overflow: hidden; place-items: center; border: 1px solid #ddd; border-radius: 50%; background: #fff; }
.language-toggle img { width: 30px; height: 30px; border-radius: 50%; }
.cart-button, .primary-btn, .add-card-btn, .round-action.add, .danger-btn {
  color: #fff;
  border-color: #111;
  background: #111;
  box-shadow: none;
}
.cart-button:hover, .primary-btn:hover, .add-card-btn:hover, .round-action.add:hover { color: #fff; background: #000; }

.app-shell { display: block; width: min(1520px, 100%); margin: 0 auto; }
.workspace { width: 100%; max-width: none; padding: 22px clamp(16px, 3vw, 42px) 72px; }
.summary-strip {
  display: grid;
  grid-template-columns: minmax(96px, .7fr) minmax(130px, .9fr) minmax(220px, 1.35fr);
  max-width: 760px;
  margin: 0 auto 22px;
  overflow: visible;
  border: 1px solid #e5e5e5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 28px rgb(0 0 0 / 5%);
}
.summary-strip > div,
.summary-strip > div:first-child,
.summary-strip > div:nth-child(2) {
  display: flex;
  min-width: 0;
  min-height: 72px;
  padding: 13px 18px;
  flex-direction: column;
  justify-content: center;
  border: 0;
  border-right: 1px solid #e5e5e5;
}
.summary-strip > div:last-child { border-right: 0; }
.summary-label { color: #777; font-size: 11px; letter-spacing: .02em; text-transform: none; }
.summary-strip strong { margin-top: 3px; color: #111; font-size: 17px; font-weight: 500; }
.currency-summary select { width: 100%; height: 32px; margin-top: 2px; padding: 0 24px 0 0; border: 0; outline: 0; color: #111; background-color: transparent; font-size: 13px; }
.currency-summary small { min-height: 14px; color: #777; font-size: 10px; }

.progress-track { height: 3px; background: #ececec; }
#progressFill { background: #111; }
.swipe-card { overflow: hidden; border: 1px solid #e4e4e4; border-radius: 28px; background: #fff; box-shadow: 0 24px 70px rgb(0 0 0 / 14%); }
.swipe-card-body { padding: 18px 20px 20px; }
.swipe-card-body h2 { margin: 0; font-size: clamp(20px, 4vw, 27px); font-weight: 500; line-height: 1.22; }
.product-description, .additional-info, .card-topline { display: none !important; }
.price-row > div { padding: 0; border: 0; background: transparent; }
.price-row span { color: #777; font-size: 10px; }
.price-row strong { color: #111; font-size: 15px; }
.swipe-badge, .add-badge, .skip-badge { color: #111; border-color: #111; background: rgb(255 255 255 / 90%); }
.swipe-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.round-action, .round-action.skip, .round-action.undo {
  min-width: 88px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  color: #222;
  background: #fff;
  box-shadow: 0 7px 20px rgb(0 0 0 / 7%);
}
.round-action.add { min-width: 112px; color: #fff; background: #111; }

.filters-bar { display: grid; grid-template-columns: minmax(210px, 1.5fr) repeat(3, minmax(150px, .7fr)); gap: 10px; margin-bottom: 22px; padding: 0; border: 0; background: transparent; }
.filters-bar input, .filters-bar select { width: 100%; height: 46px; border: 1px solid #ddd; border-radius: 14px; color: #222; background-color: #fff; }
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 16px; align-items: stretch; }
.product-card {
  display: flex;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  background: #fff;
  box-shadow: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.product-card:hover { transform: translateY(-2px); border-color: #d3d3d3; box-shadow: 0 16px 40px rgb(0 0 0 / 8%); }
.product-card.selected { border-color: #111; box-shadow: inset 0 0 0 1px #111; }
.product-card-image { aspect-ratio: 4 / 3; background: #f2f2f2; }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body { display: flex; min-height: 164px; padding: 15px; flex: 1; flex-direction: column; }
.product-card h3 {
  display: -webkit-box;
  min-height: 46px;
  margin: 0 0 8px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.card-prices { min-height: 42px; }
.card-prices strong { color: #111; font-size: 14px; font-weight: 500; }
.card-prices span { color: #777; font-size: 12px; }
.product-card-actions { min-height: 42px; margin-top: auto; }
.add-card-btn { width: 100%; min-height: 42px; border-radius: 12px; }
.quantity-control { display: grid; width: 100%; height: 42px; grid-template-columns: 42px 1fr 42px; align-items: center; overflow: hidden; border: 1px solid #ccc; border-radius: 12px; background: #fff; }
.quantity-control button, .cart-mini-controls button { color: #111; border: 0; background: transparent; }
.quantity-control span { text-align: center; font-weight: 500; }
.card-edit-btn { display: none !important; }

.cart-panel {
  position: fixed;
  z-index: 90;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  inset-inline: auto 0;
  width: min(380px, calc(100vw - 18px));
  height: 100dvh;
  max-height: none;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) 20px;
  overflow: auto;
  border: 0;
  border-left: 1px solid #e5e5e5;
  border-radius: 0;
  background: #fff;
  box-shadow: -24px 0 70px rgb(0 0 0 / 14%);
  transform: translate3d(105%, 0, 0);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}
.cart-panel.open { transform: translate3d(0, 0, 0); }
.cart-backdrop { position: fixed; z-index: 80; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgb(0 0 0 / 28%); backdrop-filter: blur(2px); }
.cart-header .mobile-only { display: block; }
.people-control { border: 0; border-radius: 14px; background: #f5f5f5; }
.cart-item { grid-template-columns: 52px minmax(0, 1fr); border-bottom: 1px solid #eee; }
.cart-item img { width: 52px; height: 52px; border-radius: 12px; }
.cart-item-actions { grid-column: 2; }
.backup-tools { display: none !important; }
.danger-link { width: 100%; padding: 10px; border-radius: 10px; color: #333; }
.warning-item.ok, .warning-item.error { color: #222; border-color: #ddd; background: #f7f7f7; }

@media (max-width: 1080px) {
  .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar { display: grid; grid-template-columns: 1fr auto; min-height: auto; gap: 10px; padding: 10px 14px; }
  .brand span, .saved-status, .start-over-action { display: none; }
  .brand img { height: 34px; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .mode-switch { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .mode-btn { flex: 1; }
  .cart-button { min-height: 38px; padding: 8px 12px; }
  .workspace { padding: 14px 12px 88px; }
  .summary-strip { grid-template-columns: 1fr 1fr; margin-bottom: 14px; border-radius: 16px; }
  .summary-strip > div,
  .summary-strip > div:first-child,
  .summary-strip > div:nth-child(2) { min-height: 62px; padding: 10px 13px; }
  .summary-strip > div:nth-child(2) { border-right: 0; }
  .summary-strip > .currency-summary { grid-column: 1 / -1; min-height: 60px; border-top: 1px solid #e5e5e5; border-right: 0; }
  .swipe-stage { min-height: min(520px, calc(100dvh - 345px)); }
  .swipe-card { border-radius: 23px; }
  .swipe-card-body { padding: 14px 16px 16px; }
  .round-action { min-width: 82px; min-height: 44px; padding: 9px 14px; font-size: 12px; }
  .catalog-header .primary-btn { display: none; }
  .filters-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
  .filters-bar::-webkit-scrollbar { display: none; }
  .filters-bar > * { flex: 0 0 172px; }
  .filters-bar .search-field { flex-basis: 220px; }
  .filters-bar input, .filters-bar select { height: 42px; border-radius: 12px; font-size: 12px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 9px; }
  .product-card { border-radius: 16px; }
  .product-card:hover { transform: none; box-shadow: none; }
  .product-card-body { min-height: 160px; padding: 11px; }
  .product-card h3 { min-height: 58px; font-size: 13px; line-height: 1.48; -webkit-line-clamp: 3; }
  .card-prices { min-height: 39px; }
  .card-prices strong { font-size: 13px; }
  .card-prices span { font-size: 10px; }
  .product-card-actions, .quantity-control, .add-card-btn { min-height: 40px; height: 40px; }
  .quantity-control { grid-template-columns: 38px 1fr 38px; }
  .cart-panel { inset: 0 0 0 auto; width: min(370px, calc(100vw - 10px)); height: 100dvh; padding: 16px; border-radius: 0; }
}
