/* ====== 1. GLOBAL RESET & FONTS ====== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #eee; /* Light gray background */
}

/* ====== 2. HEADER & NAVIGATION ====== */
.site-header {
    background-color: #222; /* Dark black/gray header */
    color: white;
    padding: 15px;
    display: flex; /* Flexbox: Side-by-side layout */
    justify-content: space-between; /* Space out Logo, Nav, Cart */
    align-items: center; /* Vertically center items */
}

.brand-link {
    color: white;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
}

.main-nav .nav-list {
    list-style: none; /* Remove bullet points */
    padding: 0;
    margin: 0;
}

.nav-item {
    display: inline; /* Make list items sit horizontally */
    margin: 0 15px; /* Spacing between links */
}

.nav-item a {
    color: white;
    text-decoration: none; /* Remove underline */
}

/* ====== 3. HOVER CART (REQUIRED FEATURE) ====== */
.cart-container {
    position: relative; /* Acts as an anchor for the dropdown */
}

.cart-button {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border: none;
    border-radius: 4px;
}

.cart-dropdown {
    display: none;        /* HIDDEN by default */
    position: absolute;   /* Floating above content */
    right: 0;             /* Align to right edge */
    top: 40px;            /* Push it down below the button */
    background: white;
    color: black;
    border: 1px solid #ccc;
    width: 250px;
    padding: 10px;
    z-index: 1000;        /* Ensure it sits ON TOP of everything else */
    box-shadow: 0px 4px 8px rgba(0,0,0,0.2); /* Drop shadow */
}

/* THE HOVER TRICK: When hovering container, show dropdown */

.cart-container:hover .cart-dropdown {
    display: block;
}

.cart-dropdown:hover {
    display: block;
}



.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.checkout-btn {
    width: 100%;
    background: green;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    margin-top: 10px;
}

/* ====== 4. MAIN LAYOUT ====== */
.page-main {
    padding: 20px;
    max-width: 1200px; /* Stop page from getting too wide on big screens */
    margin: 0 auto; /* Center the main content */
}

/* Category List (Home Page) */
.category-list {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.category-card {
    background: white;
    padding: 40px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: black;
    font-size: 20px;
    width: 150px;
    text-align: center;
    border-radius: 8px;
    transition: transform 0.2s; /* Smooth animation */
}

.category-card:hover {
    transform: scale(1.05); /* Slight zoom on hover */
    background-color: #f9f9f9;
}

/* ====== 5. PRODUCT LIST (GRID) ====== */
.product-list {
    display: flex;      /* Side-by-side */
    gap: 20px;          /* Space between cards */
    flex-wrap: wrap;    /* Wrap to next line if screen is small */
}

.product-card {
    background: white;
    padding: 15px;
    border: 1px solid #ccc;
    text-align: center;
    width: 200px; /* Fixed width */
    border-radius: 8px;
}

/* --- IMAGE SIZING FIX --- */
.product-card img {
    width: 100%;        /* Fill card width */
    height: 180px;      /* Fixed height for uniformity */
    object-fit: contain; /* Show WHOLE image, do not crop */
    margin-bottom: 10px;
}

.product-card a {
    text-decoration: none;
    color: black;
    font-weight: bold;
}

.product-card p {
    color: green;
    font-weight: bold;
    margin: 5px 0;
}

.product-card button {
    padding: 5px 10px;
    cursor: pointer;
}

/* ====== 6. PRODUCT DETAILS PAGE ====== */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: blue;
    text-decoration: none;
}

.product-detail {
    display: flex;    /* Side-by-side layout */
    gap: 40px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    align-items: flex-start; /* Align top */
}

.left-col {
    flex: 1; /* Take up 50% width */
}

.right-col {
    flex: 1; /* Take up 50% width */
}

/* Big Product Image Sizing */
.left-col img {
    width: 100%;
    max-height: 400px; /* Limit height so it's not huge */
    object-fit: contain;
    border: 1px solid #eee;
}

/* ====== 7. FOOTER ====== */
footer {
    text-align: center;
    padding: 20px;
    background: #ccc;
    margin-top: 40px;
}
