:root {
  --forest-green: #395F33;
  --emerald-green: #209D50;
  --olive-green: #45AA64;
  --sage-green: #6CB97E;
  --mint-green: #90D4A0;
  --pure-white: #ffffff;
  --off-white: #fafbfa;
  --light-gray: #f4f6f4;
  --text-dark: #1a2e1a;
  --text-medium: #4a5d4a;
  --text-light: #7a8d7a;
  --accent-gold: #d4af37;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: #ffffff;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dark);
  min-height: 100vh;
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  line-height: 1.2;
  color: var(--forest-green);
  margin: 0;
}

header {
  text-align: center;
  padding: 60px 20px 40px;
  background: linear-gradient(135deg, var(--forest-green) 0%, var(--emerald-green) 100%);
  color: var(--pure-white);
  position: relative;
  overflow: hidden;
}


.header-content {
  position: relative;
  z-index: 2;
}

.header-content h1 {
  color: var(--pure-white);
  font-size: 3.5rem;
  margin: 0 0 16px;
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: -1px;
  font-weight: 700;
}

.tagline {
  font-size: 1.3rem;
  color: var(--mint-green);
  margin: 0;
  font-weight: 300;
  letter-spacing: 1px;
  opacity: 0.95;
  font-style: italic;
}

/* Top Filters Section */
.filters-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px 20px;
}

.filters-wrapper {
  background: var(--pure-white);
  border-radius: 0;
  padding: 32px;
  border: none;
}

.filters-title {
  font-family: ivypresto-display, serif;
  font-weight: 300;
  font-style: normal;
  font-size: 1.5rem;
  color: var(--forest-green);
  margin: 0 0 24px;
  text-align: center;
  position: relative;
}

/* Search Container */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 24px auto 30px;
}

.search-input {
  width: 100%;
  padding: 16px 50px 16px 20px;
  border: 2px solid var(--sage-green);
  border-radius: 16px;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: var(--text-dark);
  background: var(--pure-white);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.search-input:focus {
  border-color: var(--emerald-green);
  box-shadow: 0 0 0 3px rgba(32, 157, 80, 0.1);
}

.search-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-light);
  color: var(--pure-white);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.search-clear:hover {
  background: var(--emerald-green);
  transform: translateY(-50%) scale(1.1);
}

.search-clear span {
  line-height: 1;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 20px;
  grid-template-areas:
    "btn1 btn2 btn3 btn4 btn5"
    "btn6 btn7 btn8 btn9 btn10";
}

.filter-button {
  border: 2px solid var(--sage-green);
  background: var(--pure-white);
  color: var(--text-medium);
  cursor: pointer;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.3px;
  text-align: center;
  position: relative;
  overflow: hidden;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.filter-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(32, 157, 80, 0.1), transparent);
  transition: left 0.5s;
}

.filter-button:hover::before {
  left: 100%;
}

.filter-button:hover {
  background-color: var(--emerald-green);
  color: var(--pure-white);
  transform: translateY(-2px);
}

.filter-button.active {
  background-color: var(--emerald-green);
  color: var(--pure-white);
  transform: translateY(-2px);
  border-color: var(--emerald-green);
}

.filter-button.active::before {
  display: none;
}

.main-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 30px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 20px;
}

.product-card {
  background: var(--pure-white);
  border-radius: 0;
  padding: 0;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  border: 1px solid #e0e0e0;
  position: relative;
  height: 320px;
}

@media(max-width: 720px) {
  .product-card {
    height: auto;
  }
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover {
  transform: translateY(-12px);
}

.product-card:hover::before {
  opacity: 1;
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}


.product-card:hover img {
  transform: scale(1.08);
}

footer {
  background: linear-gradient(135deg, var(--forest-green) 0%, var(--emerald-green) 100%);
  color: var(--pure-white);
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
}

.footer-content p {
  margin: 0;
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* Loading State */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 20px;
  flex-direction: column;
  color: var(--text-medium);
  grid-column: 1 / -1;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(32, 157, 80, 0.2);
  border-top: 4px solid var(--olive-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--forest-green);
}

/* Smooth Animations */
.fade-in {
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(30px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

/* Pagination Styles */
.pagination-container {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid #e0e0e0;
}

.pagination-info {
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-medium);
  font-size: 14px;
  font-weight: 400;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 8px 16px;
  border: 1px solid var(--sage-green);
  background: var(--pure-white);
  color: var(--text-medium);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  min-width: 80px;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--emerald-green);
  color: var(--pure-white);
  border-color: var(--emerald-green);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f5f5f5;
  color: #999;
  border-color: #ddd;
}

.pagination-numbers {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pagination-number {
  padding: 8px 12px;
  border: 1px solid var(--sage-green);
  background: var(--pure-white);
  color: var(--text-medium);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  min-width: 40px;
  text-align: center;
}

.pagination-number:hover {
  background-color: var(--sage-green);
  color: var(--pure-white);
  border-color: var(--sage-green);
}

.pagination-number.active {
  background-color: var(--emerald-green);
  color: var(--pure-white);
  border-color: var(--emerald-green);
}

.pagination-ellipsis {
  padding: 8px 4px;
  color: var(--text-medium);
  font-weight: bold;
  cursor: default;
}

/* Subcategory Filters */
.subcategory-container {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
  animation: slideDown 0.3s ease-out;
}

.subcategory-title {
  font-family: ivypresto-display, serif;
  font-weight: 300;
  font-style: normal;
  font-size: 1.2rem;
  color: var(--forest-green);
  margin: 0 0 20px;
  text-align: center;
  position: relative;
}

.subcategory-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.subcategory-button {
  border: 1px solid var(--sage-green);
  background: var(--pure-white);
  color: var(--text-medium);
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.2px;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 8px 16px;
  white-space: nowrap;
}

.subcategory-button:hover {
  background-color: var(--sage-green);
  color: var(--pure-white);
  transform: translateY(-1px);
}

.subcategory-button.active {
  background-color: var(--olive-green);
  color: var(--pure-white);
  border-color: var(--olive-green);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .filters-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas: 
      "btn1 btn2"
      "btn3 btn4"
      "btn5 btn6"
      "btn7 btn8"
      "btn9 btn10";
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .header-content h1 {
    font-size: 2.5rem;
  }
  
  .tagline {
    font-size: 1.1rem;
  }
  
  .filters-wrapper {
    padding: 20px;
  }
  
  .search-container {
    margin: 20px 0 20px;
  }
  
  .search-input {
    padding: 14px 45px 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 12px;
  }
  
  .search-clear {
    right: 10px;
    width: 26px;
    height: 26px;
    font-size: 16px;
  }
  
  .filter-button {
    font-size: 14px;
    height: auto;
    min-height: 64px;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
    white-space: normal;
    word-wrap: break-word;
  }
  
  .subcategory-button {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
  }
  
  .product-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    height: auto;
  }
  
  .product-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    display: block;
  }
  
  .filters-container {
    padding: 20px 15px 15px;
  }
  
  .pagination-btn {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 70px;
  }
  
  .pagination-number {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 36px;
  }
}

@media (max-width: 480px) {
  .header-content h1 {
    font-size: 2rem;
  }
  
  .tagline {
    font-size: 1rem;
  }    .filters-grid {
    grid-template-areas:
      "btn1 btn2"
      "btn3 btn4"
      "btn5 btn6"
      "btn7 btn8"
      "btn9 btn10";
    gap: 12px;
    grid-template-columns: repeat(2, 1fr);
  }
  
  .filter-button {
    font-size: 13px;
    height: auto;
    min-height: 56px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
    word-wrap: break-word;
    padding: 12px 8px;
  }
  
  .subcategory-button {
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
    padding: 0 10px;
  }
  
  .product-card {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    height: auto;
  }
  
  .product-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 16px;
    display: block;
  }
  
  .product-card:hover {
    transform: translateY(-2px);
  }
  
  .filters-container {
    padding: 15px 10px;
  }
  
  .filters-wrapper {
    padding: 20px 16px;
  }
  
  .pagination-container {
    margin-top: 30px;
    padding: 20px 0;
  }
  
  .pagination-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 60px;
  }
  
  .pagination-number {
    padding: 6px 8px;
    font-size: 12px;
    min-width: 32px;
  }
}

/* Enhanced Focus and Accessibility */


.product-card:focus-within {
  transform: translateY(-8px);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--sage-green), var(--olive-green));
  border-radius: 5px;
  border: 2px solid var(--light-gray);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--olive-green), var(--forest-green));
}
