/* --- Global Styles & Variables --- */
/* Variables make it easy to change the color scheme later */
:root {
    --primary-color: #4F46E5;
    /* Modern Indigo */
    --primary-hover: #4338CA;
    --bg-color: #F9FAFB;
    /* Very light gray background */
    --card-bg: #FFFFFF;
    /* White for cards */
    --text-color: #111827;
    /* Dark gray text */
    --text-light: #6B7280;
    /* Lighter text for paragraphs */
    --border-color: #E5E7EB;
}

/* Reset default margins and padding for consistency across browsers */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    /* Modern, clean font */
}

/* Enable smooth scrolling when clicking navigation links */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Navigation Bar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* Soft bottom shadow */
    position: sticky;
    /* Keeps nav at the top while scrolling */
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    /* Removes bullet points */
    display: flex;
    gap: 2rem;
    /* Spacing between links */
}

.nav-links a {
    text-decoration: none;
    /* Removes underline */
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    /* Smooth color change on hover */
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-cart {
    cursor: pointer;
    font-weight: 600;
    background-color: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.nav-cart:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-login {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: color 0.3s ease;
}

.btn-login:hover {
    color: var(--primary-color);
}

/* --- Hero/Home Section --- */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5rem 5%;
    min-height: 80vh;
}

.hero-content {
    max-width: 50%;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: var(--text-color);
}

.hero-content p {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
}

.hero-image {
    max-width: 45%;
}

.hero-image img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    /* Big soft shadow for depth */
}

/* General Button Style */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    /* Slight upward lift effect */
}

/* --- Products Section --- */
.products-section {
    padding: 5rem 5%;
    text-align: center;
}

.products-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
}

.product-grid {
    display: grid;
    /* This creates a responsive grid that fits as many columns as possible */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    /* Soft shadow to make card stand out from background */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Card hover animation */
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    /* Ensures whole product is visible */
    border-radius: 8px;
    margin-bottom: 1.5rem;
    background-color: #fff;
}

.product-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-card .price {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.add-to-cart-btn {
    width: 100%;
    padding: 1rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* --- Cart Section --- */
.cart-section {
    padding: 4rem 5%;
    background-color: var(--card-bg);
    margin: 4rem 5%;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.cart-section h2 {
    margin-bottom: 2.5rem;
    font-weight: 800;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    flex-wrap: wrap;
    gap: 1rem;
}

.cart-item-info {
    flex: 2;
    min-width: 150px;
}

.cart-item-info small {
    color: var(--text-light);
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 800;
}

.qty-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.cart-item-subtotal {
    flex: 1;
    text-align: right;
    font-weight: 800;
    color: var(--primary-color);
}

.remove-btn {
    background-color: #FEE2E2;
    color: #DC2626;
    /* Red for deletion action */
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.remove-btn:hover {
    background-color: #FECACA;
}

.cart-total {
    margin-top: 2rem;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

.cart-total h3 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
}

.confirm-order-btn {
    width: fit-content;
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* --- About & Contact Sections --- */
.about-section,
.contact-section {
    padding: 5rem 5%;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.about-section h2,
.contact-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.about-section p {
    color: var(--text-light);
    font-size: 1.2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 2rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 2.5rem;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    color: var(--text-light);
}

/* --- Auth Pages (Login / Register) --- */
.auth-page {
    background-color: #f8f9fa;
    min-height: 100vh;
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
}

.auth-container {
    background-color: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 500px;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 700;
    font-size: 0.9rem;
}

.form-group input {
    padding: 0.8rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.forgot-link {
    font-size: 0.85rem;
    color: #FF5722; /* Reddish orange like in the image */
    text-decoration: none;
    font-weight: 500;
}

.btn-primary-auth {
    background-color: #3F51B5; /* Deep blue like in the image */
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary-auth:hover {
    background-color: #303F9F;
}

.btn-secondary-auth {
    background-color: white;
    color: #3F51B5;
    padding: 1rem;
    border: 1px solid #3F51B5;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-secondary-auth:hover {
    background-color: #f0f2f9;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin: 1rem 0;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.divider span {
    padding: 0 10px;
}

.required {
    color: #DC3545;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.accent-link {
    color: #FF5722;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-text {
    font-size: 0.95rem;
    margin-top: 1rem;
    line-height: 1.5;
}

/* Ensure mobile responsiveness for auth pages */
@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }
}