/*--------- Products Interface Styles ----------*/
.products-page-section {
    background-color: var(--pure-white, #ffffff);
    background-image: radial-gradient(circle at 80% 20%, rgba(141, 110, 99, 0.02), transparent 50%);
    padding: clamp(40px, 8vw, 80px) 0;
    min-height: calc(100vh - 100px);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(10px, 3vw, 15px);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: clamp(10px, 2vw, 15px);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.filter-label {
    font-weight: 700;
    color: var(--dark-coffee, #3e2723);
    margin: 0;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.filter-select {
    border: 1px solid rgba(141, 110, 99, 0.2);
    background-color: var(--pure-white, #ffffff);
    color: var(--dark-coffee, #3e2723);
    padding: clamp(8px, 1.5vw, 10px) clamp(30px, 4vw, 35px) clamp(8px, 1.5vw, 10px) clamp(12px, 2vw, 15px);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    border-radius: var(--radius-small, 8px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%234E342E%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
}

.filter-select:hover, .filter-select:focus {
    border-color: var(--primary-brown, #8d6e63);
    box-shadow: 0 4px 12px rgba(141, 110, 99, 0.1);
    outline: none;
}

.products-divider {
    border: none;
    border-top: 1px solid rgba(141, 110, 99, 0.15);
    margin-bottom: clamp(2rem, 5vw, 3rem);
}

/* Products Grid (Mirrors Homepage) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(220px, 30vw, 260px), 1fr));
    gap: clamp(1rem, 3vw, 1.5rem);
    justify-content: center;
}

.product-item {
    display: flex;
    height: 100%; /* Ensures the wrapper fills the grid cell */
}

.product-card {
    background: var(--pure-white, #ffffff);
    border-radius: clamp(10px, 3vw, 15px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.product-card:hover, .product-card:focus-within {
    transform: translateY(clamp(-4px, -1vw, -8px));
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    border-color: rgba(141, 110, 99, 0.2);
}

.image-container {
    position: relative;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    flex: 1; /* Takes remaining vertical space gracefully */
    display: flex;
    flex-direction: column;
}

.discount-badge {
    position: absolute;
    top: clamp(10px, 2vw, 15px);
    left: clamp(10px, 2vw, 15px);
    background-color: #dc3545;
    color: white;
    padding: clamp(4px, 1vw, 5px) clamp(8px, 1.5vw, 10px);
    border-radius: 4px;
    font-weight: 700;
    font-size: clamp(0.75rem, 1.2vw, 0.8rem);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.product-link {
    display: flex;
    flex-direction: column;
    flex: 1; /* Replaces height:100% so it doesn't overflow parent */
    text-decoration: none;
    outline: none;
}

.product-img-wrapper {
    height: clamp(160px, 25vw, 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    flex-shrink: 0;
}

.shop-item-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.product-card:hover .shop-item-image, .product-link:focus .shop-item-image {
    transform: scale(1.1);
}

.product-title {
    color: var(--dark-coffee, #3e2723);
    font-weight: 700;
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.4;
    margin: 0 0 clamp(0.5rem, 2vw, 1rem) 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em;
}

.product-meta {
    margin-top: auto; /* Pushes the price and rating to the bottom of the link wrapper */
}

.product-price {
    color: var(--primary-brown, #8d6e63);
    font-weight: 800;
    font-size: clamp(1.1rem, 2vw, 1.2rem);
    margin: 0 0 10px 0;
}

.price-old {
    color: #6c757d;
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    font-weight: 400;
    margin-right: 8px;
}

.price-new {
    color: #dc3545;
}

.rating {
    color: #ffc107;
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
}

.rating i { margin-right: 2px; }

/* Pagination */
.pagination-wrapper {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    display: flex;
    justify-content: center;
}

.custom-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(5px, 1.5vw, 10px);
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item { margin: 0; }

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(35px, 6vw, 40px);
    height: clamp(35px, 6vw, 40px);
    background-color: var(--pure-white, #ffffff);
    color: var(--dark-coffee, #3e2723);
    border: 1px solid rgba(141, 110, 99, 0.2);
    border-radius: 50%;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

.page-link:hover, .page-link:focus {
    background-color: rgba(141, 110, 99, 0.05);
    color: var(--primary-brown, #8d6e63);
    border-color: var(--primary-brown, #8d6e63);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(141, 110, 99, 0.1);
    outline: none;
}

.page-item.active .page-link {
    background-color: var(--primary-brown, #8d6e63);
    color: white;
    border-color: var(--primary-brown, #8d6e63);
    box-shadow: 0 4px 12px rgba(141, 110, 99, 0.2);
    transform: scale(1.05);
}

.page-item.disabled .page-link {
    background-color: #f8f9fa;
    color: #adb5bd;
    border-color: #eaeaea;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}