/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* Header Styles */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.logo-img:hover {
    transform: scale(1.02);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.logo-tagline {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.main-nav ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-weight: 500;
    color: var(--text-color);
    padding: 10px 0;
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--secondary-color);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-icon,
.wishlist-icon {
    position: relative;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.cart-icon:hover,
.wishlist-icon:hover {
    color: var(--secondary-color);
}

.cart-count,
.wishlist-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
}

.login-btn {
    background: var(--secondary-color);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
}

.login-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--text-color);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 15px;
    position: relative;
    width: 100%;
    max-width: 450px;
    z-index: 1;
    box-shadow: var(--shadow-hover);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--text-light);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent-color);
}

.auth-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    padding: 10px 0;
    font-weight: 500;
    color: var(--text-light);
    position: relative;
}

.auth-tab.active {
    color: var(--secondary-color);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--secondary-color);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form.hidden {
    display: none;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-color);
}

.forgot-password {
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    padding: 30px 0;
}

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* Sidebar Styles */
.sidebar {
    background: var(--bg-white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-section select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.filter-section select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.clear-filters-btn {
    background: var(--bg-light);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    width: 100%;
    transition: var(--transition);
}

.clear-filters-btn:hover {
    background: var(--accent-color);
    color: white;
}

.reset-link {
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: normal;
}

.price-range {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-input {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.price-input span {
    font-size: 0.8rem;
    color: var(--text-light);
}

.price-input input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.9rem;
}

.separator {
    color: var(--text-light);
}

.apply-filter-btn {
    background: var(--secondary-color);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.apply-filter-btn:hover {
    background: var(--primary-color);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-list > li > a {
    display: block;
    padding: 8px 0;
    color: var(--text-color);
    font-weight: 500;
}

.category-list > li > a:hover,
.category-list > li > a.active {
    color: var(--secondary-color);
}

.subcategory {
    padding-left: 20px;
    margin-top: 8px;
}

.subcategory li a {
    display: block;
    padding: 5px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.subcategory li a:hover {
    color: var(--secondary-color);
}

/* Products Section */
.products-section {
    background: var(--bg-white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.products-count {
    font-weight: 600;
    color: var(--primary-color);
}

.view-options {
    display: flex;
    gap: 15px;
}

.quick-filter-toggle,
.category-toggle {
    background: var(--bg-light);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.quick-filter-toggle:hover,
.category-toggle:hover {
    background: var(--secondary-color);
    color: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Product Card */
.product-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.product-image {
    position: relative;
    padding: 20px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 250px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.discount-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-info {
    padding: 20px;
    position: relative;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.current-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.original-price {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.add-to-cart-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--secondary-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.add-to-cart-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* PWA Banner */
.pwa-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 1000;
}

.pwa-banner p {
    font-size: 0.9rem;
}

.pwa-close {
    background: none;
    color: white;
    font-size: 1.5rem;
    position: absolute;
    right: 20px;
}

/* Footer Styles */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 60px 0 30px;
    margin-top: 50px;
}

.footer-logo {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo-img {
    height: 60px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: var(--transition);
}

.footer-logo-img:hover {
    opacity: 1;
    transform: scale(1.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.footer-column ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-column ul li a:hover {
    color: white;
}

.about-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.8;
}

.address {
    margin-top: 15px;
}

.address p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--accent-color);
    color: white;
    padding: 10px;
    text-align: center;
    z-index: 3000;
}

.offline-banner.hidden {
    display: none;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: none;
    }

    .sidebar.active {
        display: block;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .header-actions {
        order: 3;
        width: 100%;
        justify-content: flex-end;
        margin-top: 15px;
    }

    .products-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 20px;
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.4rem;
    }

    .logo-img {
        height: 40px;
    }

    .product-image {
        height: 200px;
    }

    .product-info {
        padding: 15px;
    }

    .product-title {
        font-size: 0.9rem;
    }
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading State */
.loading-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading-products i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.loading-products p {
    font-size: 1rem;
}

/* No Products State */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-products i {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 15px;
}

.no-products h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.no-products p {
    font-size: 0.95rem;
}
