/* Import Unified Color Palette */
@import url('colors.css');
/* Import Unified Header Styles */
@import url('header.css');
/* Import Unified Button Styles */
@import url('buttons.css');

body {
  margin: 0;
  background: var(--bgGradient);
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--textDark);
  line-height: 1.6;
  padding-top: 100px;
  padding-left: 40px;
  padding-right: 40px;
  padding-bottom: 80px;
}

* {
  box-sizing: border-box;
}

/* ================================= */
/* Main Layout - Modern & Clean      */
/* ================================= */
main {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 40px 20px;
  max-width: 1600px;
  margin: 0 auto;
}

.main-content {
  flex: 1;
  width: 100%;
}

/* ================================= */
/* Controls Section - Modern         */
/* ================================= */
.controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 20px 0 40px;
  padding: 0;
}

.controls select {
  padding: 14px 50px 14px 20px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
  cursor: pointer;
  min-width: 200px;
  font-weight: 600;
  color: var(--textDark);
  font-family: 'Poppins', sans-serif;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2322c55e' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.controls select:focus {
  outline: none;
  border-color: var(--greenNormal);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1), 0 4px 12px rgba(34, 197, 94, 0.15);
  transform: translateY(-1px);
}

.controls select:hover {
  border-color: var(--greenNormal);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
  transform: translateY(-1px);
}

.controls select option {
  padding: 12px 20px;
  font-weight: 500;
  color: var(--textDark);
  font-family: 'Poppins', sans-serif;
}

.controls select option:hover {
  background: var(--greenLight);
}

.controls select option:checked {
  background: var(--greenNormal);
  color: white;
}

/* ================================= */
/* Products Grid - Modern Layout     */
/* ================================= */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

/* ================================= */
/* Product Card - Modern Design      */
/* ================================= */
.product-card {
  width: 100%;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(34, 197, 94, 0.2);
}

/* ================================= */
/* Product Image - Modern            */
/* ================================= */
.product-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: all 0.5s ease;
  background: linear-gradient(135deg, var(--greenLight), var(--greenLightHover));
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

/* ================================= */
/* Card Body - Clean Layout          */
/* ================================= */
.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 12px;
}

.card-title,
.card-body h5,
.card-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--textDark);
  margin: 0;
  line-height: 1.4;
  font-family: 'Poppins', sans-serif;
  min-height: 52px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body .text-muted {
  color: var(--textSecondary);
  font-size: 14px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  padding: 5px 0;
}

.card-body .d-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

/* ================================= */
/* Price - Modern Styling            */
/* ================================= */
.price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--greenNormal);
  font-family: 'Poppins', sans-serif;
  margin: 0;
}

/* ================================= */
/* Action Buttons - Unified          */
/* ================================= */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ================================= */
/* Pagination - Modern Design        */
/* ================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 60px 0 40px;
  padding: 25px 30px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ================================= */
/* Responsive Design                 */
/* ================================= */
@media (max-width: 1200px) {
  .cards-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 100px 20px 60px;
  }

  main {
    padding: 20px 10px;
  }

  .cards-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
  }

  .controls {
    justify-content: center;
  }

  .controls select {
    width: 100%;
    max-width: 300px;
  }

  .product-image {
    height: 200px;
  }

  .card-body {
    padding: 20px;
  }

  .actions {
    flex-direction: column;
    gap: 8px;
  }

  .actions button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .cards-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .product-card {
    max-width: 100%;
  }
}
