/* Basic Resets & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    color: #4a4a4a;
    margin-bottom: 15px;
}

h2 {
    font-size: 2.5em;
}

h3 {
    font-size: 1.8em;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    color: #0056b3;
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: #4CAF50; /* Green */
    color: white;
    border: 1px solid #4CAF50;
}

.btn-primary:hover {
    background-color: #45a049;
    border-color: #45a049;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.large-btn {
    padding: 15px 30px;
    font-size: 1.1em;
}

/* Header */
header {
    background-color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
}

.logo h1 {
    margin: 0;
    color: #4CAF50;
    font-size: 1.8em;
}

nav ul {
    display: flex;
    gap: 20px;
}

nav a {
    color: #555;
    font-weight: 600;
    padding: 5px 0;
    position: relative;
}

nav a:hover, nav a.active {
    color: #4CAF50;
}

nav a.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 2px;
    background-color: #4CAF50;
}

.cart-icon {
    font-size: 1.2em;
    display: flex;
    align-items: center;
    color: #555;
}

.cart-icon span {
    background-color: #FF5722; /* Orange */
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 50%;
    margin-left: 5px;
    line-height: 1;
}

/* Main Content Layout */
main {
    flex-grow: 1;
}

section {
    padding: 60px 0;
    text-align: center;
}

.text-center {
    text-align: center;
}

/* Hero Section (Home Page) */
.hero-section {
    position: relative; /* Needed for .hero-overlay positioning */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    /* Removed padding here, it's now on .hero-overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px; /* Ensure a minimum height for the hero section */
    transition: background-image 1s ease-in-out; /* Smooth transition for background image */
}

/* New: Overlay for Hero Section */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Changed from 0.4 to 0.6 for better contrast */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 0; /* Apply padding here instead of .hero-section */
}


.hero-content {
    max-width: 800px;
    padding: 20px;
    /* Text shadow for readability */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8); /* Slightly stronger shadow for better contrast */
    z-index: 1; /* Ensure content is above the overlay */
}

.hero-content h2 {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: white;
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

/* Page Hero (Other Pages) */
.page-hero {
    background-color: #4CAF50;
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-hero h2 {
    color: white;
}

/* About Intro / Benefits */
.about-intro-section {
    background-color: #e6ffe6;
    padding: 60px 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.benefit-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-5px);
}

.benefit-card img {
    margin-bottom: 15px;
    border-radius: 50%;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card img {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

.product-card h4 {
    margin-bottom: 10px;
    font-size: 1.2em;
    height: 2.4em; /* Limit height for consistent layout */
    overflow: hidden;
}

.product-card p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1; /* Allows description to take available space */
    height: 4em; /* Limit height for consistent layout */
    overflow: hidden;
}

.product-card .price {
    font-weight: 700;
    color: #FF5722;
    font-size: 1.1em;
    display: block;
    margin-bottom: 15px;
}

.product-card .btn {
    width: 100%;
}

/* Quantity Control */
.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center; /* Center buttons and input */
    margin-bottom: 15px;
    gap: 5px;
}

.quantity-control .quantity-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    width: 35px; /* Fixed width for buttons */
    height: 35px; /* Fixed height for buttons */
    display: flex;
    justify-content: center;
    align-items: center;
}

.quantity-control .quantity-btn:hover {
    background-color: #45a049;
}

.quantity-control input[type="number"] {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    -moz-appearance: textfield; /* Firefox */
}

/* Hide spin buttons for Chrome, Safari, Edge, Opera */
.quantity-control input::-webkit-outer-spin-button,
.quantity-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* Checkout Section (on Products page) */
.checkout-section {
    margin-top: 50px;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.checkout-section #proceed-to-checkout:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    border-color: #bbb;
}


/* Checkout Form Section */
.checkout-form-section .container {
    max-width: 800px;
    text-align: left;
}

.order-summary-box {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.order-summary-box ul {
    list-style: disc;
    margin-left: 20px;
}

.order-summary-box li {
    margin-bottom: 8px;
}

.order-summary-box .total {
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 15px;
    border-top: 1px dashed #ddd;
    padding-top: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
}

.form-group textarea {
    resize: vertical; /* Allow vertical resizing */
    min-height: 100px;
}

.checkout-form-section .btn-primary {
    width: auto;
    display: block;
    margin: 30px auto 0 auto;
}

/* About Us & Contact Us Sections */
.content-section, .contact-section {
    padding: 60px 0;
    text-align: left; /* Align text left for readability */
}

.content-section ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 20px;
}

.content-section ul li {
    margin-bottom: 10px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-top: 40px;
}

.contact-info h3 {
    margin-bottom: 15px;
}

.contact-info p {
    margin-bottom: 10px;
}

.social-links img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.social-links img:hover {
    transform: scale(1.1);
}

.contact-form-container h3 {
    margin-bottom: 20px;
}

.contact-form .btn-primary {
    display: inline-block;
    width: auto;
    margin: 20px 0 0 0;
}

/* Footer */
footer {
    background-color: #333;
    color: #eee;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: left;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: #4CAF50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.footer-col p, .footer-col li {
    font-size: 0.9em;
    color: #bbb;
    margin-bottom: 8px;
}

.footer-col a {
    color: #bbb;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 20px;
    text-align: center;
    font-size: 0.8em;
    color: #aaa;
}


/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 15px;
        gap: 15px;
    }

    .logo h1 {
        margin-bottom: 10px;
    }

    .hero-content h2 {
        font-size: 2.5em;
    }

    .hero-content p {
        font-size: 1em;
    }

    .benefits-grid, .product-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-info, .contact-form-container {
        text-align: center;
    }

    .contact-form-container .btn-primary {
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 2em;
    }

    h3 {
        font-size: 1.5em;
    }

    .btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .large-btn {
        padding: 12px 20px;
        font-size: 1em;
    }

    header {
        padding: 10px 0;
    }

    .logo h1 {
        font-size: 1.5em;
    }

    nav ul {
        gap: 10px;
        font-size: 0.9em;
    }

    .hero-section {
        padding: 60px 0;
    }

    section {
        padding: 40px 0;
    }
}
