* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: #f6f4ef; color: #222;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 30;
  background: #1f2937; color: #fff; padding: 10px 16px;
  border-radius: 0 0 8px 8px; text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 0; }

header {
  background: #1f2937; color: #fff;
  padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; position: sticky; top: 0; z-index: 10;
}
.logo { font-weight: bold; font-size: 20px; }
.cart-btn {
  background: #f59e0b; border: none; padding: 10px 16px;
  border-radius: 8px; cursor: pointer; font: inherit; font-weight: bold;
}
.cart-btn:hover { background: #fbbf24; }

/* ---------- заголовок и панель поиска ---------- */

.hero {
  max-width: 1100px; margin: 32px auto 0; padding: 0 20px;
}
.hero h1 {
  font-size: clamp(24px, 4vw, 38px); line-height: 1.15;
  letter-spacing: -0.02em; margin-bottom: 10px;
}
.hero-sub {
  color: #4b5563; font-size: 16px; line-height: 1.5; max-width: 620px;
}

.toolbar {
  max-width: 1100px; margin: 24px auto 0; padding: 0 20px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.search { flex: 1 1 280px; }
.search input {
  width: 100%; padding: 12px 14px;
  border: 1px solid #cbd5e1; border-radius: 10px;
  font: inherit; background: #fff;
}
.search input:focus {
  outline: 2px solid #2563eb; outline-offset: 1px; border-color: #2563eb;
}
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #4b5563; }
.sort select {
  padding: 11px 12px; border: 1px solid #cbd5e1; border-radius: 10px;
  font: inherit; background: #fff; cursor: pointer;
}

.result-info {
  max-width: 1100px; margin: 16px auto 0; padding: 0 20px;
  color: #5b6371; font-size: 14px;
}

.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 48px 20px;
  background: #fff; border-radius: 14px; color: #4b5563;
}
.empty-state .empty-title { font-size: 20px; font-weight: bold; color: #1f2937; margin-bottom: 6px; }
.empty-state p { margin-bottom: 10px; }
.empty-state .add { display: inline-block; width: auto; padding: 10px 20px; margin-top: 6px; }


.filters {
  max-width: 1100px; margin: 24px auto; padding: 0 20px;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.filters button {
  padding: 8px 14px; border: 1px solid #cbd5e1;
  background: white; border-radius: 20px; cursor: pointer;
}
.filters button.active {
  background: #1f2937; color: white; border-color: #1f2937;
}

.products {
  max-width: 1100px; margin: 12px auto 0; padding: 0 20px 60px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.products:focus { outline: none; }
.card {
  background: white; border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  display: flex; flex-direction: column;
}
.thumb {
  height: 170px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, #faf8f3, #ebe6da);
  padding: 10px;
}
.coaster-art {
  display: block; max-width: 100%; height: auto;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.18));
}
.coaster-photo {
  display: block; max-width: 100%; height: auto;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.18));
}
.thumb .coaster-photo { width: 150px; height: 150px; object-fit: contain; }
.ci-info .coaster-photo {
  width: 34px; height: 34px; flex: 0 0 auto;
  object-fit: cover; border-radius: 50%; filter: none;
}
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-body h2 { font-size: 16px; line-height: 1.3; }
.country { font-size: 13px; color: #6b7280; }
.price { font-weight: bold; font-size: 18px; }
.add {
  margin-top: auto; background: #2563eb; color: white;
  border: none; padding: 10px; border-radius: 8px; cursor: pointer;
}
.add:hover { background: #1d4ed8; }
.add.added { background: #16a34a; }

.cart {
  position: fixed; right: 0; top: 0; height: 100%; width: 360px; max-width: 100%;
  background: white; box-shadow: -4px 0 20px rgba(0,0,0,.15);
  padding: 20px; transform: translateX(100%); visibility: hidden;
  transition: transform .25s, visibility 0s .25s;
  display: flex; flex-direction: column; overflow-y: auto; z-index: 15;
}
.cart.open {
  transform: translateX(0); visibility: visible;
  transition: transform .25s, visibility 0s 0s;
}
.cart h2 { margin-bottom: 16px; }
.cart-item {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid #e5e7eb;
}
.ci-head { display: flex; justify-content: space-between; gap: 10px; }
.ci-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ci-info .coaster-art { width: 34px; height: 34px; flex: 0 0 auto; filter: none; }
.ci-name { font-size: 14px; }
.ci-price { font-weight: bold; white-space: nowrap; }
.ci-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 28px; height: 28px; border: 1px solid #cbd5e1; background: #f8fafc;
  border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1;
}
.qty-btn:hover { background: #e2e8f0; }
.qty { min-width: 22px; text-align: center; font-weight: bold; }
.ci-remove {
  margin-left: auto; background: none; border: none; color: #b91c1c;
  cursor: pointer; font-size: 13px; padding: 2px 6px;
}
.ci-remove:hover { text-decoration: underline; }

.cart-total { margin-top: 16px; font-size: 18px; font-weight: bold; }
.checkout {
  margin-top: 12px; background: #16a34a; color: white; width: 100%;
  border: none; padding: 14px; border-radius: 8px; cursor: pointer;
  font-size: 15px; font-weight: bold;
}
.checkout:hover { background: #15803d; }
.checkout:disabled {
  background: #cbd5e1; color: #6b7280; cursor: not-allowed;
}
.close-cart {
  background: none; border: none; font-size: 22px; cursor: pointer;
  align-self: flex-end;
}
.empty { color: #6b7280; margin-top: 20px; }

.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s;
  z-index: 20;
}
.modal.open { opacity: 1; visibility: visible; transition: opacity .2s, visibility 0s 0s; }
.modal-card {
  background: #fff; border-radius: 14px; padding: 24px; width: 100%;
  max-width: 460px; max-height: 90vh; overflow-y: auto; position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal-card h2 { font-size: 22px; margin-bottom: 6px; }
.modal-summary { color: #6b7280; font-size: 14px; margin-bottom: 16px; }
.modal-close {
  position: absolute; right: 10px; top: 6px; background: none; border: none;
  font-size: 24px; line-height: 1; cursor: pointer; color: #6b7280;
}
.form-field {
  display: block; margin-bottom: 12px; font-size: 14px; font-weight: bold;
}
.form-field input,
.form-field textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid #cbd5e1; border-radius: 8px;
  font: inherit; font-weight: normal; background: #fff;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid #2563eb; outline-offset: 1px; border-color: #2563eb;
}
.form-field input.invalid,
.form-field textarea.invalid { border-color: #b91c1c; }
.form-error { color: #b91c1c; font-size: 14px; margin-top: 4px; }
.order-done { text-align: center; }
.done-title { font-size: 20px; font-weight: bold; margin-bottom: 8px; }
.order-done p { color: #374151; font-size: 15px; line-height: 1.5; margin-bottom: 16px; }

footer {
  background: #1f2937; color: #d1d5db;
  text-align: center; padding: 24px;
}
.footer-note { margin-top: 6px; font-size: 13px; color: #9ca3af; }

/* ---------- карточки: ссылка на страницу бирдекеля ---------- */

.card-link {
  display: flex; flex-direction: column; flex: 1;
  color: inherit; text-decoration: none;
}
.card-link:hover h2 { color: #2563eb; }
.card-actions { padding: 0 16px 16px; display: flex; align-items: center; gap: 8px; }
.card-actions .add { flex: 1; width: auto; margin-top: 0; padding: 9px 10px; font-size: 14px; }

.qty-picker { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.qty-value {
  min-width: 20px; text-align: center; font-weight: bold; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.qty-unit { font-size: 12px; color: #5b6371; }
.qty-picker .qty-btn { width: 26px; height: 26px; }
.qty-btn:disabled { opacity: .4; cursor: default; }
.in-cart { font-size: 12.5px; color: #15803d; font-weight: 600; }

.stock { font-size: 13px; color: #5b6371; }
.stock-low { color: #b45309; font-weight: 600; }
.stock-out { color: #b91c1c; font-weight: 600; }
.add:disabled,
.add:disabled:hover { background: #e5e7eb; color: #6b7280; cursor: not-allowed; }

/* ---------- страница бирдекеля ---------- */

a.logo { color: #fff; text-decoration: none; }
.cart-link { display: inline-block; text-decoration: none; color: #1f2937; }

.detail {
  max-width: 1000px; margin: 24px auto 60px; padding: 0 20px;
}
.back-link {
  display: inline-block; margin-bottom: 16px;
  color: #2563eb; text-decoration: none; font-size: 15px;
}
.back-link:hover { text-decoration: underline; }

.detail-card {
  display: grid; grid-template-columns: 320px 1fr;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.detail-hero {
  min-height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 30px;
}
.detail-hero .coaster-art {
  width: 260px; max-width: 100%;
  filter: drop-shadow(0 16px 26px rgba(0,0,0,.35));
}
.detail-hero .coaster-photo {
  width: 300px; max-width: 100%; height: auto;
  filter: drop-shadow(0 16px 26px rgba(0,0,0,.35));
}
.detail-body { padding: 28px; }
.detail-country { color: #6b7280; font-size: 14px; margin-bottom: 6px; }
.detail-body h1 { font-size: 30px; line-height: 1.2; margin-bottom: 8px; }
.detail-brewery { color: #374151; font-size: 15px; margin-bottom: 16px; }
.detail-price { font-size: 28px; font-weight: bold; margin-bottom: 6px; }
.detail-stock { margin: 0 0 16px; font-size: 14px; }

.detail-body .add {
  padding: 12px 22px; border: none; border-radius: 8px; cursor: pointer;
  background: #2563eb; color: #fff; font-size: 15px; font-weight: bold;
}
.detail-body .add:hover { background: #1d4ed8; }
.detail-body .add:disabled,
.detail-body .add:disabled:hover { background: #e5e7eb; color: #6b7280; cursor: not-allowed; }
.detail-body .add.added { background: #16a34a; }

.buy-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 6px;
}
.qty-picker--detail .qty-btn { width: 36px; height: 36px; font-size: 18px; }
.qty-picker--detail .qty-value { min-width: 30px; font-size: 17px; }
.qty-picker--detail .qty-unit { font-size: 14px; }
.detail-in-cart {
  min-height: 18px; margin: 0 0 10px;
  color: #15803d; font-size: 14px; font-weight: 600;
}

.specs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin: 24px 0; padding: 16px;
  background: #f8fafc; border-radius: 12px;
}
.specs dt {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: #6b7280; margin-bottom: 2px;
}
.specs dd { font-size: 15px; font-weight: bold; }

.detail-body h2 { font-size: 19px; margin: 22px 0 8px; }
.detail-desc { color: #374151; line-height: 1.6; font-size: 15px; }

.facts { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.facts li {
  position: relative; padding-left: 26px;
  color: #374151; line-height: 1.55; font-size: 15px;
}
.facts li::before { content: "🍺"; position: absolute; left: 0; }

.related { margin-top: 28px; }
.related h2 { font-size: 18px; margin-bottom: 12px; }
.related-list { display: flex; flex-wrap: wrap; gap: 8px; }
.related-list a {
  padding: 8px 12px; background: #fff; border: 1px solid #cbd5e1;
  border-radius: 20px; color: #1f2937; text-decoration: none; font-size: 14px;
}
.related-list a:hover { background: #1f2937; color: #fff; border-color: #1f2937; }

.not-found { text-align: center; padding: 60px 20px; }
.not-found h1 { margin-bottom: 10px; }
.not-found p { margin-bottom: 12px; color: #374151; }
.not-found .back-link { margin-bottom: 0; }

@media (max-width: 720px) {
  .detail-card { grid-template-columns: 1fr; }
  .detail-hero { min-height: 200px; }
  .detail-body { padding: 20px; }
  .detail-body h1 { font-size: 24px; }

  header { padding: 14px 16px; }
  .logo { font-size: 17px; }
  .cart-btn { padding: 9px 12px; font-size: 14px; }
  .hero { margin-top: 22px; padding: 0 16px; }
  .toolbar { padding: 0 16px; margin-top: 18px; }
  .filters { padding: 0 16px; margin: 18px auto; }
  .result-info { padding: 0 16px; }
  .products { padding: 0 16px 48px; gap: 16px; }
  .sort { width: 100%; justify-content: space-between; }
  .sort select { flex: 1; }
  .cart { width: 100%; }
}
.product-photo {
  width: 120%;
  height: 120%;
  object-fit: contain;
  background: #fff;
  display: block;
}
.detail-photo {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  background: #fff;
  border-radius: 16px;
  display: block;
}
.photo-zoom {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.photo-zoom img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.photo-zoom-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 26px;
  cursor: pointer;
}

.detail-photo {
  cursor: zoom-in;
}
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: #1f2937;
}
a.brand {
  color: inherit;
  text-decoration: none;
}

a.brand:hover {
  opacity: 0.8;
}