* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: #1a1a1a;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-cart-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-btn {
    padding: 0.6rem 1.5rem;
    background: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-btn:hover {
    background: white;
    color: #1a1a1a;
}

.signup-btn {
    background: #d4af37;
    border-color: #d4af37;
}

.signup-btn:hover {
    background: #b8941f;
    border-color: #b8941f;
    color: white;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: #d4af37;
    font-weight: bold;
}

.logout-btn {
    padding: 0.6rem 1.5rem;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #cc0000;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #d4af37;
}

.cart {
    position: relative;
    cursor: pointer;
}

.cart-icon {
    font-size: 1.5rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d4af37;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.checkout-btn {
    padding: 0.6rem 1.5rem;
    background: #d4af37;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    margin-left: 1rem;
}

.checkout-btn:hover {
    background: #b8941f;
}

.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
                url('https://images.unsplash.com/photo-1594534475808-b18fc33b045e?w=1600&h=800&fit=crop') center/cover;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    letter-spacing: 3px;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: #d4af37;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.cta-button:hover {
    background: #b8941f;
}

.products {
    padding: 5rem 5%;
    background: #f8f8f8;
}

.products h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #1a1a1a;
}

.products-container {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.categories-sidebar {
    width: 250px;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.categories-sidebar h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

.category-list {
    list-style: none;
}

.category-btn {
    width: 100%;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    background: #f8f8f8;
    border: none;
    border-radius: 5px;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    color: #333;
}

.category-btn:hover {
    background: #e0e0e0;
}

.category-btn.active {
    background: #d4af37;
    color: white;
    font-weight: bold;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    flex: 1;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card.hidden {
    display: none;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 300px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #d4af37;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.description {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    height: 3em;
    flex-grow: 1;
}

.price {
    font-size: 1.8rem;
    color: #d4af37;
    font-weight: bold;
    margin-bottom: 1rem;
    margin-top: auto;
}

.add-to-cart {
    width: 100%;
    padding: 0.8rem;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-cart:hover {
    background: #333;
}

.about {
    padding: 5rem 5%;
    background: white;
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

.about-content > p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    padding: 2rem;
}

.feature .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.feature h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.feature p {
    color: #666;
}

.contact {
    padding: 5rem 5%;
    background: #f8f8f8;
}

.contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #1a1a1a;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.contact-form button {
    padding: 1rem;
    background: #d4af37;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.contact-form button:hover {
    background: #b8941f;
}

footer {
    background: #1a1a1a;
    color: white;
    padding: 2rem 5%;
    text-align: center;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #d4af37;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    color: #1a1a1a;
}

.close-modal {
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #1a1a1a;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

#cartItems {
    margin-bottom: 2rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f9f9f9;
}

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

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

.cart-item-details h4 {
    margin: 0 0 0.5rem 0;
    color: #1a1a1a;
    font-size: 1.2rem;
}

.cart-item-details p {
    margin: 0;
    color: #666;
}

.cart-item-price {
    font-size: 1.3rem;
    color: #d4af37;
    font-weight: bold;
}

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

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1.2rem;
    transition: background 0.3s;
}

.qty-btn:hover {
    background: #f0f0f0;
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.remove-item {
    background: #ff4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.remove-item:hover {
    background: #cc0000;
}

.cart-total {
    text-align: right;
    padding: 1rem 0;
    border-top: 2px solid #ddd;
}

.cart-total h3 {
    margin: 0;
    font-size: 1.8rem;
    color: #1a1a1a;
}

#totalPrice {
    color: #d4af37;
}

.empty-cart {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-cart p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-top: 1px solid #ddd;
    gap: 1rem;
}

.continue-shopping,
.place-order {
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.continue-shopping {
    background: #666;
    color: white;
}

.continue-shopping:hover {
    background: #555;
}

.place-order {
    background: #d4af37;
    color: white;
}

.place-order:hover {
    background: #b8941f;
}

/* Auth Modal Styles */
.auth-modal {
    max-width: 450px;
}

.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: bold;
    color: #1a1a1a;
}

.form-group input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #d4af37;
}

.auth-submit-btn {
    padding: 1rem;
    background: #d4af37;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 1rem;
}

.auth-submit-btn:hover {
    background: #b8941f;
}

.auth-switch {
    text-align: center;
    color: #666;
    margin-top: 1rem;
}

.switch-link {
    color: #d4af37;
    cursor: pointer;
    font-weight: bold;
}

.switch-link:hover {
    text-decoration: underline;
}

/* Error Modal Styles */
.error-modal {
    max-width: 400px;
    text-align: center;
    padding: 2rem;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

.error-btn {
    padding: 0.8rem 3rem;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: bold;
}

.error-btn:hover {
    background: #cc0000;
}

@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .products-container {
        flex-direction: column;
    }

    .categories-sidebar {
        width: 100%;
        position: static;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .checkout-btn {
        margin-left: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .modal-content {
        width: 95%;
    }

    .cart-item {
        flex-direction: column;
        text-align: center;
    }

    .modal-footer {
        flex-direction: column;
    }

    .auth-cart-section {
        gap: 0.5rem;
    }

    .auth-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .nav-links {
        display: none;
    }
}
