/* General Styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

body {
    display: flex;
    flex-direction: column;
}

header {
    background-color: #ffffff; /* New top bar color */
    color: #000000; /* Black text for contrast */
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
    height: 100px; /* Increased height to fit the logo */
    padding-top: 10px; /* Adjusted padding */
    padding-bottom: 10px; /* Adjusted padding */
}

header .header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 10%;
    padding-right: 10%;
    flex-wrap: wrap; /* Allow wrapping */
}

.logo {
    width: 150px; /* Increased width by 50% */
    height: auto;
    max-height: 80px; /* Adjusted to fit within the header */
}

.search-bar {
    flex-grow: 1;
    margin: 0 20px;
}

.search-bar input[type="text"] {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 1em;
}

/* .top-right class: align elements horizontally, with Welcome on a new line */
.top-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Keep other elements aligned to the right */
}

.top-right .links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.top-right .links a {
    color: #000000;
    margin-left: 15px;
    text-decoration: none;
    font-weight: bold;
    position: relative;
}

.top-right .welcome {
    margin-top: 5px; /* Add spacing above the Welcome message */
    color: #000000;
    text-align: left; /* Left-align the welcome message */
}


/* Dropdown styling */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 200px; /* Adjusted width to fit the text */
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    right: 0; /* Align dropdown to the right */
    padding: 0; /* Remove extra padding to make the dropdown compact */
}

.dropdown-content a {
    color: #225522; /* New button color */
    padding: 12px 16px; /* Sufficient padding to fit the text */
    text-decoration: none; /* Remove underline */
    display: block;
    text-align: left;
    white-space: nowrap; /* Prevent text from wrapping */
}

.dropdown-content a:hover {
    background-color: #ddd;
}

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


nav {
    background-color: #B7D3A8; /* New navigation bar color */
    padding: 10px;
    text-align: left; /* Align links to the left */
    margin-top: 100px; /* Adjust to avoid overlap with fixed header */
    padding-left: 10%; /* Add padding to the left */
    padding-right: 10%; /* Add padding to the right */
}

nav .nav-content {
    display: flex;
    align-items: center;
}

nav a {
    color: #ffffff;
    margin: 0 15px;
    text-decoration: none; /* Remove underline */
    font-weight: bold;
    position: relative;
}

.categories {
    position: relative;
    display: inline-block;
}

.categories:hover .dropdown-content {
    display: block;
}

.content {
    padding: 20px;
    padding-top: 20px; /* Reduced padding to decrease space between nav and content */
    padding-left: 10%;
    padding-right: 10%;
    flex: 1; /* Allows content to grow and push the footer down */
}

h2 {
    color: #225522; /* New button color */
}

.product-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.product {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 16px;
    text-align: center;
    background-color: #ffffff;
    margin: 16px;
    width: calc(25% - 32px);
    box-sizing: border-box;
}

.product a {
    text-decoration: none; /* Remove underline */
    color: inherit; /* Inherit color */
}

.product img {
    max-width: 100%;
    height: auto;
    max-height: 300px; /* Set your desired max height */
    object-fit: contain; /* Ensures the aspect ratio is maintained */
}

.product h2 {
    font-size: 1.5em;
    color: #225522; /* New button color */
}

.product p {
    color: #333;
}

.product button {
    background-color: #225522; /* New button color */
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
}

footer {
    background-color: #225522; /* New button color */
    color: #ffffff;
    text-align: center;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto; /* Pushes the footer to the bottom */
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

.icon {
    width: 20px;
    height: auto;
    vertical-align: middle;
    margin-right: 5px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product {
        width: calc(33.33% - 32px); /* 3 items per row */
    }
}

@media (max-width: 900px) {
    .product {
        width: calc(50% - 32px); /* 2 items per row */
    }
}

@media (max-width: 600px) {
    .product {
        width: calc(100% - 32px); /* 1 item per row */
    }
}

@media (min-width: 1200px) {
    header .header-content,
    .content {
        padding-left: 10%;
        padding-right: 10%;
    }
}

/* Shopping Cart Styles */
.cart-items {
    margin-top: 20px;
}

.cart-items table {
    width: 100%;
    border-collapse: collapse;
}

.cart-items table th, .cart-items table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.cart-items table th {
    background-color: #f4f4f4;
}

.cart-item-image {
    width: 50px;
    height: auto;
    margin-right: 10px;
    vertical-align: middle;
}

.cart-items form {
    display: inline-block;
}

.cart-items form input[type="number"] {
    width: 60px;
    padding: 5px;
    margin-right: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cart-items form button {
    background-color: #225522; /* New button color */
    color: #ffffff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1em;
    border-radius: 4px;
}

.cart-items form button:hover {
    background-color: #1b441a; /* Darker shade of new button color */
}

.cart-total {
    margin-top: 20px;
    text-align: right;
}

.cart-total h3 {
    font-size: 1.5em;
    color: #225522; /* New button color */
}

.cart-total .checkout {
    background-color: #225522; /* New button color */
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    border-radius: 4px;
}

.cart-total .checkout:hover {
    background-color: #1b441a; /* Darker shade of new button color */
}



/* Login and Registration Page Styles */
.login-container {
    max-width: 400px;
    width: 100%; /* Ensure it takes up available space */
    margin: 100px auto;
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    margin-bottom: 20px;
    color: #225522; /* New button color */
}

.login-container .form-group {
    margin-bottom: 15px;
}

.login-container .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.login-container .form-group input {
    width: 95%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-container button {
    width: 100%;
    padding: 10px;
    background-color: #225522; /* New button color */
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

.login-container button:hover {
    background-color: #1b441a; /* Darker shade of new button color */
}

.message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}
.message.warning {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Mobile Friendly Styles */
@media (max-width: 768px) {
    header {
        padding: 5px 10px; /* Reduce padding around the header */
    }
    header .header-content {
        padding-left: 0; /* Remove left padding */
        padding-right: 10px; /* Adjust right padding */
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .logo {
        width: 100px; /* Reduced width for smaller screens */
        margin-bottom: 0;
    }
    .search-bar {
        width: calc(100% - 120px); /* Adjust width to fit next to logo */
        margin: 0;
        padding-left: 10px; /* Add left padding */
    }
    .search-bar input[type="text"] {
        padding-left: 10px; /* Add left padding to the input */
    }
    .top-right {
        display: none; /* Hide top-right links on mobile */
    }
    nav .nav-content {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    nav .nav-content a {
        flex: 1;
        text-align: center;
        margin: 5px 0;
    }
    .nav-content .categories {
        justify-content: flex-start;
    }
    .nav-content .about {
        justify-content: center;
    }
    .nav-content .contact {
        justify-content: flex-end;
    }
}

/* Mobile Friendly Styles for Shopping Cart Page */
@media (max-width: 768px) {
    .cart-items table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.9em; /* Reduce font size for mobile */
    }
    
    .cart-items table th, .cart-items table td {
        padding: 5px;
    }
    
    .cart-items table th {
        display: none; /* Hide table headers on mobile */
    }
    
    .cart-items table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    .cart-items table tr {
        margin-bottom: 10px;
        display: block;
        border-bottom: 1px solid #ddd;
    }
    
    .cart-items table td::before {
        content: attr(data-label);
        font-weight: bold;
        text-transform: uppercase;
        display: block;
        margin-bottom: 5px;
    }
    
    .cart-items .cart-item-image {
        max-width: 100px;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .cart-total h3 {
        font-size: 1.2em; /* Reduce font size for mobile */
    }
    
    .cart-total .checkout {
        width: 100%;
        font-size: 1em; /* Adjust button size */
    }
}
