:root {
  --cream: #f3ece1;
  --cream-card: #fbf7f0;
  --cream-deep: #ece2d3;
  --wine: #7a2230;
  --wine-dark: #5f1a25;
  --gold: #b08d4f;
  --ink: #2c2622;
  --muted: #8a7f73;
  --line: #e3d8c7;
  --shadow: 0 6px 18px rgba(74, 52, 30, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #d9cdb9;
  color: var(--ink);
  display: flex;
  justify-content: center;
  padding: 24px 12px;
  min-height: 100vh;
}

/* Рамка-телефон, как в макете */
.phone {
  width: 100%;
  max-width: 390px;
  background: var(--cream);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

/* Верхний бар */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
}
.brand-mark {
  font-family: 'Playfair Display', serif;
  font-size: 23px;
  font-weight: 700;
  color: var(--wine);
  letter-spacing: 3px;
}

.top-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  position: relative;
  line-height: 0;
}
.icon-btn:hover { background: var(--cream-deep); }

/* Дропдаун: язык + валюта */
.locale { position: relative; }
.locale-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.locale-btn .caret { font-size: 10px; color: var(--muted); }
.locale-btn:hover { border-color: var(--gold); }
.locale-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 190px;
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 30;
}
.locale-sec {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  padding: 4px 8px 2px;
}
.locale-div { height: 1px; background: var(--line); margin: 6px 4px; }
.locale-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-size: 13px;
  color: var(--ink);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}
.locale-opt span { width: 18px; text-align: center; }
.locale-opt:hover { background: var(--cream-deep); }
.locale-opt.active { color: var(--wine); font-weight: 600; }
.locale-opt.active::after { content: '✓'; margin-left: auto; color: var(--wine); }

/* Навигация Меню / Поиск / Корзина */
.mainnav {
  display: flex;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--cream-card);
}
.nav-item {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 11px 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
}
.nav-item .nav-ic { font-size: 14px; }
.nav-item.active { color: var(--wine); border-bottom-color: var(--wine); }
.nav-item:not(:last-child) { border-right: 1px solid var(--line); }

/* Строка поиска */
.searchbar { padding: 10px 18px 2px; }
.searchbar input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  background: var(--cream-card);
  color: var(--ink);
}
.searchbar input:focus { outline: none; border-color: var(--gold); }

/* Полоса категорий */
.cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 18px 12px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--cream-card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.cat-chip:hover { border-color: var(--gold); color: var(--ink); }
.cat-chip.active {
  background: var(--wine);
  border-color: var(--wine);
  color: #fff;
}

.content { padding: 4px 18px 8px; }

/* Заголовок категории */
.cat-head { text-align: center; padding: 12px 0 6px; }
.cat-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--wine);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cat-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  min-height: 0;
}
.cat-divider { color: var(--gold); font-size: 12px; margin: 8px 0 4px; letter-spacing: 6px; }

/* Featured-карточка */
.featured {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.featured .f-img {
  position: relative;
  height: 170px;
  background-size: cover;
  background-position: center;
  background-color: var(--cream-deep);
}
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--wine);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: 999px;
}
.featured .f-body { padding: 14px 16px 16px; }
.featured .f-name {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.featured .f-desc { font-size: 12px; color: var(--muted); margin: 6px 0 10px; }
.featured .f-row { display: flex; align-items: center; justify-content: space-between; }
.price { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--wine); }
.price .cur { font-size: 15px; margin-left: 2px; }
.btn-now {
  background: var(--wine);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-now:hover { background: var(--wine-dark); }

/* Сетка товаров */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.card {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card.disabled { opacity: 0.5; }
.card .c-img {
  height: 96px;
  background-size: cover;
  background-position: center;
  background-color: var(--cream-deep);
}
.card .c-body { padding: 9px 10px 11px; display: flex; flex-direction: column; flex: 1; }
.card .c-name {
  font-family: 'Playfair Display', serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.card .c-desc {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .c-row {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.card .price { font-size: 16px; }
.card .price .cur { font-size: 11px; }
.btn-cart {
  background: #2e6b3e;
  color: #fff;
  border: none;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-cart:hover { background: #245631; }
.btn-cart:disabled { background: #b7b1a6; cursor: not-allowed; }

/* Преимущества */
.perks {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  padding: 18px 14px 10px;
  text-align: center;
}
.perk { font-size: 9.5px; color: var(--muted); line-height: 1.25; flex: 1; }
.perk-ic { display: block; font-size: 17px; margin-bottom: 4px; }

/* Нижняя панель */
.bottombar { padding: 4px 16px 16px; }
.loc { text-align: center; font-size: 10px; color: var(--muted); margin-bottom: 10px; }
.cta-all {
  width: 100%;
  background: var(--wine);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 15px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
}
.cta-all:hover { background: var(--wine-dark); }
.cart-badge {
  background: #fff;
  color: var(--wine);
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.chev { font-size: 18px; }

/* Значок корзины на иконке в шапке */
.cart-btn .cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--wine);
  color: #fff;
  font-size: 9px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
}

/* Карточки кликабельны */
.card, .featured { cursor: pointer; }

/* Модалка деталей */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(35, 25, 18, 0.55); backdrop-filter: blur(2px); }
.modal-card {
  position: relative;
  width: calc(100% - 36px);
  max-width: 360px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--cream-card);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  animation: pop 0.16s ease-out;
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.modal-img {
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: var(--cream-deep);
  border-radius: 18px 18px 0 0;
}
.modal-body { padding: 16px 18px 20px; }
.modal-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.modal-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 10px;
  white-space: pre-line;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.modal-foot .price { font-size: 24px; }
.btn-cart.lg { font-size: 12px; padding: 12px 20px; border-radius: 10px; }

/* Десктоп: расширяем сетку */
@media (min-width: 720px) {
  .phone { max-width: 760px; border-radius: 20px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .featured { display: flex; }
  .featured .f-img { width: 50%; height: auto; min-height: 220px; }
  .featured .f-body { width: 50%; display: flex; flex-direction: column; justify-content: center; }
}
