html {
    scroll-behavior: smooth;
}

body {
    box-sizing: border-box;
    font-family: "Poppins";
    scroll-behavior: smooth;
    margin: 0;
    background-color: #fcfcfc;
}

a {
    text-decoration: none;
}

p {
    margin: 0;
}

ol,
ul,
menu {
    list-style: none;
}

:root {
    /* transition */
    --transition-1: 0.15s ease;
    --transition-2: 0.35s ease;
    --cubic-in: cubic-bezier(0.51, 0.03, 0.64, 0.28);
    --cubic-out: cubic-bezier(0.33, 0.85, 0.56, 1.02);
}


/* ------------------
HERO DESIGN
----------------- */

.hero-products {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-image: url('./products-header.jpg');
    height: 400px;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0px -60px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-products::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.hero-products h2,
.hero-products p {
    margin: 0;
    color: #fcfcfc;
}

.hero-products h2 {
    font-weight: 600;
    font-size: 32px;
    margin-top: 52px;
}

.hero-products p {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

.hero-products p a {
    color: #fcfcfc;
}

.filter-section {
    background-color: #e9e9e9;
    padding: 24px 64px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.filter-section-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
}

.filter-div {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    padding: 2px 24px 2px 0px;
    border-right: 1px solid black;
    cursor: pointer;
    /* background-color: #fcfcfc; */
}

.sorting-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: Arial, sans-serif;
}

.sorting-label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.sorting-select {
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sorting-select:hover {
    border-color: #888;
}

.sorting-select:focus {
    border-color: #555;
    outline: none;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}


/* ------------------
MODAL DESIGN
----------------- */

/* Improved Modal Styles */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

/* Modal Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    width: 350px;
    text-align: left;
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.3s ease-in-out;
}

.modal-content h2 {
    margin: 0;
}

/* Slide-in Animation */
@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.close-btn {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 22px;
    cursor: pointer;
    color: #444;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #c31315;
}

.filter-section-container div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* box-sizing: border-box; */
}

/* Align checkboxes and labels properly */
.filter-section-container label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
}

.filter-section-container h3 {
    font-weight: 600;
    margin: 24px 0px 12px 0px;
}

/* Price Range Input Styling */
.filter-section-container input[type="number"] {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
}

/* Ensure input boxes are same width */
.price-filter-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.price-filter-container input {
    flex: 1;
    /* width: 100%; */
}

/* Checkboxes */
.category-filter {
    width: 18px;
    height: 18px;
    accent-color: #c31315;
}

/* Price Inputs */
#min-price,
#max-price {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

/* Apply Button */
#apply-filters {
    background-color: #c31315;
    color: white;
    padding: 12px;
    width: 100%;
    border: none;
    cursor: pointer;
    margin-top: 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

#apply-filters:hover {
    background-color: #a00d10;
}


/* ------------------
PRODUCTS DESIGN
----------------- */

.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    padding: 64px 64px;
}

@media (max-width: 1024px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
        padding: 48px;
    }
}

@media (max-width: 768px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 32px;
    }
}

@media (max-width: 480px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }
}

.product-card {
    border: 1px solid #ddd;
    border-radius: 16px;
    height: 300px;
    width: 225px;
    padding: 16px;
    background-color: #fff;
    /* text-align: center; */
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); */
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

/* .product-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
} */

.product-card a {
    text-decoration: none;
    color: inherit;
}

.product-card img {
    /* max-width: 100%; */
    width: 100%;
    height: 180px;
    border-radius: 8px;
    /* margin-bottom: 8px; */
}

.product-card h3 {
    font-size: 18px;
    margin-bottom: 0px;
    margin-top: 8px;
}

.product-card p {
    margin-top: 0px;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

#category-p {
    color: #555;
    margin-top: 8px;
    font-weight: 400;
    font-size: 14px;
    margin-bottom: 8px;
}

.image-carousel {
    display: flex;
    overflow-x: auto;
    gap: 8px;
}

.image-carousel img {
    height: 100px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-carousel img:hover {
    transform: scale(1.1);
}


/* ------------------
RESPONSIVE STYLES
----------------- */

/* Tablet & Small Screens */
@media (max-width: 1024px) {
    .hero-products {
        height: 300px;
        background-position: center;
        background-size: cover;
        text-align: center;
        /* padding: 0 20px; */
    }

    .hero-products h2 {
        font-size: 28px;
        margin-top: 40px;
    }

    .hero-products p {
        font-size: 14px;
    }

    .filter-section {
        padding: 20px 40px;
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .filter-section-left {
        flex-direction: column;
        gap: 16px;
    }

    .filter-div {
        padding-right: 0;
        border-right: none;
    }

    .sorting-container {
        justify-content: center;
    }

    .products {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
        padding: 40px;
    }

    .product-card {
        height: auto;
        width: 100%;
        max-width: 220px;
    }

    .product-card img {
        height: 160px;
    }

    .product-card h3 {
        font-size: 16px;
    }

    .product-card p {
        font-size: 20px;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    .hero-products {
        height: 250px;
        background-size: cover;
        /* padding: 0 16px; */
    }

    .hero-products h2 {
        font-size: 24px;
    }

    .filter-section {
        padding: 16px 24px;
    }

    .filter-section-left {
        flex-direction: column;
        align-items: center;
    }

    .sorting-container {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 32px 20px;
    }

    .product-card {
        height: auto;
        width: 100%;
        max-width: 200px;
        padding: 12px;
    }

    .product-card img {
        height: 140px;
    }

    .product-card h3 {
        font-size: 14px;
    }

    .product-card p {
        font-size: 18px;
    }

    .sorting-label {
        font-size: 14px;
    }

    .sorting-select {
        font-size: 14px;
        padding: 6px 10px;
    }
}

/* Extra Small Screens (Phones) */
@media (max-width: 480px) {
    .hero-products {
        height: 200px;
        background-size: cover;
        text-align: center;
        /* padding: 0 12px; */
    }

    .hero-products h2 {
        font-size: 20px;
    }

    .hero-products p {
        font-size: 12px;
    }

    .filter-section {
        padding: 12px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .filter-section-left {
        flex-direction: column;
        align-items: center;
    }

    .sorting-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }

    .product-card {
        height: auto;
        width: 100%;
        max-width: 160px;
        padding: 10px;
    }

    .product-card img {
        height: 120px;
    }

    .product-card h3 {
        font-size: 12px;
    }

    .product-card p {
        font-size: 16px;
    }

    .sorting-label {
        font-size: 12px;
    }

    .sorting-select {
        font-size: 12px;
        padding: 5px 8px;
    }

    #apply-filters {
        font-size: 14px;
        padding: 10px;
    }
}

/* Extra Small Screens (Below 375px) - 1 Product Per Row */
@media (max-width: 376px) {
    .products {
        /* grid-template-columns: 0.6fr; */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 12px;
    }

    .product-card {
        /* max-width: 100%; */
        width: 100%;
        margin: 0 auto;
    }

    .product-card img {
        height: 140px;
    }

    .product-card h3 {
        font-size: 14px;
    }

    .product-card p {
        font-size: 16px;
    }
}


@media (min-width: 1440px) {

    .container,
    #contactus,
    #faqs,
    .product-details,
    .products,
    .services-section,
    .hero,
    .footer-content,
    .copyright,
    .filter-section {
        padding-left: 120px;
        padding-right: 120px;
    }
}