:root {
  --brand-color: #de0025;
  --accent-color: #ef6644;
  --text-color: #242222;
  --muted-color: #6f6f6f;
  --bg-surface: #ffffff;
  --shadow-strong: 0 10px 25px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--text-color);
  background: #f5f5f5;
}

header.catalog-header {
  background: linear-gradient(120deg, #e80052, #d4d100);
  color: #fff;
  padding: 1.5rem 2rem 2rem;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 18px 48px rgba(14, 4, 22, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

header.catalog-header .catalog-header__main {
  display: grid;
  grid-template-columns: 300px 1fr auto;
  gap: 2rem;
  align-items: start;
  margin-bottom: 1rem;
}

header.catalog-header .catalog-header__left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

header.catalog-header .catalog-header__center {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

header.catalog-header .catalog-header__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

header.catalog-header .catalog-header__logo {
  display: block;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
}

header.catalog-header .catalog-header__subtitle {
  margin: 0.25rem 0 0;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
}

header.catalog-header .catalog-header__shortcuts {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.87;
  justify-content: center;
}

header.catalog-header .catalog-header__shortcuts span {
  cursor: pointer;
  transition: all 0.2s;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

header.catalog-header .catalog-header__shortcuts span:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

header.catalog-header .catalog-header__shortcuts span.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

header.catalog-header__search {
  margin-bottom: 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.catalog-search-input {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.5rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  width: min(720px, 100%);
}

.catalog-search-input input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  font-weight: 500;
  color: #121212;
}

.catalog-search-input input::placeholder {
  color: #686868;
}

.catalog-search-input input:focus {
  outline: none;
}

.catalog-search-input button {
  border: none;
  background: #1f58ff;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.catalog-search-input button:hover {
  background: #1029d6;
}

.catalog-header__meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
  opacity: 0.8;
}

.catalog-container {
  max-width: 100%;
  margin: -1.5rem 0 3rem;
  padding: 2rem 3rem;
  background: transparent;
}

.catalog-panel {
  background: var(--bg-surface);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(15, 15, 15, 0.08);
}

.catalog-section {
  margin-bottom: 2rem;
}

.catalog-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.catalog-section-title h2 {
  margin: 0;
  font-size: 1.25rem;
}

.categories {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.category-card {
  flex: 0 0 220px;
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.category-card strong {
  display: block;
  font-size: 1rem;
  color: var(--brand-color);
}

.category-card p {
  font-size: 0.9rem;
  color: var(--muted-color);
  margin: 0.3rem 0 0;
}

.products {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

.product-card {
  background: var(--bg-surface);
  border-radius: 18px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: var(--shadow-strong);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}

.product-card img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  border-radius: 12px;
  background: #f9f9f9;
  padding: 8px;
}

.product-card h3 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.1rem;
}

.product-card p {
  color: var(--muted-color);
  flex-grow: 0;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #e80052;
}

.old-price {
  font-size: 0.95rem;
  text-decoration: line-through;
  color: var(--muted-color);
}

.product-card button {
  margin-top: auto;
  padding: 0.65rem 1.2rem;
  border-radius: 10px;
  border: none;
  background: var(--accent-color);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.product-card button:hover {
  transform: translateY(-1px);
}

.tag {
  background: rgba(255, 239, 182, 0.9);
  color: #7a5600;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  display: inline-block;
}

.filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filters select {
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
}

.filters input {
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  min-width: 220px;
}

.loader,
.error-message {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted-color);
}

.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.pagination button {
  border: none;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
  cursor: pointer;
  font-weight: 600;
}

.pagination button.active {
  background: var(--brand-color);
  color: #fff;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button.dots {
  background: transparent;
  cursor: default;
  opacity: 0.6;
}

.section-title {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.section-title > h3 {
  display: inline-block;
  position: relative;
  margin-bottom: 0.5rem;
}

.section-title > h3::before,
.section-title > h3::after {
  content: "";
  width: 40px;
  height: 2px;
  background: var(--muted-color);
  position: absolute;
  bottom: -6px;
}

.section-title > h3::before {
  left: -45px;
}

.section-title > h3::after {
  right: -45px;
}

.catalog-banner {
  border-radius: 22px;
  background: linear-gradient(135deg, #0040dec9, #8a007e);
  padding: 2rem;
  color: #fff;
  margin-bottom: 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.catalog-banner h3 {
  margin: 0;
  font-size: 1.7rem;
}

.catalog-banner p {
  margin: 0.35rem 0 1rem;
  font-weight: 300;
}

.catalog-banner button {
  border-radius: 999px;
  background: #fff;
  color: var(--brand-color);
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ===== RESPONSIVE STYLES ===== */

/* Large tablets and small desktops */
@media (min-width: 1201px) and (max-width: 1600px) {
  .products {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1200px) {
  .products {
    grid-template-columns: repeat(3, 1fr);
  }

  .catalog-container {
    padding: 2rem 2rem;
  }
  
  header.catalog-header .catalog-header__main {
    grid-template-columns: 1fr 1fr auto;
    gap: 1.5rem;
  }
}

/* Mobile and small tablets */
@media (max-width: 768px) {
  /* Header mobile */
  header.catalog-header {
    padding: 1rem;
    border-radius: 0 0 16px 16px;
  }
  
  header.catalog-header .catalog-header__main {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }
  
  header.catalog-header .catalog-header__left {
    align-items: center;
  }
  
  header.catalog-header .catalog-header__logo {
    font-size: 1.4rem;
  }
  
  header.catalog-header .catalog-header__subtitle {
    font-size: 0.85rem;
  }
  
  header.catalog-header .catalog-header__shortcuts {
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
  }
  
  header.catalog-header .catalog-header__shortcuts span {
    padding: 0.4rem 0.75rem;
  }
  
  /* Search mobile */
  .catalog-search-input {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 16px;
  }
  
  .catalog-search-input input {
    width: 100%;
    font-size: 1rem;
    padding: 0.5rem;
    text-align: center;
  }
  
  .catalog-search-input button {
    width: 100%;
    padding: 0.75rem;
  }

  /* Categories mobile */
  .categories {
    gap: 0.75rem;
  }
  
  .category-card {
    flex: 0 0 160px;
    padding: 0.75rem;
  }
  
  .category-card strong {
    font-size: 0.9rem;
  }
  
  .category-card p {
    font-size: 0.8rem;
  }

  /* Products grid mobile */
  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .product-card {
    padding: 0.75rem;
    min-height: 280px;
    border-radius: 14px;
  }
  
  .product-card img {
    height: 160px;
    border-radius: 10px;
    padding: 4px;
  }
  
  .product-card h3 {
    font-size: 0.9rem;
    margin: 0.5rem 0 0.2rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .product-card p {
    font-size: 0.8rem;
  }
  
  .price-row {
    margin-top: 0.3rem;
  }
  
  .price {
    font-size: 1.1rem;
  }
  
  .old-price {
    font-size: 0.8rem;
  }
  
  .product-card button {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 8px;
  }

  /* Filters mobile */
  .filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .filters select,
  .filters input {
    width: 100%;
    min-width: unset;
    padding: 0.75rem;
  }

  /* Banner mobile */
  .catalog-banner {
    padding: 1.25rem;
    border-radius: 16px;
  }
  
  .catalog-banner h3 {
    font-size: 1.3rem;
  }
  
  .catalog-banner p {
    font-size: 0.9rem;
  }
  
  .catalog-banner button {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
  }

  /* Container mobile */
  .catalog-container {
    padding: 1.5rem 0.75rem;
    margin-top: -1rem;
  }
  
  .catalog-panel {
    padding: 1rem;
    border-radius: 16px;
  }
  
  .catalog-section {
    margin-bottom: 1.5rem;
  }
  
  .catalog-section-title h2 {
    font-size: 1.1rem;
  }

  /* Pagination mobile */
  .pagination {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  
  .pagination button {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
  }

  /* Tags mobile */
  .tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
  }
}

/* Small mobile phones */
@media (max-width: 480px) {
  .products {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .product-card {
    flex-direction: row;
    padding: 0.75rem;
    min-height: auto;
    gap: 1rem;
  }
  
  .product-card img {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
  }
  
  .product-card h3 {
    -webkit-line-clamp: 3;
  }
  
  header.catalog-header .catalog-header__shortcuts {
    display: none;
  }
  
  .category-card {
    flex: 0 0 140px;
  }
}
