* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* font-family: Poppins, sans-serif; */
}

body {
    background: #f7f3ea;
    color: #333;
}

/* Main Container */
.shop-container {
    width: 90%;
    margin: 40px auto;
}

/* Filters Section */
.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.search-box,
.category-filter,
.price-filter {
    padding: 12px 15px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid #d5c5b0;
    outline: none;
    background: #fff;
    min-width: 180px;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 60px;
    min-height: 80vh;
    justify-content: center;
    justify-items: center;
}

.product-card {
  /* Your existing styles... */
  background-color: #fff;
  width: 260px;
  height: 400px; /* CRITICAL: Fixed height enables vertical positioning */
  border: 2px solid transparent; 
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  overflow: hidden;
  
  /* --- KEY FLEXBOX SETUP --- */
  display: flex;
  flex-direction: column; /* Stack items vertically */
  
  /* Removed align-items: baseline and justify-content: baseline */
  align-items: stretch; /* Allows children to fill the full width */
  justify-content: flex-start; /* Keeps content starting at the top */
  
  transition: all 0.5s ease;
  position: relative;
  padding: 10px;
  box-sizing: border-box; /* Ensures padding is included within the 500px height */
}

.product-card:hover {
  border-image: linear-gradient(45deg, #fbc02d, #ff5722, #4caf50);
  border-image-slice: 1;
  transform: translateY(-5px);
}

/* Product Image */
.product-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  /* KEY CHANGE: Use flex-grow to absorb space, pushing later elements down */
  flex-grow: 1; /* This absorbs space, but the H3 below is a better candidate */
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

/* Product Name (H3) */
.product-card h3 {
  font-size: 1.3rem;
  margin: 15px 0 10px 0;
  color: #3e2723;
  font-weight: 700;
  width: 100%;
  text-align: start;
  
  /* --- KEY LAYOUT CHANGE --- */
  /* This is the best place to add flex-grow to push content down */
  flex-grow: 1; 
}

/* Product Description (P) */
.product-card p {
  width: 100%;
  text-align: start;
  
  /* --- KEY TRUNCATION SETUP --- */
  white-space: nowrap; /* 1. Prevent text wrapping */
  overflow: hidden; /* 2. Hide overflow */
  text-overflow: ellipsis; /* 3. Show "..." */
  
  /* Removed max-width: 300px since width: 100% works better in this layout */
  padding: 5px 0px;
}

/* Button */
.btn-card {
  display: block; /* Change from inline-block to block for full width */
  
  /* --- KEY BUTTON POSITIONING --- */
  /* margin-top: auto is the critical property to push it to the bottom */
  margin-top: auto; 
  margin-bottom: 0; /* Ensures it sits right on the edge */
  
  padding: 0.6rem 1.0rem;
  background-color: #ff2815e2;
  text-decoration: none;
  font-weight: 600;
  color: white;
  width: 100%;
  transition: all 0.3s ease;
  /* border-top-right-radius: 50%; */
  font-size: 12px;
}

.btn-card:hover {
  background-color: #3e2723;
  color: #fbc02d;
}

.product-card .delivery{
    width: 90%;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin: auto;
}
/* Responsive */
@media(max-width: 600px) {
    .filters {
        flex-direction: column;
    }
   
}



/* Product Card */
.product-card {
  background-color: #fff;
  width: 260px; /* Fixed width */
  height: 400px; /* Fixed height */
  border: 2px solid transparent; /* For hover border animation */
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.5s ease;
  position: relative;
}

.product-card:hover {
  border-image: linear-gradient(45deg, #fbc02d, #ff5722, #4caf50);
  border-image-slice: 1;
  transform: translateY(-5px);
}

/* Product Image */
.product-image {
  width: 118%;
  height: 50%;
  overflow: hidden;
}

.product-image img {
  width: 73%;
  height: 100%;
  object-fit: cover; /* Zoom in/out without changing card size */
  transition: transform 0.5s ease;
}


.buy-btn {
  background-color: #fbc02d;
  border: none;
  color: #3e2723;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.buy-btn:hover {
  background-color: #3e2723;
  color: #fbc02d;
}








@media (max-width: 600px) {
    .product-card {
        width: 180px; /* Smaller width for 2 cards */
        height: 280px; /* Much shorter height */
        padding: 6px; /* Reduced padding */
        margin: 0 auto;
        text-align: center; /* Center all content */
    }

    .product-image {
        width: 100%;
        height: 120px; /* Smaller image area */
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .product-image img {
        width: 85%; /* Smaller image inside container */
        height: auto; /* Maintain aspect ratio */
        max-height: 100%;
        object-fit: contain; /* Show full image */
        display: block;
        margin: 0 auto; /* Center image */
    }

    .product-card h3 {
        font-size: 0.8rem; /* Even smaller */
        margin: 5px 0 4px 0;
        line-height: 1.1;
        min-height: 32px; /* Reduced height */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-align: center; /* Center title */
        padding: 0 3px;
    }

    .product-card p {
        font-size: 0.7rem; /* Very small */
        margin-bottom: 6px;
        padding: 0 4px;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-align: center; /* Center description */
    }

    .buy-btn {
        padding: 6px 8px; /* Very small button */
        font-size: 0.75rem; /* Small font */
        width: 85%; /* Narrow button */
        margin: 5px auto 0; /* Center with small margin top */
        display: block;
        border-radius: 6px; /* Smaller radius */
    }

    .filters {
        flex-direction: column;
        gap: 8px;
        padding: 0 8px;
        margin-bottom: 20px;
    }

    .search-box,
    .category-filter,
    .price-filter {
        width: 100%;
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px; /* Smaller gap */
        justify-items: center;
        padding: 0 8px;
    }

    .product-card .delivery {
        font-size: 0.65rem; /* Very small */
        margin: 4px auto;
        width: 90%;
        text-align: center; /* Center delivery info */
    }

    /* Simplify hover for mobile */
    .product-card:hover {
        border: 1px solid #fbc02d; /* Very thin border */
        transform: translateY(-2px); /* Tiny lift */
        box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    }

    /* Price styling if you have it */
    .product-price {
        font-size: 0.9rem;
        margin: 3px 0;
        text-align: center;
    }

    /* Center everything in card */
    .product-card > * {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
}