/* =========================
   General Reset
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", sans-serif;
    background-color: #f4f4f8;
    color: #333;
    line-height: 1.5;
}

/* =========================
   Store Wrapper
========================= */
.store-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    margin-bottom: 2rem;
}

/* =========================
   Store Header
========================= */
.store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.store-title {
    font-size: 2rem;
    color: #222;
}

#search-bar {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    min-width: 250px;
    flex: 1;
    max-width: 400px;
    margin: 0 1rem;
}

.cart-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-icon {
    position: relative;
    font-size: 24px;
    text-decoration: none;
    color: #222;
    margin-right: 1rem;
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: red;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 12px;
}

.btn-checkout {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-checkout:hover {
    background-color: #218838;
}

/* =========================
   Store Container (Sidebar + Products)
========================= */
.store-container {
    display: flex;
    gap: 20px;
    margin-top: 2rem;
    align-items: flex-start; /* prevents stretching */
    flex-wrap: wrap;
}

/* Sidebar Filter */
.filter-panel {
    flex: 0 0 200px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
}

.filter-panel label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
}

/* =========================
   Product Grid
========================= */
.product-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    align-items: start; /* ensures cards don't stretch */
}

/* Product Card */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: auto; /* ensures card height fits content */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.product-info {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    gap: 6px;
}

.product-info h3 {
    font-size: 1.2rem;
    color: #222;
}

.product-info .price {
    color: darkred;
    font-weight: bold;
}

.product-info .meta {
    font-size: 0.85rem;
    color: #666;
}

/* Buttons (Add to Cart + More Info) */
.btn {
    display: inline-block;
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    transition: background 0.3s;
}

.btn:hover {
    background-color: #c82333;
}

/* Discount Banner */
.discount-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #e53935;
    color: white;
    padding: 8px 0;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    z-index: 10;
}

/* Header CSS */

.btn-outline {
  border: 1px solid darkred;
  background: transparent;
  color: black;
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.5s, transform 0.5s;
}
.btn-outline:hover {
  background: darkred;
  color: #fff;
  transform: scale(1.005);
}




/* =========================
   Responsive
========================= */
@media (max-width: 1024px) {
    .store-container {
        flex-direction: column;
    }

    .filter-panel {
        width: 100%;
        margin-bottom: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Mobile styles */
@media screen and (max-width: 768px) {
    .store-content{
        margin-right: 10px;
        padding: 0;
    }
    .store-container {
        flex-direction: row;      /* keep sidebar + products in one row */
        margin: 0;
        padding: 0;
    }
    
    .cart-section{
        margin-top: 10px;
    }

    .filter-panel {
        flex: 0 0 40%;            /* take ~20% of screen width */
        max-width: 40%;
        margin: 0;
        height: auto;
        padding-right: 10px;
        overflow-wrap: break-word; /* wrap long category names */
    }

    .product-grid {
        flex: 1;                  /* take remaining width */
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    /* Optional: make product cards smaller for mobile */
    .product-card img {
        height: 150px;
    }

    /* Adjust store header if needed */
    .store-header {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}
