:root {
    --product-primary: #3b82f6;
    --product-secondary: #8b5cf6;
    --product-accent: #06b6d4;
    --product-orange: #ff9500;
    --product-green: #10b981;
    --product-red: #ef4444;
    --card-bg: rgba(31, 41, 55, 0.9);
    --card-border: rgba(75, 85, 99, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
}

.filter-btn {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.5);
    color: #d1d5db;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--product-primary);
    color: #ffffff;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--product-primary), var(--product-secondary));
    border-color: var(--product-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    overflow: hidden;
    position: relative;
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(59, 130, 246, 0.2);
}

.product-image {
    position: relative;
    height: 240px;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(31, 41, 55, 0.8));
    border-radius: 0.75rem 0.75rem 0 0;
    overflow: hidden;
    margin-bottom: 0;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.product-badge.red {
    background: rgba(239, 68, 68, 0.9);
}

.product-badge.blue {
    background: rgba(59, 130, 246, 0.9);
}

.product-badge.green {
    background: rgba(16, 185, 129, 0.9);
}

.product-badge.purple {
    background: rgba(139, 92, 246, 0.9);
}

.product-badge.orange {
    background: rgba(249, 115, 22, 0.9);
}

.category-icon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
    pointer-events: none;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-info {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.product-category {
    color: var(--product-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-title {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
}

.product-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.75rem;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.feature-tag {
    background: rgba(59, 130, 246, 0.2);
    color: var(--product-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.product-price {
    margin-bottom: 1.5rem;
}

.price-note {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 0.5rem;
    text-align: center;
}

.product-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-amazon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-amazon.primary {
    background: linear-gradient(135deg, var(--product-primary), var(--product-secondary));
    color: white;
    border: 1px solid transparent;
}

.btn-amazon.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-amazon.secondary {
    background: rgba(75, 85, 99, 0.8);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
}

.btn-amazon.secondary:hover {
    background: rgba(55, 65, 81, 0.9);
    color: white;
    border-color: var(--product-primary);
}

.btn-icon {
    font-size: 1rem;
}

.btn-text {
    font-weight: 600;
}

#productsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.loading-skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#noResults {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

#noResults.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease-out;
}

html {
    scroll-behavior: smooth;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 1280px) {
    #productsGrid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    #productsGrid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.25rem;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    #productsGrid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .product-image {
        height: 220px;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    #productsGrid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-card {
        max-width: 100%;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .btn-amazon {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.filter-btn:focus-visible,
.btn-amazon:focus-visible {
    outline: 2px solid var(--product-accent);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .product-card:hover {
        transform: translateY(-8px);
    }
}

@media (hover: none) and (pointer: coarse) {
    .product-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

.theme-dark {
    --card-bg: rgba(17, 24, 39, 0.95);
    --card-border: rgba(55, 65, 81, 0.4);
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-muted: #9ca3af;
}

.product-card.premium {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9), rgba(55, 65, 81, 0.8));
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.product-card.premium::before {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
}

.product-card.premium:hover {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(251, 191, 36, 0.3);
}