:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dde3ea;
  --line2: #e8edf3;
  --text: #111827;
  --muted: #6b7280;
  --brand: #1357d9;
  --accent: #ef4444;
  --footer: #07152f;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 18px;
  --radius-sm: 14px;
  --wrap: 760px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 1000;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.skip-link:focus {
  clip: auto;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  white-space: normal;
}

.wrap {
  width: min(calc(100% - 24px), var(--wrap));
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(180deg, #f7f9fd 0%, #e9eef6 100%);
  border-bottom: 1px solid #d4dbe6;
}

.header-row {
  display: grid;
  grid-template-columns: 220px minmax(280px, 1fr) 160px;
  gap: 20px;
  align-items: center;
  padding: 18px 0 16px;
}

.site-brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand);
}

.site-search {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.site-search input {
  width: 100%;
  max-width: 380px;
  height: 40px;
  border: 1px solid #c8d0dc;
  border-radius: 10px;
  background: #fff;
  padding: 0 14px;
  font: inherit;
  outline: none;
}

.site-search input:focus {
  border-color: #aebbd0;
  box-shadow: 0 0 0 3px rgba(19, 87, 217, 0.08);
}

.site-search button {
  height: 40px;
  border: 1px solid #c8d0dc;
  border-radius: 10px;
  background: #fff;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.header-icons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.header-icons a {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid #eef2f6;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.header-icons svg {
  width: 18px;
  height: 18px;
  fill: #111827;
}

.home-page {
  padding: 20px 0 12px;
}

.home-section {
  margin: 0 0 26px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  position: relative;
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
}

.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -13px;
  width: 52px;
  height: 4px;
  border-radius: 999px;
  background: #ff5a5f;
}

.section-head-split {
  justify-content: space-between;
}

.section-head-split a {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

.category-shell,
.product-shell {
  margin-top: 14px;
  border: 1px solid #d8e0ea;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
  border-radius: 20px;
  padding: 14px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.category-card {
  min-width: 0;
  min-height: 96px;
  background: #fff;
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.category-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #f4f6f8;
  border: 1px solid #e7ebf0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.category-icon-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.category-label {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  text-align: center;
  word-break: break-word;
}

.category-icon-fallback {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #cfd4dc;
  display: block;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  min-width: 0;
}

.product-card-link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  min-height: 250px;
  background: #fff;
  border: 1px solid var(--line2);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.product-card-link:hover {
  transform: translateY(-2px);
  border-color: #d7e0ea;
  box-shadow: var(--shadow-md);
}

.product-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 140px;
  margin: 0 auto 8px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid #edf1f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.product-card h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.01em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: calc(1.35em * 2);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.price {
  margin-top: 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
  color: #ef4444;
  letter-spacing: -0.01em;
  min-height: 30px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.price:empty::before {
  content: "Qiymət yoxdur";
  color: #ef4444;
  font-size: 15px;
  font-weight: 800;
}

.site-footer {
  margin-top: 12px;
  background: var(--footer);
  color: #fff;
  border-radius: 18px 18px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 28px;
  padding: 22px 18px 18px;
}

.footer-brand h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.footer-brand p {
  margin: 0;
  font-size: 12px;
  color: #d6ddea;
}

.footer-links h3 {
  margin: 0 0 10px;
  font-size: 12px;
}

.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li + li {
  margin-top: 10px;
}

.footer-links a {
  font-size: 12px;
  color: #fff;
}

@media (max-width: 1100px) {
  :root {
    --wrap: 1000px;
  }

  .header-row {
    grid-template-columns: 180px minmax(220px, 1fr) 140px;
  }

  .product-thumb {
    max-width: 150px;
  }
}

@media (max-width: 820px) {
  .wrap {
    width: min(calc(100% - 20px), 100%);
  }

  .header-row {
    grid-template-columns: 170px 1fr 128px;
    gap: 14px;
  }

  .category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product-grid {
    gap: 12px;
  }

  .product-card-link {
    min-height: 260px;
  }

  .product-thumb {
    max-width: 130px;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(calc(100% - 12px), 100%);
  }

  .site-header {
    border-top: 0;
  }

  .header-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px 0 10px;
  }

  .site-brand {
    font-size: 17px;
  }

  .site-search {
    display: none;
  }

  .header-icons a {
    width: 36px;
    height: 36px;
  }

  .home-page {
    padding-top: 8px;
  }

  .home-section {
    margin-bottom: 22px;
  }

  .section-head {
    padding-bottom: 10px;
  }

  .section-head h2 {
    font-size: 15px;
  }

  .section-head h2::after {
    bottom: -11px;
    width: 44px;
    height: 4px;
  }

  .category-shell,
  .product-shell {
    padding: 10px;
    border-radius: 16px;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .category-card {
    min-height: 88px;
    border-radius: 14px;
  }

  .category-icon {
    width: 40px;
    height: 40px;
  }

  .category-label {
    font-size: 11px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

.product-card-link {
  min-height: 210px;
  padding: 10px;
  border-radius: 16px;
}

.product-thumb {
  max-width: 100px;
  margin-bottom: 8px;
  border-radius: 12px;
}

  .product-card h3 {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .price,
  .price:empty::before {
    font-size: 14px;
  }

  .site-footer {
    border-radius: 14px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 16px 12px 18px;
  }

  .footer-links li + li {
    margin-top: 12px;
  }
}