:root {
  --bg: #F9F9F9;
  --yellow: #FDBD0E;
  --blue: #2667FF;
  --blue-soft: #5AA9E6;
  --neutral-900: #363842;
  --neutral-700: #636A6D;
  --neutral-500: #9DA4A8;
  --neutral-400: #C4CACE;
  --border: #D8D9E0;
  --card: #FFFFFF;
  --shadow: 0 2px 2px rgba(0, 0, 0, .25);
  --sidebar-width: 20rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  font-family: "Open Sauce One";
  margin: 0;
  padding: 0;
  background: rgba(249, 249, 249, .96);
  color: #000;
}

img {
  max-width: 100%;
  display: block;
}

select, input, div, button {
  font-family: var(--font-primary);
}

.hero {
  background: var(--yellow);
  padding: 36px 24px 56px;
  text-align: center;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin: 0 0 8px;
  color: #000;
}

.hero p {
  font-size: 24px;
  margin: 0 0 18px;
  color: #000;
}

.search-bar {
  max-width: 843px;
  height: 64px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--neutral-400);
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}

.search-icon {
  width: 24px;
  height: 24px;
  opacity: .9;
}

.search-bar input {
  border: 0;
  outline: 0;
  font-size: 20px;
  width: 100%;
  color: var(--neutral-700);
}

.search-bar input::placeholder {
  color: var(--neutral-500);
}

.page {
  max-width: 1280px;
  margin: 36px auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  column-gap: clamp(2rem, 4vw, 3rem);
  row-gap: 32px;
  padding: 0 16px;
}

.filters-card {
  background: #F9F9F9;
  border: 1px solid rgba(152, 162, 179, .42);
  box-shadow: 0 4px 4px rgba(0, 0, 0, .25);
  border-radius: 10px;
  padding: 18px;
  height: fit-content;
}

.filters-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 20px;
  margin-bottom: 14px;
  color: #000;
}

.filters-header img {
  width: 25px;
  height: 25px;
  transform: scaleX(-1);
}

.filter-group {
  margin-top: 16px;
}

.filter-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #000;
}

.input-like select {
  width: 100%;
  height: 42px;
  border: 1px solid #1057C8;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #000;
  cursor: pointer;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-row input {
  width: 100%;
  height: 35px;
  border: 1px solid #D0D5DD;
  border-radius: 5px;
  padding: 0 10px;
  background: #F9F9F9;
  color: #000;
}

.price-row input::placeholder {
  color: #9DA4A8;
}

.price-row .dash {
  width: 16px;
  height: 1px;
  background: rgba(99, 106, 109, .76);
}

.chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.chip {
  border: 0;
  background: rgba(208, 213, 221, .6);
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #000;
}

.chip:hover {
  background: var(--blue-soft);
  color: #fff;
}

.chip.active {
  outline: 2px solid #1057C8;
  background: rgba(208, 213, 221, .8);
}

.content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  margin-bottom: 12px;
}

.content-head p {
  color: #636A6D;
  font-size: 20px;
  margin: 0;
}

.items-select {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  border: 1px solid #eee;
  min-width: 160px;
}

.items-select .label {
  font-size: 14px;
  color: #333;
  opacity: .7;
}

.items-select select {
  border: none;
  outline: none;
  font-size: 16px;
  min-width: 120px;
  background: transparent;
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .page {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 18px;
  }

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

.card {
  background: var(--card);
  border: 1.75px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 0;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: #5AA9E6;
}

.card.out-of-stock {
  opacity: 0.7;
  border-color: #c8cdd2;
}

.card.out-of-stock .thumb {
  filter: grayscale(50%);
}

.card.out-of-stock:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.thumb {
  position: relative;
  background: #D9D9D9;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flag.hot {
  position: absolute;
  left: 12px;
  top: 12px;
  background: #F0787A;
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  z-index: 1;
}

.flag.out-of-stock-label {
  position: absolute;
  left: 12px;
  top: 12px;
  background: #F0787A;
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  z-index: 1;
}

.card-info {
  padding: 14px 16px 60px 16px;
  position: relative;
}

.card .title {
  font-size: 16px;
  font-weight: 500;
  color: #363842;
  margin: 0 0 8px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "Open Sauce One", sans-serif;
}

.card .price {
  font-size: 20px;
  font-weight: 600;
  color: #363842;
  margin: 0 0 12px 0;
  line-height: 1.2;
  font-family: "Open Sauce One", sans-serif;
}

.card .price.muted {
  opacity: .5;
}

.card .shop {
  color: #9DA4A8;
  font-size: 13px;
  margin: 8px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Open Sauce One", sans-serif;
  font-weight: 600;
}

.shop-logo {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  background: #e0e0e0;
  flex-shrink: 0;
}

.card .shop.has-logo {
  display: flex;
  align-items: center;
}

.card .shop:not(.has-logo) .shop-logo {
  display: none;
}

.card .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: #41AF4A;
  color: #FFFFFF;
  border-radius: 12px;
  font-weight: 700;
  font-size: 11px;
  position: absolute;
  bottom: 16px;
  left: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.1;
  max-width: min(calc(100% - 48px), 18ch);
  box-sizing: border-box;
  padding: 6px 12px;
}

.card .badge.gray {
  background: #F0787A;
  color: #FFFFFF;
}

.btn-cart {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: #FDBD0E;
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-family: "Open Sauce One", sans-serif;
}

.btn-cart:hover:not(:disabled) {
  background: #5AA9E6;
  color: #fff;
}

.btn-cart:active:not(:disabled) {
  background: #FDBD0E;
  color: #000;
}

.btn-cart.added {
  background: #41af4a;
  color: #fff;
}

.btn-cart:disabled {
  background: #c8cdd2;
  color: #636A6D;
  cursor: not-allowed;
  opacity: 0.8;
}

.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
  color: var(--neutral-700);
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pagination {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 40px auto !important;
  padding: 20px 0 !important;
  width: 100% !important;
  visibility: visible !important;
  opacity: 1 !important;
  grid-column: 1 / -1 !important;
}

.pagination a {
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--neutral-900);
  font-weight: 600;
  transition: all 0.2s ease;
}

.pagination a:hover {
  background: var(--blue-soft);
  color: #fff;
  border-color: var(--blue-soft);
}

.pagination a.active {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
  pointer-events: none;
}

.skeleton {
  animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
  0% {
    background-color: hsl(200, 20%, 80%);
  }
  100% {
    background-color: hsl(200, 20%, 95%);
  }
}

.skeleton-card {
  background: var(--card);
  border: 1.75px solid var(--border);
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
}

.skeleton-thumb {
  height: 210px;
  background-color: #d9d9d9;
}

.skeleton-text {
  height: 16px;
  margin: 14px 16px 8px;
  border-radius: 4px;
}

.skeleton-price {
  height: 22px;
  width: 60%;
  margin: 0 16px 10px;
  border-radius: 4px;
}