/* ================================================
   НАШЕ САШЕ — каталог товаров
   Стили перенесены из инлайн-разметки Claude Design
   ================================================ */

/* ── Фильтр категорий ─────────────────────────── */

[data-filters] {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.p-filter {
  padding: 11px 22px;
  border: 2px solid #a81f18;
  background: transparent;
  cursor: pointer;
  font-family: 'PT Sans', sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #a81f18;
  transition: background .15s, color .15s;
}

.p-filter:hover { background: #f9f3e8; }

.p-filter.is-active {
  background: #a81f18;
  color: #fdfbf7;
}

/* ── Сетка товаров ────────────────────────────── */

/* Линии рисуем границами карточек, а не фоном сетки —
   иначе в пустых ячейках последнего ряда виден бежевый квадрат */
[data-products] {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: #fdfbf7;
  border: 2px solid #a81f18;
}

.p-card {
  background: #fdfbf7;
  padding: 22px;
  border-right: 1px solid #e7dac6;
  border-bottom: 1px solid #e7dac6;
  display: flex;
  flex-direction: column;
  transition: background .18s;
}

.p-card:hover { background: #f9f3e8; }

.p-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f4ede1;
  margin-bottom: 18px;
}

.p-name {
  margin: 0 0 6px;
  font-family: 'Ruslan Display', serif;
  font-weight: 400;
  font-size: 23px;
  line-height: 1.2;
  color: #2b1a16;
}

.p-variant {
  margin: 0 0 8px;
  font-family: 'PT Sans', sans-serif;
  font-size: 13px;
  color: #8a6f5c;
}

.p-type {
  margin: 0;
  font-family: 'PT Sans', sans-serif;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a6f5c;
}

.p-aroma {
  margin: 8px 0 0;
  font-family: 'PT Sans', sans-serif;
  font-size: 13.5px;
  color: #4a352c;
}

.p-city {
  display: inline-block;
  margin-top: 10px;
  font-family: 'PT Sans', sans-serif;
  font-size: 12px;
  letter-spacing: .08em;
  color: #a81f18;
  border-bottom: 1px solid #a81f18;
  padding-bottom: 2px;
  text-decoration: none;
  align-self: flex-start;
}

.p-city:hover { color: #2b1a16; border-color: #2b1a16; }

.p-spacer { flex: 1; min-height: 14px; }

.p-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.p-price {
  font-family: 'Ruslan Display', serif;
  font-size: 22px;
  color: #a81f18;
}

.p-buy {
  padding: 11px 20px;
  border: 2px solid #a81f18;
  background: transparent;
  cursor: pointer;
  font-family: 'PT Sans', sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #a81f18;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.p-buy:hover,
.p-buy.is-added {
  background: #a81f18;
  color: #fdfbf7;
}

.p-empty {
  grid-column: 1 / -1;
  background: #fdfbf7;
  padding: 48px 22px;
  text-align: center;
  font-family: 'PT Sans', sans-serif;
  font-size: 14px;
  color: #8a6f5c;
  margin: 0;
}

/* ── Адаптив ──────────────────────────────────── */

.p-card:nth-child(4n) { border-right: none; }

@media (max-width: 1100px) {
  [data-products] { grid-template-columns: repeat(3, 1fr); }
  .p-card:nth-child(4n) { border-right: 1px solid #e7dac6; }
  .p-card:nth-child(3n) { border-right: none; }
}

@media (max-width: 860px) {
  [data-products] { grid-template-columns: repeat(2, 1fr); }
  .p-card:nth-child(3n), .p-card:nth-child(4n) { border-right: 1px solid #e7dac6; }
  .p-card:nth-child(2n) { border-right: none; }
  .p-card { padding: 16px; }
  .p-name { font-size: 20px; }
}

@media (max-width: 480px) {
  [data-products] { grid-template-columns: 1fr; }
  .p-card { border-right: none; }
  .p-foot { flex-direction: column; align-items: stretch; }
  .p-buy { width: 100%; }
}

/* ── Галерея в карточке ───────────────────────── */

.p-gallery {
  position: relative;
  margin-bottom: 18px;
  background: #f4ede1;
}

.p-gallery .p-photo {
  margin-bottom: 0;
  cursor: zoom-in;
}

/* Стрелки переключения */
.p-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 1px solid #e7dac6;
  background: rgba(253, 251, 247, .92);
  color: #a81f18;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .18s, background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.p-prev { left: 8px; }
.p-next { right: 8px; }

.p-card:hover .p-nav,
.p-gallery:focus-within .p-nav { opacity: 1; }
.p-nav:hover { background: #a81f18; color: #fdfbf7; border-color: #a81f18; }

/* Точки — какое фото сейчас */
.p-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.p-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(168, 31, 24, .28);
  transition: background .18s;
}

.p-dot.is-on { background: #a81f18; }

/* Лупа */
.p-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 1px solid #e7dac6;
  background: rgba(253, 251, 247, .92);
  cursor: zoom-in;
  opacity: 0;
  transition: opacity .18s;
  padding: 0;
}

.p-zoom span {
  display: block;
  width: 11px;
  height: 11px;
  margin: 0 auto;
  border: 1.5px solid #a81f18;
  border-radius: 50%;
  position: relative;
}

.p-zoom span::after {
  content: '';
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 6px;
  height: 1.5px;
  background: #a81f18;
  transform: rotate(45deg);
}

.p-card:hover .p-zoom { opacity: 1; }
.p-zoom:hover { background: #a81f18; }
.p-zoom:hover span { border-color: #fdfbf7; }
.p-zoom:hover span::after { background: #fdfbf7; }

/* ── Просмотр крупно ──────────────────────────── */

.p-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(43, 26, 22, .92);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px;
}

.p-lightbox.open { display: flex; }

.pl-img {
  max-width: min(760px, 78vw);
  max-height: 78vh;
  width: auto;
  height: auto;
  background: #fdfbf7;
}

.pl-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(253, 251, 247, .4);
  background: transparent;
  color: #fdfbf7;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.pl-close:hover { background: rgba(253, 251, 247, .12); }

.pl-nav {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(253, 251, 247, .4);
  background: transparent;
  color: #fdfbf7;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  flex: none;
  padding: 0;
}

.pl-nav:hover { background: rgba(253, 251, 247, .12); }

.pl-caption {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'PT Sans', sans-serif;
  font-size: 13px;
  letter-spacing: .08em;
  color: rgba(253, 251, 247, .85);
}

/* ── Мобильный ────────────────────────────────── */

@media (max-width: 860px) {
  /* На телефоне стрелки видны всегда — наведения нет */
  .p-nav, .p-zoom { opacity: 1; }
  .p-nav { width: 30px; height: 30px; font-size: 19px; }
}

@media (max-width: 480px) {
  .p-lightbox { padding: 16px; gap: 8px; }
  .pl-img { max-width: 92vw; max-height: 68vh; }
  .pl-nav { width: 38px; height: 38px; font-size: 24px; }
  .pl-close { top: 10px; right: 12px; width: 34px; height: 34px; font-size: 22px; }
}

/* Keep the complete price together; allow long candle actions their own row. */
.p-foot { flex-direction: column; align-items: stretch; }
.p-price { white-space: nowrap; text-wrap: nowrap; flex-shrink: 0; line-height: 1.25; }
.p-buy { width: 100%; min-height: 44px; white-space: normal; text-wrap: balance; padding: 11px 10px; }
.p-card { min-width: 0; }
