/* Global Styles */
:root {
    --primary-color: #4285f4;
    --primary-dark: #3367d6;
    --primary-light: #669df6;
    --accent-color: #34a853;
    --text-color: #333;
    --light-gray: #f8f9fa;
    --medium-gray: #eee;
    --dark-gray: #777;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
}

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
}

.logo h1 {
    color: var(--text-color);
    font-size: 1.8rem;
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    font-weight: 600;
    transition: color 0.3s;
    color: var(--text-color);
}

nav ul li a:hover {
    color: var(--primary-color);
}

/* nav ul li a.active {
    color: var(--primary-color);
} */

/* Reduce gap between Login and Sign Up navbar items */
nav ul li a#login-link,
nav ul li a#signup-link {
    margin-left: 0;
    margin-right: 0;
}

nav ul li a#signup-link {
    margin-left: -1.5rem;
    /* Decrease this value for less gap, e.g. -0.5rem for almost no gap */
}

nav ul li a#login-link,
nav ul li a#signup-link {
    margin-left: 0;
    margin-right: 0;
    padding: 0.35rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: #fff;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

nav ul li a#signup-link {
    margin-left: -1.5rem;
    /* Simple, minimal gap */
}

nav ul li a#login-link:hover,
nav ul li a#signup-link:hover {
    background: var(--primary-color);
    color: #fff;
}


.cart-icon {
    position: relative;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
}

.auth-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.auth-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.auth-options {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--medium-gray);
}

.auth-option {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.3s;
}

.auth-option.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-btn:hover {
    background: var(--primary-dark);
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.hidden {
    display: none;
}


.auth-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    /* Add scroll for overflow */
}

.auth-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    /* Prevent overflow */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    /* Add scroll if content overflows */
}

.form-group {
    position: relative;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group .icon {
    position: absolute;
    left: 5px;
    top: 69%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 0.8rem 0.8rem 30px;
    /* Add space for icon */
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* Fix duplicate ID in signup form */
#signupConfirmPassword {
    margin-top: 1rem;
}



/* Add these styles to your CSS FOR MENU */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-gray);
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out;
    z-index: 1001;
    padding: 1rem;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu ul {
    flex-direction: column;
    margin-top: 2rem;
    left: 10px;
}

.mobile-menu ul li {
    list-style: none;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-menu {
        display: block;
    }

    /* Hide desktop login/signup link */
    nav ul li:last-child {
        display: none;
    }

    /* Show mobile login/signup */
    .mobile-menu .auth-link {
        display: block;
    }
}

html,
body {
    overflow-x: hidden;
}

.mobile-menu {
    width: 80%;
    max-width: 300px;
}

@media (max-width: 480px) {
    .mobile-menu {
        width: 100%;
        max-width: none;
        right: -100%;
    }

    .auth-box {
        width: 95%;
        padding: 1rem;
    }
}

/* Add to existing media query */
@media (max-width: 768px) {
    body {
        position: relative;
    }

    .mobile-menu.active {
        right: 0;
        box-shadow: none;
    }

    .product {
        width: 100%;
        margin: 0 0 1rem 0;
    }
}

/* Hero Section */
.hero {
    height: 80vh;
    background: url('https://images.unsplash.com/photo-1483985988355-763728e1935b?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80') no-repeat center center/cover;
    display: flex;
    align-items: center;
    margin-top: 60px;
}

.hero-content {
    padding: 0 5%;
    color: white;
    max-width: 600px;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.shop-now {
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.shop-now:hover {
    background-color: var(--primary-dark);
}

/* Products Section */
.products-section {
    padding: 5rem 5%;
}

.products-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--text-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.product-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.product-content {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.add-to-cart {
    background-color: var(--text-color);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    width: 100%;
    transition: background-color 0.3s;
}

.add-to-cart:hover {
    background-color: var(--primary-color);
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    justify-content: flex-end;
}

.cart {
    background-color: white;
    width: 100%;
    max-width: 400px;
    height: 100%;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.close-cart {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-gray);
    transition: color 0.3s;
}

.close-cart:hover {
    color: var(--text-color);
}

.cart h2 {
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--medium-gray);
    padding-bottom: 1.5rem;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.cart-item-price {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.remove-item {
    color: var(--primary-color);
    font-size: 0.8rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.3s;
}

.remove-item:hover {
    color: var(--primary-dark);
}

.cart-item-amount {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.amount-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--dark-gray);
    transition: color 0.3s;
}

.amount-btn:hover {
    color: var(--text-color);
}

.item-amount {
    margin: 0 0.5rem;
}

.cart-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--medium-gray);
}

.cart-footer h3 {
    margin-bottom: 1.5rem;
    text-align: right;
    color: var(--text-color);
}

.clear-cart,
.checkout-btn {
    width: 100%;
    padding: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.clear-cart {
    background-color: var(--light-gray);
    color: var(--text-color);
    border: 1px solid var(--medium-gray);
}

.clear-cart:hover {
    background-color: #e9ecef;
}

.checkout-btn {
    background-color: var(--primary-color);
    color: white;
}

.checkout-btn:hover {
    background-color: var(--primary-dark);
}

/* Checkout Overlay */
.checkout-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
    justify-content: center;
    align-items: center;
}

/* Add to your existing CSS */
#card-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checkout-form {
    background-color: white;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    padding: 2rem;
    border-radius: 8px;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.close-checkout {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-gray);
    transition: color 0.3s;
}

.close-checkout:hover {
    color: var(--text-color);
}

.checkout-form h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.submit-order {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border-radius: 4px;
    margin-top: 1rem;
    transition: background-color 0.3s;
}

.submit-order:hover {
    background-color: var(--primary-dark);
}

/* Order Confirmation */
.order-confirmation {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    display: none;
    justify-content: center;
    align-items: center;
}

.confirmation-content {
    background-color: white;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-out;
}

.close-confirmation {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-gray);
    transition: color 0.3s;
}

.close-confirmation:hover {
    color: var(--text-color);
}

.confirmation-content i {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.confirmation-content h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.confirmation-content p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.continue-shopping {
    padding: 0.8rem 2rem;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border-radius: 4px;
    margin-top: 1rem;
    transition: background-color 0.3s;
}

.continue-shopping:hover {
    background-color: var(--primary-dark);
}

/* Footer */
footer {
    background-color: var(--text-color);
    color: white;
    padding: 3rem 5% 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a:hover {
    color: var(--primary-light);
}

.footer-section p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.footer-section i {
    margin-right: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #444;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    nav ul {
        display: none;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .cart {
        max-width: 100%;
    }
}

@media (max-width: 960px) and (min-width: 769px) {
    nav ul {
        flex-wrap: nowrap;
    }

    nav ul li {
        margin-left: 0.5rem;
        /* Even less gap between all navbar items */
    }

    nav ul li a#login-link,
    nav ul li a#signup-link {
        padding: 0.25rem 0.6rem;
        font-size: 0.92rem;
        min-width: 60px;
    }

    nav ul li a#signup-link {
        margin-left: 0.1rem;
        /* Minimal gap */
    }
}
