/* ===== CSS VARIABLES ===== */
:root {
  --primary-black: #000000;
  --primary-white: #ffffff;
  --primary-grey: #808080;
  --light-grey: #f5f5f5;
  --dark-grey: #333333;
  --background-grey: #f8f8f8;
  --border-grey: #e0e0e0;

  /* Color swatches for products */
  --color-white: #ffffff;
  --color-black: #000000;
  --color-purple: #dda0dd;
  --color-blue: #87ceeb;

  /* Typography */
  --font-primary: "Arial", sans-serif;
  --font-secondary: "Helvetica", sans-serif;

  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
}

/* ===== GLOBAL RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--primary-black);
  background-color: var(--background-grey);
  background-image: radial-gradient(
      circle at 25% 25%,
      rgba(0, 0, 0, 0.02) 1px,
      transparent 1px
    ),
    radial-gradient(circle at 75% 75%, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

@media (max-width: 768px) {
  .container {
    padding: 0;
    width: 95% !important;
  }
}


/* ===== MAIN CONTENT ===== */
.main-content {
  padding: var(--spacing-xl) 0;
}

.main-content .container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--spacing-xl);
  align-items: start;
}

/* ===== SIDEBAR - FILTERS ===== */
.sidebar {
  position: sticky;
  top: 100px;
  height: 100%;
  max-height: 90vh;

  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.filters-panel {
  background-color: var(--primary-white);
  border-radius: 5px;
  padding: var(--spacing-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.filters-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: var(--spacing-lg);
}

.filters-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-black);
  margin-bottom: 0;
}

.filters-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--primary-black);
  font-size: 20px;
  cursor: pointer;
}

.filters-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border-grey);
  border-radius: 5px;
  background: var(--primary-white);
  color: var(--primary-black);
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.filters-menu-btn:hover {
  background: var(--light-grey);
  border-color: var(--primary-black);
}

.filters-overlay {
  display: none;
}

.clear-filters-mobile {
  display: none;
  width: 100%;
  margin-top: var(--spacing-md);
}

.filter-section {
  margin-bottom: var(--spacing-lg);
  width: 100% !important;
  padding: 0 1rem !important;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-black);
  display: block;
  margin-bottom: var(--spacing-sm);
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: var(--spacing-xs) 0;
}

.filter-header .filter-label {
  margin-bottom: 0;
}

.filter-header i {
  font-size: 12px;
  color: var(--primary-grey);
  transition: transform 0.3s ease;
}

/* ===== SIZE BUTTONS ===== */
.size-buttons {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

.size-btn {
  min-width: 40px;
  height: 36px;
  border: 1px solid var(--border-grey);
  background-color: var(--primary-white);
  color: var(--primary-black);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.size-btn:hover {
  border-color: var(--primary-black);
}

.size-btn.active {
  background-color: var(--primary-black);
  color: var(--primary-white);
  border-color: var(--primary-black);
}

/* ===== CHECKBOX STYLES ===== */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  position: relative;
}

.checkbox-item input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-grey);
  border-radius: 3px;
  position: relative;
  transition: all 0.3s ease;
}

.checkbox-item input[type="checkbox"]:checked + .checkmark {
  background-color: var(--primary-black);
  border-color: var(--primary-black);
}

.checkbox-item input[type="checkbox"]:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid var(--primary-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  font-size: 14px;
  color: var(--primary-black);
}

/* ===== MAIN CONTENT AREA ===== */
.main-content-area {
  display: flex;
  flex-direction: column;
  gap: 0 !important;
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 14px;
  color: var(--primary-grey);
}

.breadcrumbs i {
  font-size: 12px;
}

.breadcrumbs span:last-child {
  color: var(--primary-black);
  font-weight: 500;
}

/* ===== PAGE TITLE ===== */
.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-black);
  margin-bottom: var(--spacing-sm);
}

/* ===== SEARCH SECTION ===== */
.search-section {
  margin-bottom: var(--spacing-md);
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 600px;
}

.search-bar i {
  position: absolute;
  left: var(--spacing-sm);
  color: var(--primary-grey);
  font-size: 16px;
}

.search-bar input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) 48px;
  border: 1px solid var(--border-grey);
  border-radius: 4px;
  font-size: 16px;
  background-color: var(--light-grey);
  outline: none;
  transition: border-color 0.3s ease;
}

.search-bar input:focus {
  border-color: var(--primary-grey);
}

.search-bar input::placeholder {
  color: var(--primary-grey);
}

/* ===== CATEGORY BUTTONS ===== */
.category-buttons {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-lg);
}

.category-btn {
  padding: var(--spacing-xs) var(--spacing-md);
  border: 1px solid var(--border-grey);
  background-color: var(--primary-white);
  color: var(--primary-black);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
  white-space: nowrap;
}

.category-btn:hover {
  border-color: var(--primary-black);
}

.category-btn.active {
  background-color: var(--primary-black);
  color: var(--primary-white);
  border-color: var(--primary-black);
}

/* ===== PRODUCTS GRID ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.product-card {
  background-color: var(--primary-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.product-image {
  width: 100%;
  height: 320px;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-info {
  padding: var(--spacing-md);
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-black);
  margin-bottom: var(--spacing-xs);
}

.color-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
}

.color-swatch {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid var(--border-grey);
}

.color-swatch.white {
  background-color: var(--color-white);
}

.color-swatch.black {
  background-color: var(--color-black);
}

.color-swatch.purple {
  background-color: var(--color-purple);
}

.color-swatch.blue {
  background-color: var(--color-blue);
}

.color-count {
  font-size: 12px;
  color: var(--primary-grey);
  font-weight: 500;
}

.product-description {
  font-size: 14px;
  color: var(--primary-grey);
  margin-bottom: var(--spacing-sm);
  line-height: 1.4;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-black);
}

.product-price .woocommerce-Price-amount,
.product-price .amount {
  font-weight: 700;
}

.product-price del {
  opacity: 0.65;
  font-weight: 500;
}

.product-price del .woocommerce-Price-amount {
  text-decoration: line-through;
}

.product-price ins {
  text-decoration: none;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .main-content .container {
    grid-template-columns: 250px 1fr;
    gap: var(--spacing-lg);
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .page-title {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .main-content .container {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .filters-menu-btn {
    display: flex;
    width: 50px !important;
    height: 50px !important;
  }

  .filters-menu-btn i {
    font-size: 20px !important;
  }

  .search-bar {
   width: calc(100% - 70px);
  }

  .clear-filters-btn:not(.clear-filters-mobile) {
    display: none;
  }

  .clear-filters-mobile {
    display: block;
  }

  .filters-close-btn {
    display: flex;
  }

  .filters-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  body.filters-popup-open .filters-overlay {
    opacity: 1;
    visibility: visible;
  }

  .sidebar.filters-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    order: unset;
    width: min(320px, 88vw);
    max-width: 88vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: var(--spacing-md);
    box-sizing: border-box;
    background: var(--primary-white);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.filters-popup-open .sidebar.filters-sidebar {
    transform: translateX(0);
  }

  body.filters-popup-open {
    overflow: hidden;
  }

  .sidebar.filters-sidebar .filters-panel {
    width: 100%;
    box-shadow: none;
    padding: 0;
    align-items: stretch;
  }

  .main-content-area {
    order: 1;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
  }

  .category-buttons {
    gap: var(--spacing-xs);
  }

  .category-btn {
    font-size: 12px;
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .nav-links {
    display: none;
  }

  .hamburger-menu {
    display: block;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 24px;
  }

  .product-image {
    height: auto !important;
  }

  .product-card img {
    margin-bottom: 0 !important;
  }

  .filters-panel {
    padding: var(--spacing-md);
  }

  .category-buttons {
    justify-content: center;
  }
}
