:root {
  --bg: #140f0d;
  --bg-soft: #201814;
  --card: rgba(255, 255, 255, 0.11);
  --card-border: rgba(255, 255, 255, 0.22);
  --text: #fff9f2;
  --text-muted: #e3d8cf;
  --primary: #d48a49;
  --secondary: #8b4f2f;
  --shadow-soft: 0 14px 28px rgba(0, 0, 0, 0.22);
  --pill-bg: rgba(255, 255, 255, 0.08);
  --pill-border: rgba(255, 255, 255, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}

.page {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--primary) 72%, transparent) 0%,
      color-mix(in srgb, var(--secondary) 82%, transparent) 52%,
      rgba(0, 0, 0, 0.93) 100%
    );
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 1.25rem 1rem 1.4rem;
}

.hero__logo {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-soft);
}

.hero__title {
  margin: 0.8rem 0 0.35rem;
  font-size: 1.55rem;
}

.hero__description {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 46ch;
  font-size: 0.95rem;
}

.fade-in {
  animation: softFade 560ms ease-out both;
}

@keyframes softFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 1rem 0.95rem 2rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.section-head p {
  margin: 0.3rem 0 0.95rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.skeleton-wrapper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.skeleton-card {
  height: 96px;
  border-radius: 18px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(255, 255, 255, 0.14) 38%,
    rgba(255, 255, 255, 0.08) 60%
  );
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: 130% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.categories-grid {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.categories-grid.is-ready {
  display: grid;
}

.category-card {
  min-height: 96px;
  padding: 0.7rem 0.35rem;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.13);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.category-card:hover,
.category-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.category-card:active {
  transform: scale(0.97);
}

.category-card__icon {
  font-size: 1.24rem;
}

.category-card__icon-image {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
}

.category-card__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.section-hero {
  position: relative;
  min-height: 255px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.section-hero__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 20%, rgba(0, 0, 0, 0.72) 100%);
}

.section-hero__content {
  position: relative;
  z-index: 2;
  padding: 1.2rem 1rem 1.1rem;
}

.section-hero__label {
  margin: 0 0 0.4rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.section-hero__title {
  margin: 0;
  font-size: 1.65rem;
}

.category-pills-wrap {
  padding-top: 0.9rem;
  padding-bottom: 0.75rem;
}

.category-pills {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  white-space: nowrap;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.pill:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.15);
}

.pill:active {
  transform: scale(0.97);
}

.pill.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

a.pill {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.products-section {
  padding-top: 0.3rem;
}

.products-skeleton {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.skeleton-product {
  height: 194px;
  border-radius: 18px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(255, 255, 255, 0.14) 38%,
    rgba(255, 255, 255, 0.08) 60%
  );
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.products-grid.is-hidden {
  display: none;
}

.product-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.16);
  transition: transform 200ms ease, box-shadow 200ms ease;
  cursor: pointer;
}

a.product-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.24);
}

.product-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.product-card.is-hidden {
  display: none;
}

.product-card__image-wrap {
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.product-card:hover .product-card__image {
  transform: scale(1.06);
}

.product-card__body {
  padding: 0.62rem 0.62rem 0.7rem;
}

.product-card__name {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
}

.product-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.product-card__price {
  color: var(--primary);
  font-weight: 700;
}

.product-details {
  padding-bottom: 2rem;
}

.product-details.is-hidden {
  display: none;
}

.product-details__hero {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}

.product-details__cover {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
  transform: translateY(0);
  transition: transform 180ms linear;
}

.product-details__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.16) 20%, rgba(0, 0, 0, 0.55) 100%);
}

.product-details__back,
.section-hero__back {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  text-decoration: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.46rem 0.9rem;
  font-size: 0.84rem;
}

.section-hero__back:hover {
  background: rgba(0, 0, 0, 0.5);
}

.section-hero__back:active {
  transform: scale(0.97);
}

.product-details__content {
  padding-top: 1.15rem;
}

.product-details__category {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.product-details__title {
  margin: 0.36rem 0 0.52rem;
  font-size: 1.7rem;
  line-height: 1.35;
}

.product-details__description {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.85;
  font-size: 0.95rem;
}

.product-details__meta {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 0.72rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.meta-pill strong {
  font-size: 0.9rem;
}

.details-skeleton {
  padding-top: 0.9rem;
}

.details-skeleton[hidden] {
  display: none;
}

.details-skeleton__hero,
.details-skeleton__line {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(255, 255, 255, 0.14) 38%,
    rgba(255, 255, 255, 0.08) 60%
  );
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
}

.details-skeleton__hero {
  height: 240px;
  border-radius: 22px;
}

.details-skeleton__line {
  height: 18px;
  margin-top: 0.7rem;
  border-radius: 999px;
}

.details-skeleton__line--title {
  margin-top: 1rem;
  width: 60%;
  height: 26px;
}

.details-skeleton__line--short {
  width: 38%;
}

@media (min-width: 640px) {
  .hero {
    min-height: 400px;
  }

  .hero__content {
    padding: 1.5rem 1.4rem 1.8rem;
  }

  .hero__title {
    font-size: 1.85rem;
  }

  .hero__description {
    font-size: 1rem;
  }

  .container {
    padding-inline: 1.4rem;
  }

  .categories-grid,
  .skeleton-wrapper {
    gap: 0.75rem;
  }

  .category-card,
  .skeleton-card {
    min-height: 110px;
  }

  .section-hero {
    min-height: 310px;
  }

  .section-hero__title {
    font-size: 2rem;
  }

  .products-grid,
  .products-skeleton {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product-details__hero,
  .product-details__cover {
    min-height: 420px;
  }

  .product-details__title {
    font-size: 2rem;
  }
}

@media (min-width: 992px) {
  .hero {
    min-height: 460px;
  }

  .hero__content {
    padding-inline: 2rem;
  }

  .container {
    padding-inline: 2rem;
  }

  .products-grid,
  .products-skeleton {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.page--not-found,
.page--api-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  text-align: center;
}

.page--not-found .section-head,
.page--api-error .section-head {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  margin: 0;
  max-width: 28rem;
}
