/* CSS Variables */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}
:root {
    --primary-green: #375735; /* Dark Green for text/buttons */
    --secondary-green: #4CAF50; /* Light Green for accents */
    --light-bg: #F8F4F0; /* Off-white background */
    --text-dark: #333333;
    --text-light: #888888;
    --price-red: #D22B2B; /* For discounted price */
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

body{
    background-color: var(--light-bg);
}




.product-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    
}

/* Header and Title */
.header {
    margin-bottom: 2rem;
}

.header h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.header p {
    font-size: 1rem;
    color: var(--text-light);
}

/* Filtering and Sorting Bar (Flexbox) */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-input, .dropdown-select {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #fff;
    color: var(--text-dark);
    position: relative;
}

.search-input {
    flex-grow: 2; /* Allow search input to take more space */
}

.dropdown-select {
    flex-grow: 1; 
    max-width: 250px;
}

.filter-bar input[type="text"], .filter-bar select {
    border: none;
    outline: none;
    padding: 0;
    margin-left: 0.5rem;
    flex-grow: 1;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: transparent;
    -webkit-appearance: none; /* Remove default arrow on select */
    -moz-appearance: none;
    appearance: none;
}

.dropdown-select {
    position: relative;
}

/* Custom dropdown arrow for select */
.dropdown-select::after {
    content: '▼';
    font-size: 0.75rem;
    color: var(--text-dark);
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Product Count */
.product-count {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    width: 100%; /* Ensure it takes full width below the filter bar */
}

/* Product Grid (CSS Grid) */
.product-grid {
    display: grid;
    gap: 1.5rem;
    /* Default: 1 column for mobile */
    grid-template-columns: 1fr;
}

/* Product Card */
.product-card {
    background-color: #fff;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Image Section */
.card-image-wrapper {
    position: relative;
    padding: 1rem; /* Inner padding for the image box */
    background-color: #f7f7f7; /* Light background for the image area */
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
    text-align: center;
}

.card-image-wrapper img {
    width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background-color: var(--price-red);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.stock-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--price-red);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Details Section */
.category-tag {
    color: var(--secondary-green);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.product-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
}

.product-card .description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    flex-grow: 1; /* Key for equal card height alignment */
}

/* Price */
.price-group {
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-green);
}

.original-price {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
}

/* Buttons (Flexbox) */
.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto; /* Push buttons to the bottom */
}

.btn {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s;
    flex: 1;
}

.btn-details {
    border: 1px solid var(--primary-green);
    background-color: transparent;
    color: var(--primary-green);
}

.btn-details:hover {
    background-color: rgba(55, 87, 53, 0.05);
}

.btn-cart {
    border: 1px solid var(--primary-green);
    background-color: var(--primary-green);
    color: #fff;
}

.btn-cart:hover {
    background-color: #2a4128;
}

.btn-disabled {
    background-color: #cccccc;
    color: #666666;
    border-color: #cccccc;
    cursor: not-allowed;
}

/* --- Media Queries for Responsiveness --- */

/* Tablet Layout (2 columns) */
@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .filter-bar {
        flex-wrap: nowrap;
    }
}

/* Desktop Layout (3 columns) */
@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}



.suggestions {
  position: absolute; 
  width: 100%;
  top: 100%; 
  left: 0px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto; 
  z-index: 1000;
  padding: 8px 0;
  margin-top: 1px;
  list-style-type: none;
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  color: #333;
  font-size: 16px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.suggestion-item:hover {
  background-color: #f5f5f5;
  color: #007bff;
}


.suggestion-item::before {
  content: "⌕";
  margin-right: 8px;
  font-size: 14px;
  vertical-align: middle;
}