/* ====================================
   LEBOSS TECH - Enhanced Products CSS
   ==================================== */

/* ==================== GENERAL STYLES ==================== */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.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;
}

/* ==================== VIEW LAYOUTS ==================== */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* List view special layout */
.list-view .product-card {
    display: flex !important;
    align-items: center;
    padding: 1.5rem;
    min-height: 180px;
}

.list-view .product-card .relative {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    margin-right: 1.5rem;
}

.list-view .product-card .relative img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.75rem;
}

.list-view .product-card .p-5 {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
}

/* ==================== VIEW BUTTONS ==================== */
.view-btn {
    transition: all 0.2s ease;
    border-radius: 0.375rem;
}

.view-btn.active {
    background-color: white;
    color: #3b82f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.view-btn:hover {
    transform: scale(1.1);
}

/* ==================== PRODUCT CARDS ==================== */
.product-card {
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, transparent 0%, rgba(59, 130, 246, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-card:hover::before {
    opacity: 1;
}

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

/* ==================== QUICK ACTIONS ==================== */
.product-card .group:hover .opacity-0 {
    opacity: 1;
}

.favorite-btn,
.compare-btn {
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.favorite-btn:hover,
.compare-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.favorite-btn.active {
    background-color: #fef2f2 !important;
    color: #ef4444 !important;
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ==================== COMPARE MODE ==================== */
.compare-mode .product-card {
    position: relative;
}

.compare-mode .product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(147, 51, 234, 0.1);
    border: 2px solid #9333ea;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.compare-mode .product-card.selected::after {
    opacity: 1;
}

/* ==================== FILTERS SIDEBAR ==================== */
.filters-sidebar {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.filters-sidebar::-webkit-scrollbar {
    width: 4px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== PRICE BUTTONS ==================== */
.price-button {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.price-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    transition: left 0.3s ease;
}

.price-button:hover::before {
    left: 100%;
}

.price-button:hover {
    background-color: #dbeafe;
    color: #1d4ed8;
    transform: translateY(-2px);
}

/* ==================== MODAL STYLES ==================== */
.modal-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== COMPARE SIDEBAR ==================== */
.compare-sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.compare-sidebar .product-item {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.compare-sidebar .product-item:hover {
    border-color: #e5e7eb;
    background-color: #f9fafb;
    transform: translateX(-4px);
}

/* ==================== SEARCH AUTOCOMPLETE ==================== */
.search-container {
    position: relative;
}

.search-results {
    max-height: 320px;
    overflow-y: auto;
    border-top: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.search-results::-webkit-scrollbar {
    width: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.search-result-item {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.search-result-item:hover {
    background-color: #f8fafc;
    border-left-color: #3b82f6;
    transform: translateX(4px);
}

/* ==================== BADGES ==================== */
.badge {
    position: relative;
    overflow: hidden;
}

.badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.product-card:hover .badge::before {
    left: 100%;
}

/* ==================== NOTIFICATIONS ==================== */
.notification {
    animation: notificationSlide 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

@keyframes notificationSlide {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== PAGINATION ==================== */
.pagination-container {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .grid-view {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .list-view .product-card {
        flex-direction: column;
        text-align: center;
        min-height: auto;
    }
    
    .list-view .product-card .relative {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .list-view .product-card .p-5 {
        height: auto;
    }
    
    .compare-sidebar {
        width: 100vw !important;
    }
    
    .filters-sidebar {
        position: static;
        max-height: none;
    }
}

@media (max-width: 640px) {
    .grid-view {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-card:hover {
        transform: translateY(-4px);
    }
}

/* ==================== LOADING STATES ==================== */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==================== ACCESSIBILITY ==================== */
.product-card:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.favorite-btn:focus,
.compare-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .product-card .opacity-0,
    .favorite-btn,
    .compare-btn,
    .view-btn,
    .filters-sidebar {
        display: none !important;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

/* ==================== DARK MODE SUPPORT ==================== */
@media (prefers-color-scheme: dark) {
    .product-card {
        background: linear-gradient(145deg, #1f2937 0%, #111827 100%);
        color: #f9fafb;
    }
    
    .filters-sidebar {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .search-results {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .search-result-item:hover {
        background-color: #374151;
    }
} 