:root {
  --brand: #2ea44f;
  --brand-dark: #1f6c35;
  --bg: #f9f9f9;
  --shadow: 0 4px 20px rgba(0,0,0,.08);
  --radius: 1rem;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  color: #111;
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh
}
.container { width: min(1200px, 92vw); margin-inline: auto; }

main {
  flex: 1;
}

/* ====================================================
   HEADER ТА НАВІГАЦІЯ
==================================================== */
.site-header { 
  background: #111; 
  color: #fff; 
  position: sticky; 
  top: 0; 
  z-index: 1000; 
}

.topbar { 
  display: flex; 
  align-items: center; 
  padding: 0.8rem 0; 
  position: relative;
}

.logo { 
  color: #bdbdbd; 
  text-decoration: none; 
  font-weight: 600; 
  font-size: 1.3rem; 
}

/* Меню центрується на десктопі */
.nav { 
  margin-inline: auto;
}

.nav__list { 
  list-style: none; 
  display: flex; 
  gap: 1.5rem; 
  margin: 0; 
  padding: 0; 
}

.nav__list > li > a { 
  color: #ccc; 
  text-decoration: none; 
  font-weight: 500; 
  transition: color 0.2s ease;
}

.nav__link:hover { color: #fff; }

/* Кнопки кошика та профілю відштовхуються вправо */
.actions { 
  margin-left: auto;
  display: flex; 
  gap: 0.8rem; 
  align-items: center;
}

.icon-btn { 
  display: grid; 
  place-items: center; 
  width: 2.2rem; 
  aspect-ratio: 1/1; 
  border-radius: 50%; 
  background: #2a2a2a; 
  color: #fff; 
  text-decoration: none;
  transition: background 0.2s;
}

.icon-btn:hover { background: #3a3a3a; }

/* БУРГЕР (Схований на ПК за замовчуванням) */
.burger { 
  display: none;
  width: 2.5rem; 
  aspect-ratio: 1/1; 
  background: transparent; 
  border: 0; 
  place-items: center; 
  cursor: pointer; 
  margin-left: 1rem;
}
.burger span { 
  display: block;
  width: 24px; 
  height: 2px; 
  background: #fff; 
  margin: 4px 0; 
  transition: 0.3s ease; 
}

.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }


/* Загальні кнопки */
.btn { border: 0; padding: .5rem 1rem; border-radius: 999px; background: #eee; cursor: pointer; transition: .2s; font-weight: 500; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }

/* HERO СЕКЦІЯ */
.hero { padding: clamp(1.5rem, 5vw, 3rem) 0; text-align: center; animation: fadeUp .4s ease-out;}
.hero__title { font-size: clamp(1.8rem, 3.8vw, 2.8rem); margin: 0;}
.hero__lead { color: #444; margin: .4rem 0 1rem; }

/* СЕКЦІЇ ТА СПИСКИ */
.home-section { padding: 2rem 0; }
.section-title { margin: 0 0 .4rem; font-size: clamp(1.4rem, 2.5vw, 1.8rem); text-align: center; }
.section-subtitle { color: #666; text-align: center; margin-bottom: 1.5rem; }

#about ul { list-style: none; margin: 1rem 0 0; padding: 0; }
#about li { position: relative; padding-left: 1.5rem; margin-bottom: 0.6rem; font-size: 1.05rem; color: #333; }
#about li::before { content: "✔"; position: absolute; left: 0; top: 0; color: #2fb06b; font-size: 0.95rem; line-height: 1.2; }


/* ====================================================
   КАТАЛОГ ТОВАРІВ
==================================================== */
.catalog {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  transition: transform .2s ease, box-shadow .2s ease;
  animation: fadeUp .4s ease-out;
}

.card__link {
  display: block;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem 1.2rem;
  text-decoration: none;
  color: inherit;
  text-align: center;
  box-shadow: var(--shadow);
  height: 100%;
}

.card__link:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,.1); }

.card__icon {
  width: 80px;
  height: 80px;
  display: block;
  margin: 0 auto .8rem;
  background: #f3f3f3;
  border-radius: 50%;
  padding: 0.8rem;
  object-fit: contain;
  object-position: center;
  overflow: visible;
}

.card__title { font-weight: 600; font-size: 1.05rem; }


/* ====================================================
   ТАБЛИЦЯ ПОПУЛЯРНИХ ТОВАРІВ
==================================================== */
.component-table-section {
  margin: 4rem auto;
  max-width: 1100px;
  overflow-x: auto; /* Додає скрол на телефонах */
}

.component-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  background-color: #fff;
  font-size: 0.95rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.component-table th, .component-table td { padding: 1rem 1.2rem; border-bottom: 1px solid #e5e5e5; text-align: left; }
.component-table thead { background-color: #111; color: #fff; }
.component-table tbody tr:nth-child(even) { background-color: #fafafa; }
.component-table tbody tr:hover { background-color: #ececec; transition: background-color 0.15s ease; }


/* ====================================================
   АДАПТАЦІЯ ТА МЕДІА-ЗАПИТИ (МОБІЛЬНА ВЕРСІЯ)
==================================================== */
@media (max-width: 1024px) {
  .catalog { grid-template-columns: repeat(3, 1fr); } /* 3 колонки на планшеті */
}

@media (max-width: 768px) {
  .catalog { grid-template-columns: repeat(2, 1fr); } /* 2 колонки на великому телефоні */
  
  /* Бургер меню стає видимим */
  .burger { display: grid; }
  
  /* Мобільна навігація (виїжджає зверху) */
  .nav { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    width: 100%; 
    background: #1a1a1a; 
    padding: 1.5rem 0;
    border-top: 1px solid #333;
    
    /* Ховаємо меню */
    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out; 
    z-index: -1;
  }
  
  /* Стан відкритого меню */
  .nav[data-open="true"] { 
    transform: translateY(0); 
    opacity: 1;
    visibility: visible;
  }
  
  .nav__list { flex-direction: column; align-items: center; gap: 1.5rem; }
  .nav__list li + li { margin-left: 0; }
  
  .hero { padding: 1.5rem 0; }
}

@media (max-width: 480px) {
  .catalog { grid-template-columns: 1fr; }
  .logo { font-size: 1.1rem; }
}


/* ====================================================
   ФУТЕР
==================================================== */
.site-footer { background: #111; color: #ddd; padding: 1.5rem 0; margin-top: 3rem; }
.footer__grid { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer__links { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
.footer__links a { color: #aaa; text-decoration: none; }
.footer__links a:hover { color: #fff; }

@media (max-width: 480px) {
  .footer__grid { flex-direction: column; text-align: center; }
}



/* ====================================================
   КОШИК (БЕЗ ЗМІН)
==================================================== */
.cart-page{ padding: 1.25rem 0 2.5rem; }
.cart-title{ margin: 1.2rem 0 1rem; }
.cart-grid{ display: grid; grid-template-columns: 1fr 340px; gap: 1.25rem; align-items: start; }
.cart-card{ background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; border: 1px solid #eee; }
.cart-head{ display:flex; align-items:center; justify-content: space-between; gap: 1rem; }
.cart-subtitle{ margin: 0; font-size: 1.1rem; }
.cart-empty{ padding: 1rem; background: #fafafa; border: 1px dashed #ddd; border-radius: .8rem; }
.cart-table-wrap{ overflow-x:auto; }
.cart-table{ width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td{ padding: .75rem .5rem; border-bottom: 1px solid #eee; vertical-align: middle; }
.cart-table th{ text-align: left; font-size: .9rem; color: #333; }
.cart-table .right{ text-align: right; }
.cart-table .center{ text-align: center; }
.cart-item{ display:flex; align-items:center; gap: .75rem; }
.cart-item img{ width: 64px; height: 64px; object-fit: contain; background: #f3f3f3; border-radius: .75rem; }
.cart-item .title{ font-weight: 600; }
.cart-item .muted{ color: #666; font-size: .85rem; }
.qty{ display: inline-flex; align-items: center; gap: .4rem; justify-content: center; }
.qty button{ width: 32px; height: 32px; border-radius: 999px; border: 1px solid #ddd; background: #fff; cursor: pointer; }
.qty input{ width: 56px; text-align: center; padding: .35rem .4rem; border: 1px solid #ddd; border-radius: .6rem; }
.cart-summary .row{ display:flex; justify-content: space-between; padding: .4rem 0; }
.cart-summary .total{ border-top: 1px solid #eee; margin-top: .4rem; padding-top: .7rem; font-weight: 700; }
.cart-summary .small{ font-size: .85rem; margin-top: .75rem; }
.btn.ghost{ background: #f1f1f1; }

@media (max-width: 980px){ .cart-grid{ grid-template-columns: 1fr; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }