/* Reset some default styles */
body, h1, h2, h3, p, ul, li {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Basic Styling */
html, body {
    height: 100%;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f8f8f8;
    color: #333;
    display: flex;
    flex-direction: column;
}


/* Header Styling */
header {
    background: #ffffff;
    color: #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: relative;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

header .logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #333;
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

nav ul li {
    margin: 0 1rem;
    display: flex;
    align-items: center;
}

nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
}

nav a:hover, nav a:focus {
    color: #007bff;
    border-bottom: 2px solid #007bff;
}

/* Return to Landing Page Button */
#return-to-landing-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: #333333;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s;
    outline: none;
    display: inline-block;
    cursor: pointer;
    text-align: center;
}

#return-to-landing-btn:hover {
    background-color: #555555;
}

#return-to-landing-btn:focus {
    background-color: #777777;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
}

.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.product {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    width: 280px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.product h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product p.price {
    font-size: 1.1rem;
    color: #007bff;
    margin-bottom: 1rem;
}

.product a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.product a:hover, .product a:focus {
    color: #0056b3;
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}


/* Footer */
footer {
    background: #ffffff;
    color: #333;
    text-align: center;
    padding: 2rem 0;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    width: 100%; /* Ensure footer stretches full width */
    margin-top: auto; /* Pushes footer to the bottom if content is short */
}

/* Contact Page Styles */
.contact {
    background-color: #f8f8f8;
    padding: 4rem 1rem;
}

.contact .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.contact h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

.contact p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

.contact-form {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.contact-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.contact-form input, .contact-form textarea {
    box-sizing: border-box; /* Ensures padding and borders are included in the width */
    width: 100%; /* Full width of the container */
    padding: 0.5rem; /* Consistent padding on all sides */
    border: 1px solid #ddd; /* Consistent border size */
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1rem; /* Add space between form elements */
}

.contact-form button {
    background: #007bff;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    display: block;
    width: 100%;
}

.contact-form button:hover, .contact-form button:focus {
    background: #0056b3;
}

/* Cart Page Styles */
.cart {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px; /* Ensures a minimum height for the cart */
}

.cart h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
}

.cart-items {
    margin-bottom: 2rem;
}

.cart-item {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-bottom: 1rem;
}

.cart-item img {
    width: 100px;
    height: auto;
    border-radius: 8px;
    margin-right: 1rem;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item-details .price,
.cart-item-details .total {
    font-size: 1.1rem;
    color: #007bff;
}

.cart-item-details .quantity {
    font-size: 1rem;
    color: #666;
}

.cart-summary {
    text-align: center;
    padding: 1rem;
}

.cart-summary p {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

#checkout-btn {
    background: #007bff;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

#checkout-btn:hover, #checkout-btn:focus {
    background: #0056b3;
}

/* Basic Styling for Cart Icon */
nav ul li a.cart-icon {
    display: flex;
    align-items: center;
    font-size: 1rem;
    color: #333;
    text-decoration: none;
    padding: 0.5rem 0;
    font-weight: 500;
    position: relative; /* For positioning the item count if needed */
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 2px solid transparent;
}

nav ul li a.cart-icon i {
    margin-right: 0.5rem; /* Spacing between icon and text */
    font-size: 1.2rem; /* Slightly larger icon */
}

nav ul li a.cart-icon:hover, nav ul li a.cart-icon:focus {
    color: #007bff;
    border-bottom: 2px solid #007bff;
}

.cart-badge {
    background: #007bff;
    color: #ffffff;
    border-radius: 50%;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 0.5rem;
    display: inline-block;
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
}

/* Product Details Section */
.product-detail {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-detail h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.product-info {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
    justify-content: center;
}

.product-info img {
    max-width: 400px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-details p.price {
    font-size: 1.8rem;
    color: #007bff;
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-details p.description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

.product-details button {
    background-color: #007bff;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.product-details button:hover {
    background-color: #0056b3;
}

/* Responsive Design for Product Details */
@media (max-width: 768px) {
    .product-info {
        flex-direction: column;
        align-items: center;
    }

    .product-info img {
        max-width: 100%;
    }

    .product-details {
        text-align: center;
    }
}


/* Responsive Design for Mobile (max-width: 768px) */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Move the Return to Landing Page button to top left corner above the logo */
    #return-to-landing-btn {
        position: static; /* Remove absolute positioning */
        margin-bottom: 1rem; /* Add space below the button */
        align-self: flex-start; /* Align the button to the left */
        width: auto; /* Ensure it doesn't stretch */
    }

    /* Stack the navigation vertically */
    nav ul {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    nav ul li {
        margin: 0.5rem 0;
    }

    /* Adjust logo size for mobile */
    header .logo {
        font-size: 1.5rem;
        margin-bottom: 1rem; /* Space between logo and nav */
    }

    .contact {
        padding: 2rem 1rem;
    }

    .contact-form {
        padding: 1.5rem 1rem;
    }

    .contact-form input, .contact-form textarea {
        padding: 0.5rem; /* Adjusted padding for mobile */
        font-size: 0.9rem;
    }

    .contact-form button {
        padding: 0.6rem 1rem;
        font-size: 1rem;
    }
    
}

    /* Responsive Design for Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    /* Adjust header layout for smaller devices */
    header .container {
        align-items: flex-start; /* Ensure all elements align left */
        padding: 0.5rem 1rem; /* Reduce padding for small screens */
    }

    /* Make the Return to Landing Page button more compact */
    #return-to-landing-btn {
        padding: 0.4rem 0.8rem; /* Smaller padding for smaller screens */
        font-size: 0.9rem; /* Reduce font size for better fit */
        margin-bottom: 1rem; /* Ensure space between button and logo */
    }

    /* Reduce the logo size further */
    header .logo {
        font-size: 1.2rem;
        margin-bottom: 0.8rem; /* Smaller margin between logo and nav */
    }

    /* Stack navigation items with reduced spacing */
    nav ul li {
        margin: 0.4rem 0;
    }

    nav a {
        font-size: 0.9rem; /* Reduce font size for navigation links */
    }
    .contact {
        padding: 2rem 1rem;
    }

    .contact-form {
        padding: 1rem 1rem;
    }

    .contact-form input, .contact-form textarea {
        padding: 0.5rem; /* Padding for small screens, ensure it applies equally on all sides */
        font-size: 0.85rem;
    }

    .contact-form button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}
