/* --- Reset & Variables --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --smoky-black: #11120D;
    --olive-drab: #565449;
    --bone: #D8CFBC;
    --floral-white: #FFFBF4;
}

body {
    font-family: "Inter", sans-serif;
    background-color: var(--floral-white);
    color: var(--smoky-black);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative; /* needed for pseudo-element */
}

aside {
    width: 200px;
    background-color: var(--bone);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    position: fixed;
    height: 100vh;
    top: 0;
    left: 0;
    transition: all 0.3s ease;
    z-index: 100;
    border-right: 1px solid var(--smoky-black);
}

.side-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

h1,
h2,
h3 {
    font-family: "Playfair Display", serif;
}

.search-box img{
    height: 25px;
    align-items: center;
    margin: auto 0;
}

.page-wrapper {
    flex: 1;
    margin-left: 200px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 200px);
    transition: all 0.3s ease;
}

header {
    background-color: var(--bone);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--smoky-black);
        height: 100px;
}

header section{
    align-items: center;
    text-align: center;
    display: flex;
}

header h1 {
    font-size: 1.8rem;
}

nav a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--smoky-black);
}

nav a {
    padding: 5px;
    border-radius: 5px;
}

nav a:hover {
    background-color: var(--floral-white);
}

.search-section {
    padding: 0.8rem 1rem;
    display: flex;
    gap: 15px;
    margin: 10px 0px 0px 85px;
}

.search-box {
    background-color: var(--bone);
    padding: 0.6rem;
    border-radius: 12px;
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    width: 100%;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
}

.cart-button {
    display: inline-block;
    background-color: var(--olive-drab);
    color: var(--floral-white);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.cart-button:hover {
    opacity: 0.85;
}

.content {
    display: flex;
    padding: 2rem 100px;
    gap: 1rem;
    flex: 1;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    box-sizing: border-box;
}

#cartBtn {
    border: none;
    background-color: var(--floral-white);
}

.category-sidebar {
    padding-top: 185px;
    width: 180px;
    flex-shrink: 0;
}

.category-sidebar ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-sidebar li {
    background-color: var(--bone);
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.category-sidebar li:hover {
    background-color: var(--olive-drab);
    color: var(--floral-white);
}

.category-sidebar li.active {
    background-color: var(--smoky-black);
    color: var(--floral-white);
}

.product-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
}

.product-card {
    background-color: var(--bone);
    border-radius: 12px;
    text-align: left;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 280px;
}

.product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.product-card img {
    border-radius: 12px 12px 0 0;
    width: 100%;
    height: 120px;
    object-fit: cover;
    margin-bottom: 0.4rem;
    transition: transform 0.3s ease;
}

.product-card a h3, .product-card a p, .product-card a span{
    padding-left: 9px;
}

.product-card:hover img {
    transform: scale(1.01);
}

.product-card h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.product-card p {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
    color: var(--smoky-black);
    text-decoration: none;
    text-align: left;
}

.product-card a {
    text-decoration: none;
    color: inherit;
}

.price {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: auto;
}

.site-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    margin-top: auto;
}

@media (max-width: 1024px) {

    .page-wrapper {
        margin-left: 0;
        width: 100%;
    }

    aside {
        position: relative;
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: center;
        padding: 0.8rem 0;
        border-right: none;
    }

    .side-logo {
        width: 50px;
        height: 50px;
    }

    .content {
        flex-direction: column;
        padding: 1.5rem;
        align-items: flex-start;
    }

    .category-sidebar {
         position: sticky;
        top: 140px; 
        align-self: flex-start;
        width: 100%;
        padding-top: 0;
        margin-bottom: 1rem;
    }

    .category-sidebar ul {
        flex-direction: row;
        overflow-x: auto;
    }

    .category-sidebar li {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .search-section {
        margin: 10px 0;
        width: 100%;
        justify-content: center;
    }

    .search-box {
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 600px) {
    .content{
        padding: 20px;
    }
    header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        height: auto;
        text-align: center;
    }

    nav {
        margin-top: 0.5rem;
    }

    nav a {
        margin: 0 8px;
    }

    .cart-button {
        width: 100%;
        text-align: center;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-sidebar{
        position: fixed;
        top: 0px;
        background-color: var(--floral-white);
        padding: 10px;
        height: 60px;
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}