/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo a {
    font-size: 1.8rem;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}
.mobile-nav-items {
    display: none;
    align-items: center;
    gap: 1rem;
}

.mobile-nav-items {
    display: flex;
    gap: 1rem;
}

.mobile-nav-items li {
    list-style: none;
}

.mobile-nav-items a {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-nav-items a:hover {
    background-color: #f8f9fa;
}

.mobile-nav-items a.has-items {
    color: #007bff;
    font-weight: bold;
}

.mobile-nav-items a.has-items i {
    color: #007bff;
}

.mobile-to-logo {
    display: block;
}

nav {
    position: relative;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 2rem;
    position: relative;
}

nav ul li a {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul li a:hover {
    background-color: #f8f9fa;
}

nav ul li a.has-items {
    color: #007bff;
    font-weight: bold;
}

nav ul li a.has-items i {
    color: #007bff;
}

nav ul li a i {
    font-size: 1rem;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    min-width: 150px;
    z-index: 1001;
}

.dropdown-menu li {
    margin: 0;
    border-bottom: 1px solid #eee;
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu li a {
    padding: 0.75rem 1rem;
    display: block;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: #f8f9fa;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu.show {
    display: block;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    padding: 0.5rem;
    margin-left: auto;
    order: 2;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background-color: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

.toast .close-btn {
    float: right;
    margin-left: 1rem;
    cursor: pointer;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.toast .close-btn:hover {
    color: #ccc;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    position: relative;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
}

.close-modal:hover {
    color: black;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Quick View Modal Content */
.quick-view-content {
    padding: 0;
    max-width: 100%;
}

.quick-view-header {
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.quick-view-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.quick-view-body {
    display: flex;
    gap: 20px;
    padding: 0 20px 20px 20px;
}

.quick-view-images {
    flex: 1;
    text-align: center;
}

.quick-view-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quick-view-info .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

.quick-view-info .stock {
    color: #666;
    font-size: 0.9rem;
}

.quick-view-info .description p {
    margin: 0;
    color: #555;
    line-height: 1.5;
}

.quick-view-info .product-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.quick-view-info .product-actions .btn {
    width: 100%;
    text-align: center;
}

.btn-outline {
    background: transparent;
    border: 2px solid #007bff;
    color: #007bff;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
}


/* Loading and Error States */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    color: #666;
}

.error {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    color: #dc3545;
    background-color: #f8d7da;
    border-radius: 8px;
    margin: 1rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Product Grid */
.product-grid,
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    align-items: stretch;
}

.product-card,
.category-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover,
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.product-card img,
.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover img,
.category-card:hover img {
    transform: scale(1.05);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.product-card:hover .product-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.btn-icon {
    background: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.btn-icon:hover {
    transform: scale(1.1);
    background: #007bff;
    color: white;
}

.btn-icon i {
    font-size: 1.2rem;
}

.product-card h3,
.category-card h3 {
    padding: 1rem;
    font-size: 1.2rem;
    margin: 0;
    flex-grow: 1;
}

.product-card p,
.category-card p {
    padding: 0 1rem;
    color: #666;
    flex-grow: 1;
}

.product-card .price {
    padding: 0 1rem;
    font-size: 1.3rem;
    font-weight: bold;
    color: #007bff;
}

.product-actions {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #555;
}

/* Login/Register Forms */
.login-form,
.register-form {
    max-width: 400px;
    margin: 4rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Cart Styles */
.cart-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
}

.item-details {
    flex: 1;
}

.item-details h4 {
    margin-bottom: 0.5rem;
}

.cart-summary {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.total {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.cart-actions {
    display: flex;
    gap: 1rem;
}

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.product-images {
    text-align: center;
}

.main-image img {
    max-width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.thumbnail-images {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.thumbnail-images img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

.product-info h1 {
    margin-bottom: 1rem;
}

.price {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 1rem;
}

.stock {
    color: #666;
    margin-bottom: 1rem;
}

.description {
    margin-bottom: 2rem;
}

.product-actions {
    display: flex;
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .logo-section {
        position: relative;
        width: 100%;
    }

    .mobile-nav-items {
        display: flex;
    }

    .mobile-to-logo {
        position: static;
        display: block;
        background: transparent;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .header-icons {
        position: absolute;
        top: 0;
        right: 0;
        background: white;
        padding: 1rem;
        border-radius: 4px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .hamburger {
        display: none;
    }

    nav {
        width: 100%;
    }

    nav ul {
        flex-direction: column;
        position: static;
        top: auto;
        left: auto;
        right: auto;
        width: 100%;
        background-color: transparent;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        display: flex;
        z-index: auto;
        border: none;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
    }

    nav ul li {
        margin: 0;
        width: 100%;
    }

    nav ul li a {
        padding: 1rem;
        justify-content: flex-start;
        border-bottom: 1px solid #eee;
    }

    nav ul li:last-child a {
        border-bottom: none;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        background-color: #f8f9fa;
    }

    .dropdown-menu li a {
        padding-left: 2rem;
    }

    .mobile-to-logo {
        position: static;
        display: block;
        background: transparent;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .product-detail {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .product-grid,
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .cart-item {
        flex-direction: column;
        text-align: center;
    }

    .cart-item img {
        margin-bottom: 1rem;
        margin-right: 0;
    }
}