/* ── RESET & TOKENS ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --milk:     #F3EFE0; /* Базовий теплий пісочний фон сайту (Beach sand) */
  --white:    #FFFFFF; /* Чистий білий для карток товарів — тепер вони будуть яскраво виділятися */
  --ink:      #1A2223; /* Контрастний глибокий колір для тексту (має дорогий вигляд) */
  --ink-soft: #606C69; /* М'який відтінок для описів та дрібного тексту */
  --sand:     #E76F51; /* Соковитий теракотово-помаранчевий (захід сонця) для акцентів та кнопок */
  --sand-lt:  #F4A261; /* Світло-пісочний сонячний для ховерів (наведення мишкою) */
  --stone:    #DFD9C4; /* М'яка тінь/рамочка для явного розділення блоків */
  --mist:     #EAE3CD; /* Темніший літній тон для неактивних кнопок категорій, щоб був об'єм */
  --radius:   8px;
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', 'Inter', sans-serif;
  background: var(--milk);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400;1,500&family=DM+Sans:wght@300;400;500&display=swap');

/* ── OVERLAY ── */
#overlay {
  position: fixed; inset: 0;
  background: rgba(28, 28, 28, 0);
  z-index: 900;
  pointer-events: none;
  transition: background 0.5s var(--ease);
}
#overlay.active {
  background: rgba(28, 28, 28, 0.38);
  pointer-events: all;
}

/* ── HEADER ── */
header {
  position: sticky; top: 0; z-index: 800;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stone);
  padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-transform: uppercase;
}
.logo span { color: var(--sand); font-style: italic; }

nav { display: flex; gap: 36px; }
nav a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
nav a::after {
  content: '';
  position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--sand);
  transition: width 0.3s var(--ease);
}
nav a:hover { color: var(--ink); }
nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.auth-btn {
  background: transparent;
  border: 1px solid var(--stone);
  color: var(--ink);
  padding: 9px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.auth-btn:hover { border-color: var(--ink); background: var(--ink); color: #fff; }

.admin-btn {
  background: var(--sand);
  border: none;
  color: #fff;
  padding: 9px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.25s;
}
.admin-btn:hover { background: #b8955a; }

.cart-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink);
  color: #fff;
  border: none; cursor: pointer;
  padding: 9px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: var(--radius);
  transition: background 0.25s;
}
.cart-btn:hover { background: var(--sand); }

.cart-count {
  background: var(--sand);
  color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 9px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.cart-count.bump { transform: scale(1.5); }

/* ── HERO ── */
.hero {
  padding: 100px 48px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: end;
  border-bottom: 1px solid var(--stone);
  max-width: 1400px;
  margin: 0 auto;
}

.hero-label {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sand);
  font-weight: 500;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.hero-label::before {
  content: '';
  display: inline-block;
  width: 32px; height: 1px;
  background: var(--sand);
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(48px, 5.5vw, 86px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.hero h1 em {
  font-style: italic;
  color: var(--sand);
}

.hero-right {
  padding-bottom: 8px;
}
.hero-right p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.7;
  font-weight: 300;
  max-width: 340px;
  margin-bottom: 32px;
}

.hero-cta {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
  background: none; border-top: none; border-left: none; border-right: none;
  cursor: pointer;
}
.hero-cta:hover { color: var(--sand); border-color: var(--sand); }
.hero-cta svg { transition: transform 0.3s; }
.hero-cta:hover svg { transform: translateX(4px); }

/* ── FILTERS ── */
.filters {
  display: flex; align-items: center; gap: 6px;
  padding: 36px 48px 24px;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: auto;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--stone);
  padding: 8px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; letter-spacing: 0.1em; font-weight: 500;
  text-transform: uppercase; color: var(--ink-soft);
  cursor: pointer; border-radius: 100px;
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.filter-btn.active {
  background: var(--ink); border-color: var(--ink); color: #fff;
}

/* ── CATALOG ── */
#catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  max-width: 1400px;
  margin: 0 auto 100px;
  padding: 0 48px;
  background: var(--stone);
  border: 1px solid var(--stone);
}

/* ── CARD ── */
.card {
  background: var(--white);
  display: flex; flex-direction: column;
  transition: box-shadow 0.4s var(--ease);
  animation: fadeUp 0.6s var(--ease) both;
}
.card:hover { box-shadow: 0 20px 60px rgba(28,28,28,0.08); z-index: 2; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }

.card-img {
  aspect-ratio: 3/4;
  background: var(--mist);
  overflow: hidden; position: relative;
}
.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.card:hover .card-img img { transform: scale(1.05); }

.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 72px;
  transition: transform 0.7s var(--ease);
}
.card:hover .card-img-placeholder { transform: scale(1.05); }

.card-badge {
  position: absolute; top: 16px; left: 16px;
  background: var(--ink);
  color: #fff;
  font-size: 9px; letter-spacing: 0.12em;
  font-weight: 500; text-transform: uppercase;
  padding: 5px 12px;
}

.card-body {
  padding: 20px 24px 16px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
}
.card-category {
  font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--sand);
  font-weight: 500;
}
.card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 400;
  color: var(--ink); line-height: 1.25;
}
.card-desc {
  font-size: 12px; color: var(--ink-soft);
  line-height: 1.65; font-weight: 300;
}

.card-sizes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.size-chip {
  border: 1px solid var(--stone);
  padding: 5px 11px;
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--ink-soft);
  cursor: pointer; transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
  background: transparent;
}
.size-chip:hover, .size-chip.selected {
  border-color: var(--ink); background: var(--ink); color: #fff;
}

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--stone);
  margin-top: auto;
}
.card-price {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 400; color: var(--ink);
}
.card-price small { font-size: 12px; font-weight: 300; color: var(--ink-soft); font-family: 'DM Sans', sans-serif; }

.add-btn {
  background: var(--ink); color: #fff;
  border: none; cursor: pointer;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  transition: background 0.2s, transform 0.15s;
}
.add-btn:hover { background: var(--sand); }
.add-btn:active { transform: scale(0.9); }

/* ── ADMIN CONTROLS ── */
.admin-controls {
  display: flex; gap: 1px;
  border-top: 1px solid var(--stone);
}
.edit-btn, .delete-btn {
  flex: 1; padding: 10px;
  background: var(--mist);
  border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: all 0.2s;
}
.edit-btn { color: var(--ink-soft); border-right: 1px solid var(--stone); }
.edit-btn:hover { background: var(--ink); color: #fff; }
.delete-btn { color: #c0392b; }
.delete-btn:hover { background: #fff0f0; }

/* ── CART SIDEBAR ── */
#cartSidebar {
  position: fixed; top: 0; right: -440px;
  width: 420px; height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--stone);
  z-index: 1000;
  display: flex; flex-direction: column;
  transition: right 0.45s var(--ease);
  box-shadow: -4px 0 40px rgba(28,28,28,0.06);
}
#cartSidebar.open { right: 0; }

.cart-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--stone);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 400;
  letter-spacing: 0.02em;
}
.cart-close {
  background: transparent; border: none; cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 18px;
  transition: color 0.2s;
}
.cart-close:hover { color: var(--ink); }

#cartItems {
  flex: 1; overflow-y: auto; padding: 20px 32px;
  scrollbar-width: thin; scrollbar-color: var(--stone) transparent;
}

.cart-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%;
  gap: 16px; color: var(--ink-soft);
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-style: italic;
}
.cart-empty svg { opacity: 0.2; }

.cart-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 0; border-bottom: 1px solid var(--stone);
}
.cart-item-thumb {
  width: 68px; height: 84px;
  background: var(--mist); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  overflow: hidden;
}
.cart-item-thumb img { width:100%; height:100%; object-fit:cover; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 400;
  color: var(--ink); margin-bottom: 4px;
}
.cart-item-size {
  font-size: 10px; letter-spacing: 0.1em;
  color: var(--ink-soft); text-transform: uppercase; margin-bottom: 8px;
}
.cart-item-price { font-size: 13px; font-weight: 500; color: var(--sand); }

.cart-item-controls { display: flex; align-items: center; gap: 2px; margin-top: 8px; }
.qty-btn {
  background: transparent; border: 1px solid var(--stone);
  width: 26px; height: 26px;
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); transition: all 0.15s;
}
.qty-btn:hover { border-color: var(--ink); color: var(--ink); }
.qty-val { width: 30px; text-align: center; font-size: 13px; font-weight: 500; }

.cart-item-remove {
  background: transparent; border: none; cursor: pointer;
  color: var(--stone); font-size: 16px;
  transition: color 0.2s; flex-shrink: 0;
}
.cart-item-remove:hover { color: #c0392b; }

.cart-footer { padding: 24px 32px; border-top: 1px solid var(--stone); }
.cart-subtotal {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.cart-subtotal span:first-child {
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft); font-weight: 500;
}
.cart-subtotal span:last-child {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 400;
}
.checkout-btn {
  width: 100%; padding: 15px;
  background: var(--ink); color: #fff;
  border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; letter-spacing: 0.14em;
  font-weight: 500; text-transform: uppercase;
  transition: background 0.2s;
}
.checkout-btn:hover { background: var(--sand); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--stone);
  padding: 48px;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 400;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink);
}
.footer-logo span { color: var(--sand); font-style: italic; }
.footer-copy {
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 60px 24px 48px; gap: 32px; }
  header { padding: 0 24px; }
  nav { display: none; }
  #catalog { padding: 0 24px; }
  .filters { padding: 24px 24px 16px; }
  footer { padding: 32px 24px; flex-direction: column; gap: 16px; text-align: center; }
  #cartSidebar { width: 100%; right: -105%; }
  #cartSidebar.open { right: 0; }
}
.hero-stats {
  display: flex; gap: 32px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--stone);
}
.hero-stat {
  display: flex; flex-direction: column; gap: 4px;
}
.hero-stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 400;
  color: var(--ink);
}
.hero-stat-label {
  font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-soft);
  font-weight: 500;
}