/* General Reset and Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --primary-color: #007bff; /* Bright Blue - Modern CTA/Accent */
    --secondary-color: #128054; /* Deep Organic Green - Primary brand color */
    --text-dark: #333333;
    --background-light: #f4f6f9; /* Soft background */
    --background-dark: #ffffff;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.15);
    --font-family: 'Inter', sans-serif;
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-color: var(--background-light);
    color: var(--text-dark);
}

.container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}
a:hover {
    color: var(--secondary-color);
}

/* --- Header & Navigation --- */
header {
    background-color: var(--background-dark);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 2em;
    font-weight: 700;
    color: var(--secondary-color);
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 35px;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 600;
    padding: 5px 0;
    position: relative;
}
/* Underline effect on hover */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease-out;
}
.nav-links a:hover::after {
    width: 100%;
}

/* --- CTA Buttons - Refined Styles --- */
.nav-cta, .cta-primary, .cta-secondary {
    border: none;
    padding: 12px 25px;
    border-radius: 50px; /* Fully rounded buttons */
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cta-primary {
    background-color: var(--primary-color);
    color: white;
}

.cta-secondary {
    background-color: transparent;
    border: 2px solid var(--secondary-color) !important;
    color: var(--secondary-color);
    box-shadow: none;
}

.cta-primary:hover {
    background-color: #0069d9;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.cta-secondary:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
}

/* NEW: Cart CTA in Navbar - Explicitly set color to white for visibility */
.cart-cta {
    padding: 10px 18px;
    gap: 8px;
    background-color: var(--secondary-color);
    color: white; /* Ensures text and icon are white */
}
.cart-cta:hover {
    background-color: #0f6c44;
}

/* Ensure the Logout button's text is white when hovered */
.header-actions .cta-secondary:hover {
    color: white;
}
/* --- Hero Section --- */
.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 100px 5% 50px;
    background-color: var(--background-light);
}

.hero-content {
    flex: 1;
    max-width: 550px;
}

.hero-content h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
    line-height: 1.1;
    color: var(--secondary-color);
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #6c757d;
}

.hero-cta-group button {
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 15px;
    transition: opacity 0.3s;
}

.hero-cta-group button:hover {
    opacity: 0.8;
}
/* Hero image styles from previous change */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 30px;
    max-width: 500px;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: cover;
}


/* --- Product Grid Section - Modern Cards --- */
.product-grid {
    padding: 80px 0;
    text-align: center;
}

.product-grid h2 {
    font-size: 3em;
    margin-bottom: 50px;
    color: var(--text-dark);
}

/* MODIFIED: Changed grid to fit 3-4 items, adjusting minmax */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Adjusted min-width for more columns */
    gap: 30px;
}

.product-card {
    background-color: var(--background-dark);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* MODIFIED: Reduced image height */
.product-card img {
    max-height: 180px; /* Reduced from 250px to 180px */
    object-fit: contain;
    margin: 0 auto 20px;
    border-radius: 4px;
    /* subtle background for product image area */
    background-color: #fcfcfc; 
    padding: 10px;
}

.product-card h3 {
    font-size: 1.6em;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.product-card p {
    color: #6c757d;
    font-size: 1em;
    flex-grow: 1;
    margin-bottom: 15px;
}

.product-price {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

/* --- Quantity Controls - Clean & Interactive --- */
.quantity-control {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    gap: 15px;
}

.quantity-control button {
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 1.1em;
    transition: background-color 0.2s;
}
.quantity-control button:hover {
    background-color: var(--primary-color);
}

.add-to-cart-btn.initial-add-btn {
    width: 100%;
    margin-top: 15px;
    padding: 14px;
    border-radius: var(--border-radius);
    font-size: 1.1em;
}

/* --- Floating Shopping Cart Sidebar - Polished Look --- */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background-color: var(--background-dark);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    padding: 30px 20px;
    transform: translateX(0);
    transition: transform 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
    border-left: 5px solid var(--primary-color);
}

.cart-sidebar.hidden {
    transform: translateX(100%);
}

.cart-sidebar h3 {
    font-size: 2em;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--background-light);
    padding-bottom: 15px;
    color: var(--primary-color);
}

#cart-items-list {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-details {
    flex-grow: 1;
    margin-right: 10px;
}

.cart-item-details strong {
    display: block;
    font-weight: 600;
}

.cart-item-details span {
    color: #6c757d;
    font-size: 0.9em;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-qty-btn {
    border: 1px solid var(--secondary-color);
    background-color: var(--background-dark);
    color: var(--secondary-color);
    width: 32px;
    height: 32px;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

.cart-qty-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

.cart-summary {
    border-top: 2px solid var(--background-light);
    padding-top: 20px;
}

.cart-summary p {
    font-size: 1.6em;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: right;
    color: var(--text-dark);
}

.cart-summary button {
    width: 100%;
    margin-top: 10px;
    padding: 14px 0;
    border-radius: var(--border-radius);
}

/* --- Authentication Form Styles - Modernized --- */
.auth-body {
    /* Full-screen background for auth pages */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f0f0f5 0%, #e0e0eb 100%);
}

.auth-container {
    background-color: var(--background-dark);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%; /* Take full width on small screens */
    max-width: 400px; /* Constrain on larger screens */
}

.auth-container h2 {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 30px;
    text-align: center; /* Center the title */
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* The missing styles for input groups: */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Style for the footer link */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.95em;
}

.auth-footer a {
    font-weight: 600;
}

/* --- Footer --- */
footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

/* --- Media Queries --- */
@media (max-width: 900px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
    }
    .hero-content h1 {
        font-size: 1em;
    }
    /* Adjusted Hero image for mobile/tablet */
    .hero-image {
        max-width: 250px;
        margin: 20px auto 0;
    }
}
@media (max-width: 600px) {
    .hero-content h1 {
        font-size: 2.5em;
    }
    .cart-sidebar {
        width: 100%; 
    }
}