/* Basic Reset & Body Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
}

/* Header */
header {
    background: #28a745; /* A nice green color */
    color: #fff;
    padding: 1rem 0;
    border-bottom: 3px solid #218838;
    display: flex; /* Ensure flexbox for layout */
    justify-content: space-between;
    align-items: center;
    position: sticky; /* Make header sticky */
    top: 0;
    z-index: 100; /* Ensure it stays on top */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%; /* Ensure container fills header width */
    max-width: 1200px;
    height: 40px;
    margin: auto;
}

header h1 a {
    color: #fff;
    text-decoration: none;
    font-size: 1.8rem;
}

header nav ul {
    list-style: none;
    display: flex; /* Use flex for nav items */
}

header nav ul li {
    margin-left: 20px;
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: #f0f0f0;
}

/* Header Icons (Cart and NEW Search Bar) */
.header-icons {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between search and cart */
}

/* NEW: Simple Search Bar Styling */
.simple-search-container {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 20px; /* Pill shape */
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    width: 100px; /* Adjust width as needed */
}

#simpleSearchBar {
    flex-grow: 1;
    padding: 8px 15px;
    border: none;
    outline: none;
    font-size: 0.9em;
    background-color: transparent;
    color: #333; /* Text color for input */
}

#simpleSearchBar::placeholder {
    color: #888;
}

#simpleSearchButton {
    background-color: #007bff; /* Blue search button */
    color: rgb(216, 74, 34);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#simpleSearchButton:hover {
    background-color: #0056b3;
}


/* Cart Icon */
.cart-icon {
    position: fixed;
    top: 300px;
    left: 280px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #070707; /* White icon */
    transition: color 0.3s ease;
}

.cart-icon:hover {
    color: #f0f0f0;
}

#cart-count {
    position: fixed;
    top: 290px;
    left: 295px;
    background-color: #dc3545; /* Red for count */
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7em;
}

/* Hero Section */
#hero {
    background: url('images/ac.jpg') no-repeat top center/cover;
    color: #fff;
    text-align: center;
    padding: 100px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    position: relative;
    z-index: 1; /* Ensure content is above potential overlays */
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4); /* Dark overlay */
    border-radius: 8px;
    z-index: -1;
}

#hero h2 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

#hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.btn {
    display: inline-block;
    background: #ffc107; /* Yellow button */
    color: #333;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s ease, color 0.3s ease;
}

.btn:hover {
    background: #e0a800;
    color: #111;
}

/* Categories Section */
.categories-section {
    padding: 40px 0;
    background-color: #fff;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.categories-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #28a745;
    font-size: 2rem;
}

.category-filter-container {
    text-align: right;
    margin-bottom: 20px;
    padding-right: 20px;
}

#category-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    font-size: 1em;
    cursor: pointer;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 0 20px;
}

.category-item {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding-bottom: 15px;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-item img {
    width: 100%;
    height: 150px; /* Fixed height for category images */
    object-fit: cover;
    display: block;
    margin-bottom: 10px;
}

.category-item h3 {
    font-size: 1.3em;
    color: #28a745;
}

/* Products Section */
.products-section {
    padding: 40px 0;
    background-color: #fff;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.products-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #28a745;
    font-size: 2rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    padding: 0 20px;
}

.product-card {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative; /* For the quick add button */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-card img {
    width: 100%;
    height: 250px; /* Consistent image height */
    object-fit: cover;
    display: block;
    cursor: pointer; /* Indicate clickability for modal */
}

.product-card h3 {
    font-size: 1.4em;
    margin: 15px 10px 5px;
    color: #333;
}

.product-card p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 10px;
}

.product-card .price {
    font-size: 1.5em;
    color: #28a745;
    font-weight: bold;
    margin-bottom: 15px;
}

.product-card .add-to-cart-btn {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    margin-bottom: 15px;
}

.product-card .add-to-cart-btn:hover {
    background-color: #0056b3;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 350px;
    height: 100%;
    background-color: #fff;
    box-shadow: -3px 0 10px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    transform: translateX(0);
}

.cart-sidebar h3 {
    margin-top: 0;
    color: #28a745;
    font-size: 1.8rem;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cart-sidebar .close-cart {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
}

#cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 15px;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 15px;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: #333;
}

.cart-item-details p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-controls button {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 5px 9px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.cart-item-controls button:hover {
    background-color: #e0e0e0;
}

.cart-item-controls .remove-item-btn {
    background-color: #dc3545;
    color: white;
    border: none;
}

.cart-item-controls .remove-item-btn:hover {
    background-color: #c82333;
}

.cart-summary {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 15px;
}

.cart-summary p {
    display: flex;
    justify-content: space-between;
    font-size: 1.1em;
    margin-bottom: 10px;
    font-weight: bold;
}

.cart-summary #cart-total {
    color: #28a745;
    font-size: 1.5em;
}

.checkout-btn {
    background-color: #28a745;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    width: 100%;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

.checkout-btn:hover {
    background-color: #218838;
}

/* Coupon Section */
.coupon-section {
    padding: 10px 0;
    border-top: 1px dashed #eee;
    border-bottom: 1px dashed #eee;
    margin: 15px 0;
}

.coupon-section input {
    width: calc(100% - 90px); /* Adjust width to fit button */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 5px;
}

.coupon-section button {
    padding: 8px 12px;
    background-color: #6c757d; /* Grey for coupon button */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.coupon-section button:hover {
    background-color: #5a6268;
}

.coupon-section .message {
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
}

.coupon-section .message.success {
    color: #28a745;
}

.coupon-section .message.error {
    color: #dc3545;
}

/* Product Details Modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    justify-content: center; /* Center content horizontally */
    align-items: center; /* Center content vertically */
}

.modal.open {
    display: flex; /* Show flex for centering */
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation-name: animatetop;
    animation-duration: 0.4s;
}

/* Add Animation */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-body.product-details {
    flex-direction: row; /* For side-by-side image and details */
}

.modal-body img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.product-modal-info {
    flex-grow: 1;
}

.product-modal-info h2 {
    font-size: 2em;
    margin-top: 0;
    color: #28a745;
}

.product-modal-info .price {
    font-size: 1.8em;
    color: #007bff;
    font-weight: bold;
    margin: 10px 0;
}

.product-modal-info .category {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.product-modal-info .description {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 20px;
}

.size-selection label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.size-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.size-options button {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.size-options button.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.size-options button:not(.selected):hover {
    background-color: #e9e9e9;
}

.size-chart-link {
    display: block;
    margin-top: 10px;
    color: #007bff;
    text-decoration: none;
    font-size: 0.9em;
}

.modal-add-to-cart-btn {
    background-color: #28a745;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%; /* Full width button */
}

.modal-add-to-cart-btn:hover {
    background-color: #218838;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Checkout Modal Styling */
.checkout-modal-body h3 {
    text-align: center;
    color: #28a745;
    margin-bottom: 20px;
}

#checkout-summary {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

#checkout-summary h4 {
    color: #333;
    margin-bottom: 10px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 5px;
}

#checkout-items-list {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
}

#checkout-items-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.95em;
    color: #555;
}

#checkout-summary p {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-top: 10px;
    padding-top: 5px;
    border-top: 1px dashed #ddd;
}

#checkout-summary #checkout-final-total {
    color: #28a745;
    font-size: 1.2em;
}

.payment-options {
    margin-bottom: 20px;
}

.payment-option {
    margin-bottom: 10px;
}

.payment-option input[type="radio"] {
    margin-right: 10px;
}

#upi-details {
    background-color: #e6f7ff;
    border: 1px solid #b3e0ff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-bottom: 20px;
}

#upi-details p {
    margin-bottom: 5px;
    color: #333;
}

#upi-details #upi-id {
    font-weight: bold;
    color: #0056b3;
}

#shipping-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

#shipping-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

#place-order-btn {
    background-color: #28a745;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

#place-order-btn:hover {
    background-color: #218838;
}


/* Footer */
footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: row; /* Keep elements in a row: Logo, Toggle, Icons */
        justify-content: space-between; /* Space out logo, toggle, icons */
        align-items: center;
        gap: 0; /* Reset gap */
    }

    header nav { /* Hide original nav on small screens */
        display: none;
    }

    .menu-toggle {
        display: flex; /* Show hamburger on mobile */
    }

    .header-icons {
        margin-top: 0; /* Reset margin */
        width: auto; /* Allow content to dictate width */
    }

    .simple-search-container {
        width: auto;
        margin-right: 1px; /* Adjust space between search and cart */
    }

    /* Adjust logo size if needed for better fit */
    header h1 a {
        font-size: 1.5rem;
    }

    #hero {
        padding: 60px 15px;
    }

    #hero h2 {
        font-size: 2rem;
    }

    #hero p {
        font-size: 1em;
    }

    .categories-grid, .product-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }

    .product-card {
        margin-bottom: 20px;
    }

    .cart-sidebar {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .modal-body.product-details {
        flex-direction: column;
        align-items: center;
    }

    .modal-body img {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    header h1 a {
        font-size: 1.5rem;
    }

    header nav {
        width: 100%;
    }
}
/* NEW: Body no-scroll class for mobile menu */
body.no-scroll {
    overflow: hidden;
}

/* NEW: Mobile Menu Toggle (Hamburger Icon) */
.menu-toggle {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    z-index: 1001; /* Ensure it's above other elements */
    margin-left: auto; /* Pushes it to the right */
}

.menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: #fff; /* White bars */
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* Animation for hamburger to 'X' */
.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* NEW: Mobile Navigation Menu Styling */
.nav-menu {
    display: flex; /* Keep flex for its children */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Dark overlay */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Disable interaction when hidden */
}

.nav-menu.active {
    transform: translateX(0); /* Slide in */
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Enable interaction when active */
}

.nav-menu nav ul {
    flex-direction: column; /* Stack menu items vertically */
    text-align: center;
    padding: 0;
}

.nav-menu nav ul li {
    margin: 15px 0; /* Space out items */
}

.nav-menu nav ul li a {
    color: #fff;
    font-size: 1.8rem; /* Larger font for mobile menu */
    padding: 10px 20px;
    display: block;
    transition: color 0.3s ease;
}

.nav-menu nav ul li a:hover {
    color: #28a745; /* Highlight on hover */
}