/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    
    --bg-dark: #0f0f23;
    --bg-card: #1a1a2e;
    --bg-hover: #16213e;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6c6c84;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.4);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--text-primary);
}

.cart-icon {
    position: relative;
    font-size: 28px;
    cursor: pointer;
    transition: var(--transition);
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary-gradient);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
}

/* ===== HEADER ===== */
.store-header {
    margin-top: 80px;
    padding: 60px 0;
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(102, 126, 234, 0.15), transparent);
}

.store-header h1 {
    font-size: 48px;
    margin-bottom: 15px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.store-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* ===== FILTER SECTION ===== */
.filter-section {
    padding: 40px 0;
    background: var(--bg-card);
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 12px 30px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    background: var(--bg-dark);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: var(--shadow-glow);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

/* ===== PRODUCTS SECTION ===== */
.products-section {
    padding: 60px 0 120px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 126, 234, 0.5);
}

.product-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-gradient);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.product-rating {
    font-size: 14px;
    color: #ffd700;
    margin-bottom: 10px;
}

.product-price {
    font-size: 24px;
    font-weight: bold;
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.product-stock {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.quick-add-btn,
.view-details-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.quick-add-btn {
    background: var(--success-gradient);
    color: white;
}

.quick-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.view-details-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(102, 126, 234, 0.5);
}

.view-details-btn:hover {
    background: var(--primary-gradient);
    border-color: transparent;
}

/* ===== CART SIDEBAR ===== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 25px;
    background: var(--primary-gradient);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 24px;
    color: white;
}

.close-cart {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: var(--transition);
}

.close-cart:hover {
    transform: rotate(90deg);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--bg-hover);
    border-radius: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.cart-item-info p {
    font-size: 18px;
    font-weight: bold;
    color: #43e97b;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-controls button {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.cart-item-controls button:hover {
    transform: scale(1.1);
}

.cart-item-controls span {
    font-size: 16px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.remove-item {
    background: var(--secondary-gradient);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.remove-item:hover {
    transform: scale(1.1);
}

.cart-footer {
    padding: 25px;
    background: var(--bg-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
}

.cart-total span:last-child {
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: var(--success-gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== PRODUCT MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    color: var(--text-primary);
    cursor: pointer;
    background: var(--bg-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1;
}

.close-modal:hover {
    background: var(--secondary-gradient);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

.modal-image img {
    width: 100%;
    border-radius: 15px;
}

.modal-details h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.modal-category {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.modal-price {
    font-size: 36px;
    font-weight: bold;
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 25px;
}

.modal-specs {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.modal-specs h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.modal-specs p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-specs strong {
    color: var(--text-primary);
    text-transform: capitalize;
}

.modal-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-dark);
    padding: 10px;
    border-radius: 10px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
}

.qty-btn:hover {
    transform: scale(1.1);
}

#modalQuantity {
    width: 60px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: bold;
}

.add-to-cart-btn {
    flex: 1;
    padding: 15px 30px;
    background: var(--success-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-gradient);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 4000;
    transition: var(--transition);
}

.notification.show {
    bottom: 30px;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-card);
    padding: 30px 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    margin-bottom: 5px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 768px) {
    .store-header h1 {
        font-size: 32px;
    }
    
    .filter-controls {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .nav-right {
        gap: 15px;
    }
    
    .back-link {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}