@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600&display=swap');

:root{
    --orange:#ff7800;
    --black:#130f40;
    --light-color:#666;
    --box-shadow:0 .5rem 1.5rem rgba(0,0,0,.1);
    --border:.2rem solid rgba(0,0,0,.1);
    --outline:.1rem solid rgba(0,0,0,.1);
    --outline-hover:.2rem solid var(--black);
}

*{
    font-family: 'Poppins', sans-serif;
    margin:0; padding:0;
    box-sizing: border-box;
    outline: none; border:none;
    text-decoration: none;
    text-transform: capitalize;
    transition: all .2s linear;
}

html{
    font-size: 62.5%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-padding-top: 7rem;
}

body{
    background:#eee;
}

section{
    padding:2rem 9%;
}

.heading{
    text-align: center;
    padding:2rem 0;
    padding-bottom: 3rem;
    font-size: 3.5rem;
    color:var(--black);
}

.heading span{
    background: var(--orange);
    color:#fff;
    display: inline-block;
    padding:.5rem 3rem;
    clip-path: polygon(100% 0, 93% 50%, 100% 99%, 0% 100%, 7% 50%, 0% 0%);
}

.btn{
    margin-top: 1rem;
    display: inline-block;
    padding:.8rem 3rem;
    font-size: 1.7rem;
    border-radius: .5rem;
    border:.2rem solid var(--black);
    color:var(--black);
    cursor: pointer;
    background: none;
}

.btn:hover{
    background: var(--orange);
    color:#fff;
}

/* General styles */
body {
    background: #eee;
}

/* Add padding to the top of the catalog section */
.catalog {
    padding-top: 10rem; /* Adjust this value as needed to ensure the catalog-header is not hidden */
}

/* Styles for the heading and item count */
.catalog-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    flex-direction: column;
}

.catalog-header .heading {
    text-align: left;
    font-size: 3.5rem;
    color: var(--black);
}

.catalog-header .heading span {
    background: var(--orange);
    color: #fff;
    display: inline-block;
    padding: .5rem 3rem;
    clip-path: polygon(100% 0, 93% 50%, 100% 99%, 0% 100%, 7% 50%, 0% 0%);
}

.catalog-header .item-count {
    font-size: 1.6rem;
    color: var(--light-color);
}

/* Styles for the horizontal divider */
.horizontal-divider {
    width: 100%;
    height: 1px;
    background: lightgrey;
    margin: 2rem 0;
}

.catalog-container {
    display: flex;
}

.sidebar {
    width: 25%;
    background: #fff;
    padding: 2rem;
    box-shadow: var(--box-shadow);
    border-radius: .5rem;
}

.sidebar h2 {
    font-size: 2.5rem;
    color: var(--black);
    margin-bottom: 1rem;
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group h3 {
    font-size: 2rem;
    color: var(--black);
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    font-size: 1.6rem;
    color: var(--light-color);
    margin-bottom: .5rem;
}

.filter-group input[type="checkbox"] {
    margin-right: .5rem;
}

.filter-group input[type="range"] {
    width: 100%;
}

.filter-group p {
    font-size: 1.6rem;
    color: var(--black);
    margin-top: .5rem;
}

/* Styles for the price input boxes */
.price-input {
    width: 45%;
    padding: 0.5rem;
    font-size: 1.6rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.products-section {
    width: 75%;
    padding-left: 2rem;
}

.products-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.product-card {
    width: calc(25% - 2rem);
    background: #fff;
    border-radius: .5rem;
    padding: 1rem;
    box-shadow: var(--box-shadow);
    transition: .2s linear;
}

/* Hover effect for product card */
.product-card:hover {
    transform: scale(1.05); /* Apply a small zoom effect */
    background: #fff; /* Keep the background color unchanged */
    box-shadow: var(--box-shadow); /* Ensure the box shadow remains */
}

.product-card img {
    width: 100%;
    height: auto;
    border-radius: .5rem;
}

.product-info {
    text-align: center;
}

.product-info h3 {
    font-size: 1.6rem;
    color: var(--black);
    margin-bottom: .5rem;
}

.price {
    font-size: 1.4rem;
    color: var(--black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.price .old-price {
    text-decoration: line-through;

}

.price .new-price {
    color: var(--orange);
}

.products-list.grid-view .product-info p {
    font-size: 1.4rem;
    color: var(--light-color);
    margin-bottom: .5rem;
}

.catalog-filter {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 2rem;
}

.search-box {
    width: 70%;
    padding: 0.5rem;
    font-size: 1.6rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
}

.view-switch {
    display: flex;
    gap: 1rem;
}

.view-switch i {
    font-size: 2rem;
    cursor: pointer;
}

.view-switch i.active {
    color: var(--orange);
}

/* Adjust the width of product cards for grid view */
.products-list.grid-view .product-card {
    width: calc(25% - 2rem); /* Adjusted to fit 4 cards per line */
}

.products-list.list-view .product-card {
    width: 100%;
    height: 100px;
    display: flex ;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.products-list.list-view .product-card img {
    width: auto;
    height: 90px;
    margin-right: 1rem;
}

.products-list.list-view .product-info {
    flex: 1;
    text-align: left;
}

.products-list.list-view .product-info h3 {
    font-size: 1.8rem;
    color: var(--black);
    margin-bottom: .5rem;
}

.products-list.list-view .product-info p {
    font-size: 1.4rem;
    color: var(--light-color);
    margin-bottom: .5rem;
}

.products-list.list-view .product-info .price {
    text-align: right;
    font-size: 1.6rem;
    color: var(--black);
}

.products-list.list-view .price {
    font-size: 1.4rem;
}

.products-list.list-view .price .old-price {
    text-decoration: line-through;
    margin-right: .5rem;
}

.products-list.list-view .price .new-price {
    color: var(--orange);
}

/* Responsive styles */
@media (max-width: 991px) {
    .catalog-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 2rem;
    }

    .products-section {
        width: 100%;
        padding-left: 0;
    }

    .products-list.grid-view .product-card {
        width: calc(33.333% - 1rem); /* Adjusted to fit 3 cards per line on smaller screens */
    }

    .products-list.list-view .product-card {
        width: 100%;
        display: flex;
        align-items: center;
    }

    .product-card {
        width: calc(50% - 1rem); /* Adjusted to fit 2 cards per line on smaller screens */
    }
}

/* Default to list view on mobile */
@media (max-width: 991px) {
    .products-list {
        display: flex;
    }

    .products-list.grid-view .product-card {
        width: calc(50% - 1rem); /* Full width on mobile */
    }

    .products-list.list-view .product-card {
        width: 100%;
        display: flex;
        align-items: center;
    }

    .product-card {
        width: 100%; /* Full width on mobile */
    }
}

/* Hide filters section by default on mobile */
@media (max-width: 991px) {
    .sidebar {
        display: none;
    }
}

/* Show filters button on mobile and center it */
.filters-button {
    display: none;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    font-size: 1.6rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    background-color: var(--orange);
    color: #fff;
    cursor: pointer;
}

@media (max-width: 991px) {
    .filters-button {
        display: block;
        margin: 10px auto; /* Center the button horizontally */
    }
}

@media (max-width: 767px) {
    .product-card {
        width: 100%; /* Full width on very small screens */
    }
}

/* media queries  */

@media (max-width:991px){

    html{
        font-size: 55%;
    }

    section{
        padding:2rem;
    }

}

@media (max-width:450px){

    html{
        font-size: 50%;
    }

    .heading{
        display: block;
        font-size: 2.5rem;
    }

}