/* --- Reset & Variables --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary: #7209b7;
    --accent: #f72585;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --bg-light: #f3f4f6;
    --success: #10b981;
    --error: #ef4444;
    --gradient: linear-gradient(135deg, #4361ee 0%, #7209b7 100%);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

h1, h2, h3, h4, .brand-name {
    font-family: 'Poppins', sans-serif;
}

.site-logo {
    height: 70px;
    width: auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Header --- */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: none;
}

@media(min-width: 768px) {
    .nav-links {
        display: flex;
        gap: 30px;
    }
    .nav-links a {
        font-weight: 500;
        color: var(--text-dark);
        position: relative;
    }
    .nav-links a::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: -4px;
        left: 0;
        background: var(--primary);
        transition: width 0.3s;
    }
    .nav-links a:hover::after {
        width: 100%;
    }
}

.header-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.icon-btn {
    font-size: 1.2rem;
    color: var(--text-dark);
    position: relative;
    cursor: pointer;
    transition: color 0.3s;
}

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

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* --- Inline Search in Header --- */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-trigger {
    font-size: 1.2rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
}

.search-trigger:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.search-expand {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background: white;
    border-radius: 50px;
    display: flex;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0);
}

.search-expand.active {
    width: 300px;
    opacity: 1;
    padding: 0 45px 0 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.search-expand input {
    width: 100%;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 0.95rem;
    background: transparent;
}

.search-close {
    position: absolute;
    right: 15px;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
}

.search-close:hover {
    color: var(--accent);
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1500;
    animation: slideDown 0.3s ease;
}

.search-results-dropdown.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid var(--bg-light);
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-light);
}

.search-result-item i {
    color: var(--primary);
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.no-results i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* --- Toast / Notification System --- */
/* This is crucial for backend messages */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    padding: 16px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 10000; /* Highest Layer */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    animation: slideInRight 0.4s ease;
}

.notification.success {
    background-color: var(--success);
    border-left: 5px solid #065f46;
}

.notification.error {
    background-color: var(--error);
    border-left: 5px solid #991b1b;
}

.notification.info {
    background-color: var(--primary);
    border-left: 5px solid var(--primary-dark);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== CHATBOT STYLES ==================== */

/* Floating Button */
.chatbot-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #007BFF;
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 9999;
    /* Smooth transition for hover effects */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover Effect: Scale up and tilt slightly */
.chatbot-trigger:hover {
    transform: scale(1.1) rotate(-10deg);
    background-color: #0056b3;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* The Icon Element itself */
.chatbot-trigger i {
    transition: transform 0.3s ease;
}

/* ==================== WAVING ANIMATION ==================== */
/* Define the waving motion */
@keyframes wave-hand {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(-5deg); }
    75% { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
}

/* Class to apply the animation (added via JS) */
.icon-waving {
    animation: wave-hand 2s infinite ease-in-out;
}

/* ... Keep your existing Window/Message styles below ... */
.chatbot-window { 
    /* ... existing styles ... */
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid #007BFF;
    font-family: 'Inter', sans-serif;
}
/* ... rest of your CSS ... */

.chatbot-window.active {
    display: flex;
}

/* Header */
.chatbot-header {
    background: #007BFF; /* Primary Blue */
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

#closeChatbot {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #e9ecef; /* Lighter background for messages */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Dark bubble for the USER so it stands out */
.user-message {
    background-color: #333; /* Dark Grey background */
    color: #fff;            /* White text */
    align-self: flex-end;   /* Pushes to the right */
    text-align: right;
    padding: 10px 15px;
    border-radius: 15px 15px 0 15px;
    max-width: 80%;
    margin-bottom: 5px;     /* Small gap between messages */
    display: block;         /* Ensures it takes up space */
}

/* Light bubble for the BOT */
.bot-message {
    background-color: #e5e7eb; /* Light Grey/Blue background */
    color: #1f2937;            /* Dark text */
    align-self: flex-start;    /* Pushes to the left */
    text-align: left;
    padding: 10px 15px;
    border-radius: 15px 15px 15px 0;
    max-width: 80%;
    margin-bottom: 5px;
    display: block;
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ced4da;
    background: white;
    align-items: center;
}

#chatbotInput {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

#chatbotInput:focus {
    border-color: #007BFF;
}

#sendChatbotMsg {
    background: none;
    border: none;
    color: #007BFF; /* Blue Send Icon */
    font-size: 20px;
    margin-left: 10px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

#sendChatbotMsg:hover {
    color: #0056b3;
}
/* --- Modal Styles --- */
.modal {
    display: none; /* Must be hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex; /* Must switch to flex when active */
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--accent);
}

/* --- User/Auth Modal --- */
.user-modal-content {
    max-width: 450px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: var(--bg-light);
    color: var(--text-dark);
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-tab.active {
    background: var(--gradient);
    color: white;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.auth-form h2 {
    margin-bottom: 25px;
    color: var(--text-dark);
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group label i {
    margin-right: 5px;
    color: var(--primary);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--bg-light);
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    background: #f9fafb;
}

.form-group input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary);
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}





.auth-submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.4);
}

/* --- Cart Modal --- */
.cart-modal-content {
    max-width: 600px;
    max-height: 80vh;
}

.cart-modal-content h2 {
    margin-bottom: 25px;
    color: var(--text-dark);
    font-size: 1.8rem;
}

.cart-modal-content h2 i {
    color: var(--primary);
    margin-right: 10px;
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px; /* For scrollbar space */
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid var(--bg-light);
    border-radius: 10px;
    margin-bottom: 15px;
    align-items: center;
    background: white;
    transition: border-color 0.3s;
}

.cart-item:hover {
    border-color: var(--primary);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.cart-item-price {
    color: var(--primary);
    font-weight: 600;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--bg-light);
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.cart-item-remove {
    color: var(--accent);
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s;
    padding: 5px;
}

.cart-item-remove:hover {
    transform: scale(1.2);
    background: #fff0f7;
    border-radius: 50%;
}

/* Empty cart or Login Required view */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-cart i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.cart-footer {
    border-top: 2px solid var(--bg-light);
    padding-top: 20px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.4);
}

/* --- Hero Section --- */
.hero {
    height: 85vh;
    width: 100%;
    background-color: #4361ee;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1483985988355-763728e1935b?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 20px;
    margin-bottom: 4rem;
}

.hero-content {
    max-width: 800px;
    animation: fadeUp 1s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: var(--gradient);
    color: white;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(67, 97, 238, 0.6);
}

/* --- Section Titles --- */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 0 20px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-header p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Categories Grid --- */
.categories-section {
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.category-card {
    height: 450px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease forwards;
}

.card-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}

.category-card:hover .card-bg {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 40px 30px;
    color: white;
}

.card-overlay h3 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.card-overlay p {
    opacity: 0.8;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.card-link {
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-link i {
    transition: transform 0.3s;
}

.category-card:hover .card-link i {
    transform: translateX(5px);
}

/* --- Features Section --- */
.features {
    background-color: var(--bg-light);
    padding: 5rem 5%;
    margin-top: 5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
}

.feature-item {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.feature-item h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.feature-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* --- Footer --- */
footer {
    background-color: #0f172a;
    color: #cbd5e1;
    padding: 4rem 5% 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: #f8fafc;
    font-size: 1.2rem;
    margin-bottom: 25px;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #94a3b8;
    transition: all 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
    text-shadow: 0 0 8px rgba(67, 97, 238, 0.4);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    border-color: var(--primary);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #64748b;
}

/* --- Animations --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeUp 0.8s ease forwards;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .modal-content { width: 95%; padding: 20px; }
    .header-icons { gap: 15px; }
    .categories-grid { grid-template-columns: 1fr; }
    .features { flex-direction: column; align-items: center; }
    
    /* Adjust search expand for mobile */
    .search-expand.active {
        width: 250px;
    }
    
    .search-results-dropdown {
        width: 300px;
        right: -20px;
    }
    
    .notification {
        min-width: auto;
        width: 90%;
        left: 5%;
        right: 5%;
    }
}