:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: #ececf1;
  --text: #17181c;
  --muted: #6e6e73;
  --line: #dedee3;
  --red: #ef4444;
  --blue: #3b82f6;
  --green: #10b981;
  --orange: #f97316;
  --shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.shop-page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 42px 24px 56px;
}

.toolbar-band {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.1;
  letter-spacing: 0;
}

p {
  margin: 0;
}

.toolbar-band p {
  color: var(--muted);
  font-size: 1.05rem;
}

.tools {
  display: grid;
  grid-template-columns: minmax(260px, 320px);
  gap: 18px;
  justify-items: stretch;
}

.search-box,
.tools select {
  min-height: 46px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.search-box svg {
  color: var(--muted);
  flex: 0 0 auto;
}

.search-box input,
.tools select {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.tools select {
  padding: 0 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 18px;
  align-items: start;
}

.product-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.product-media {
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 1;
  color: #fff;
  background: var(--panel-soft);
  font-size: 2.45rem;
  font-weight: 950;
}

.product-body {
  padding: 16px 16px 14px;
}

.category {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.product-title {
  display: -webkit-box;
  min-height: 54px;
  margin: 0 0 14px;
  overflow: hidden;
  font-size: 1.16rem;
  line-height: 1.35;
  letter-spacing: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 58px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.badge {
  align-self: flex-start;
  padding: 4px 9px;
  color: #fff;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 850;
}

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

.badge.blue {
  background: var(--blue);
}

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

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

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
}

.price small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.price strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.15;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-btn,
.arrow-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.arrow-btn {
  border-color: transparent;
}

.cart-btn:hover,
.arrow-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.float-service {
  position: fixed;
  right: 18px;
  top: 50%;
  z-index: 10;
  display: grid;
  place-items: center;
  gap: 6px;
  width: 62px;
  min-height: 104px;
  color: #fff;
  background: #e21d25;
  border: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(-50%);
}

.float-service span {
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.25;
}

.qr-dialog {
  width: min(380px, calc(100vw - 32px));
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
}

.qr-dialog::backdrop {
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(5px);
}

.qr-card {
  position: relative;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.close-btn:hover {
  color: var(--text);
  border-color: var(--line);
}

.qr-eyebrow {
  margin-bottom: 8px;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 850;
}

.qr-card h2 {
  margin: 0 36px 18px;
  font-size: 1.35rem;
}

.qr-image {
  display: block;
  width: 240px;
  height: 240px;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.qr-tip {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

@media (min-width: 1320px) {
  .product-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shop-page {
    padding: 28px 14px 48px;
  }

  .toolbar-band {
    display: grid;
    gap: 18px;
  }

  .tools {
    grid-template-columns: 1fr;
  }

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

  .float-service {
    top: auto;
    right: 12px;
    bottom: 16px;
    width: 50px;
    min-height: 50px;
    border-radius: var(--radius);
    transform: none;
  }

  .float-service span {
    display: none;
  }
}
