: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;
}
.container { width: min(1200px, 92vw); margin-inline: auto; }

/* HEADER */
.site-header { background: #111; color: #fff; position: sticky; top: 0; z-index: 100; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; }
.logo { color: #bdbdbd; text-decoration: none; font-weight: 600; font-size: 1.2rem; }
.actions { margin-left: auto; display: flex; gap: .5rem; }
.icon-btn { display: grid; place-items: center; width: 2rem; aspect-ratio: 1/1; border-radius: 50%; background: #2a2a2a; color: #fff; }
.icon-btn:hover { background: #3a3a3a; }

.burger { width: 2rem; aspect-ratio: 1/1; background: transparent; border: 0; display: grid; place-items: center; cursor: pointer; }
.burger span { width: 22px; height: 2px; background: #fff; margin: 3px 0; transition: .2s; }

.nav__list { list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0; }
.nav > .nav__list > li > a { color: #ccc; text-decoration: none; font-weight: 500; }
.nav__link:hover { color: #fff; }


.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; }
.hero__title { font-size: clamp(1.8rem, 3.8vw, 2.8rem); margin: 0; color: #0c3; }
.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: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.card {
  flex: 1 1 calc(25% - 1rem);
  min-width: 240px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card__link {
  display: block;
  background: #fff;
  border-radius: var(--radius);
  padding: 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; }

/* кольори для категорій */
.card[data-cat="cpu"] .card__icon { background: #fff1e0; }
.card[data-cat="mb"] .card__icon { background: #e5f1ff; }
.card[data-cat="ram"] .card__icon { background: #f0fff0; }
.card[data-cat="gpu"] .card__icon { background: #ececff; }
.card[data-cat="storage"] .card__icon { background: #fff8e5; }
.card[data-cat="case"] .card__icon { background: #f8eaff; }
.card[data-cat="psu"] .card__icon { background: #e5fff3; }
.card[data-cat="cooling"] .card__icon { background: #eaf7ff; }

.features { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 1rem 0; padding: 0; }
.features > li { flex: 1 1 30%; background: #fff; border: 1px solid #eee; border-radius: .8rem; padding: 1rem; box-shadow: var(--shadow); }
.features > li h3 { margin: .1rem 0 .3rem; color: var(--brand-dark); }

.site-footer { background: #111; color: #ddd; padding: 1rem 0; margin-top: 2rem; }
.footer__grid { display: flex; justify-content: space-between; align-items: center; }
.footer__links { list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0; }
.footer__links a { color: #aaa; text-decoration: none; }
.footer__links a:hover { color: #fff; }

.nav__list li + li {
    margin-left: 1.5rem;
}


.component-table-section {
    margin: 4rem auto;
    max-width: 1100px;
}

.component-table {
    width: 100%;
    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: 768px) {
    .resume-header {
        flex-direction: column;
    }

    .resume {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 1024px) {
  .card { flex-basis: calc(33.333% - 1rem); }
}
@media (max-width: 768px) {
  .card { flex-basis: calc(50% - 1rem); }
  .nav { position: fixed; top: 56px; left: 0; right: 0; background: #111; transform: translateY(-120%); transition: .25s; }
  .nav[data-open="true"] { transform: translateY(0); }
  .nav__list { flex-direction: column; padding: 1rem; }
}
@media (max-width: 480px) {
  .search .btn { display: none; }
  .logo { display: none; }
  .card { flex-basis: 100%; }
  .card__icon { width: 64px; height: 64px; }
}

@media (orientation: landscape) and (max-width: 768px) {
  .hero {
    padding: 1.2rem 0;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  animation: fadeUp .4s ease-out;
}

.catalog .card {
  animation: fadeUp .4s ease-out;
}

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

.burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

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



  /* Кнопка калькулятора */
  #calculator-icon {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #007bff;
    color: white;
    font-size: 32px;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    z-index: 1000;
  }
  #calculator-icon:hover {
    transform: scale(1.15);
  }

  /* Модальне затемнення */
  #calculator-modal.hidden {
    display: none;
  }
  #calculator-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
  }

  /* Контейнер з калькулятором */
  .modal-content {
    background: white;
    padding: 20px;
    width: 300px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
  }

  /* Закрити */
  #calc-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 26px;
    cursor: pointer;
  }

  /* Стиль калькулятора — дисплей і кнопки */
  .display {
    width: 100%;
    height: 50px;
    margin-bottom: 12px;
    font-size: 24px;
    text-align: right;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
  }

  .buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  button {
    padding: 12px;
    font-size: 18px;
    border-radius: 6px;
    border: 1px solid #aaa;
    cursor: pointer;
    background: #f8f8f8;
  }
  button.operator {
    background: #e0f0ff;
  }
  button.equal {
    background: #d0ffd0;
    grid-column: span 2;
  }
  button.clear {
    background: #ffd0d0;
    grid-column: span 2;
  }
  button:active {
    transform: scale(0.95);
  }



.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; }
}
