/**
 * VPD - Virtual Products Download Styles
 * Design moderne et élégant pour produits téléchargeables
 * 
 * @package VPD
 * @version 1.0.0
 */

/* ========================================
   CSS Variables - Thème Moderne
   ======================================== */
:root {
    /* Couleurs principales */
    --vpd-primary: #6366f1;
    --vpd-primary-dark: #4f46e5;
    --vpd-primary-light: #818cf8;
    --vpd-secondary: #8b5cf6;
    --vpd-accent: #f472b6;
    --vpd-success: #10b981;
    --vpd-warning: #f59e0b;
    --vpd-error: #ef4444;
    
    /* Backgrounds */
    --vpd-bg-dark: #0f172a;
    --vpd-bg-card: #1e293b;
    --vpd-bg-card-hover: #334155;
    --vpd-bg-surface: #1e293b;
    
    /* Texte */
    --vpd-text-primary: #f8fafc;
    --vpd-text-secondary: #94a3b8;
    --vpd-text-muted: #64748b;
    
    /* Gradients */
    --vpd-gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --vpd-gradient-card: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    --vpd-gradient-glow: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    
    /* Bordures et effets */
    --vpd-border-color: rgba(148, 163, 184, 0.1);
    --vpd-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --vpd-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --vpd-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --vpd-shadow-glow: 0 0 40px rgba(99, 102, 241, 0.2);
    
    /* Dimensions */
    --vpd-radius-sm: 8px;
    --vpd-radius-md: 12px;
    --vpd-radius-lg: 16px;
    --vpd-radius-xl: 24px;
    
    /* Transitions */
    --vpd-transition-fast: 0.15s ease;
    --vpd-transition-normal: 0.25s ease;
    --vpd-transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --vpd-font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --vpd-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ========================================
   Base Styles
   ======================================== */
.vpd-store,
.vpd-store * {
    box-sizing: border-box;
}

.vpd-store {
    font-family: var(--vpd-font-primary);
    color: var(--vpd-text-primary);
    background: var(--vpd-bg-dark);
    min-height: 100vh;
    padding: 40px 30px;
    position: relative;
}

/* Background Effects */
.vpd-store::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 500px;
    background: var(--vpd-gradient-glow);
    pointer-events: none;
}

.vpd-page {
    background: var(--vpd-bg-dark);
    color: var(--vpd-text-primary);
    font-family: var(--vpd-font-primary);
}

/* ========================================
   Filters Bar
   ======================================== */
.vpd-filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px 24px;
    background: var(--vpd-bg-card);
    border: 1px solid var(--vpd-border-color);
    border-radius: var(--vpd-radius-lg);
}

.vpd-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.vpd-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--vpd-text-muted);
}

.vpd-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: var(--vpd-bg-dark);
    border: 1px solid var(--vpd-border-color);
    border-radius: var(--vpd-radius-md);
    color: var(--vpd-text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--vpd-transition-fast);
}

.vpd-search-input:focus {
    outline: none;
    border-color: var(--vpd-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.vpd-search-input::placeholder {
    color: var(--vpd-text-muted);
}

.vpd-filters-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vpd-filter-select-wrapper {
    position: relative;
}

.vpd-filter-select {
    appearance: none;
    padding: 12px 44px 12px 16px;
    background: var(--vpd-bg-dark);
    border: 1px solid var(--vpd-border-color);
    border-radius: var(--vpd-radius-md);
    color: var(--vpd-text-primary);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--vpd-transition-fast);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.vpd-filter-select:focus {
    outline: none;
    border-color: var(--vpd-primary);
}

.vpd-filter-select:hover {
    border-color: var(--vpd-primary-light);
}

/* View Toggle */
.vpd-view-toggle {
    display: flex;
    background: var(--vpd-bg-dark);
    border: 1px solid var(--vpd-border-color);
    border-radius: var(--vpd-radius-md);
    padding: 4px;
}

.vpd-view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--vpd-radius-sm);
    color: var(--vpd-text-muted);
    cursor: pointer;
    transition: var(--vpd-transition-fast);
}

.vpd-view-btn:hover {
    color: var(--vpd-text-primary);
}

.vpd-view-btn.active {
    background: var(--vpd-primary);
    color: white;
}

.vpd-view-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Products Grid
   ======================================== */
.vpd-products-grid {
    display: grid;
    gap: 24px;
    position: relative;
}

.vpd-columns-2 { grid-template-columns: repeat(2, 1fr); }
.vpd-columns-3 { grid-template-columns: repeat(3, 1fr); }
.vpd-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* List View */
.vpd-products-grid.vpd-list-view {
    grid-template-columns: 1fr;
}

.vpd-products-grid.vpd-list-view .vpd-product-card {
    display: flex;
    flex-direction: row;
}

.vpd-products-grid.vpd-list-view .vpd-card-image-wrapper {
    width: 200px;
    flex-shrink: 0;
}

.vpd-products-grid.vpd-list-view .vpd-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Product Card
   ======================================== */
.vpd-product-card {
    position: relative;
    background: var(--vpd-bg-card);
    border: 1px solid var(--vpd-border-color);
    border-radius: var(--vpd-radius-lg);
    overflow: hidden;
    transition: var(--vpd-transition-normal);
}

.vpd-product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--vpd-shadow-lg), var(--vpd-shadow-glow);
}

/* Card Image */
.vpd-card-image-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--vpd-bg-dark);
}

.vpd-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.vpd-product-card:hover .vpd-card-image {
    transform: scale(1.05);
}

/* Quick Actions */
.vpd-card-quick-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--vpd-transition-normal);
    z-index: 5;
}

.vpd-product-card:hover .vpd-card-quick-actions {
    opacity: 1;
    transform: translateY(0);
}

.vpd-quick-favorite,
.vpd-quick-view {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--vpd-radius-md);
    color: white;
    cursor: pointer;
    text-decoration: none;
    transition: var(--vpd-transition-fast);
}

.vpd-quick-favorite:hover {
    background: var(--vpd-accent);
    border-color: var(--vpd-accent);
}

.vpd-quick-view:hover {
    background: var(--vpd-primary);
    border-color: var(--vpd-primary);
}

.vpd-quick-favorite.is-favorite {
    background: var(--vpd-accent);
    border-color: var(--vpd-accent);
}

.vpd-quick-favorite svg,
.vpd-quick-view svg {
    width: 18px;
    height: 18px;
}

/* File Badge */
.vpd-file-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 14px;
    z-index: 2;
}

/* Sale Badge */
.vpd-sale-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 6px 14px;
    background: var(--vpd-accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 20px;
    z-index: 2;
}

/* Card Overlay */
.vpd-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.8) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    opacity: 0;
    transition: var(--vpd-transition-normal);
}

.vpd-product-card:hover .vpd-card-overlay {
    opacity: 1;
}

.vpd-card-link {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vpd-primary);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transform: translateY(20px);
    transition: var(--vpd-transition-normal);
}

.vpd-product-card:hover .vpd-card-link {
    transform: translateY(0);
}

.vpd-card-link:hover {
    background: var(--vpd-primary-dark);
    transform: scale(1.1);
}

.vpd-card-link svg {
    width: 22px;
    height: 22px;
}

/* Card Content */
.vpd-card-content {
    padding: 20px;
}

.vpd-card-header {
    margin-bottom: 12px;
}

.vpd-card-category {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--vpd-primary-light);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.vpd-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.4;
}

.vpd-card-title a {
    color: var(--vpd-text-primary);
    text-decoration: none;
    transition: var(--vpd-transition-fast);
}

.vpd-card-title a:hover {
    color: var(--vpd-primary-light);
}

.vpd-card-vendor {
    font-size: 13px;
    color: var(--vpd-text-muted);
}

/* Card Meta */
.vpd-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--vpd-border-color);
}

.vpd-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--vpd-text-secondary);
}

.vpd-meta-item svg {
    color: var(--vpd-text-muted);
}

.vpd-rating svg {
    color: #fbbf24;
    fill: #fbbf24;
}

/* Card Footer */
.vpd-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.vpd-card-price {
    display: flex;
    flex-direction: column;
}

.vpd-price-old {
    font-size: 13px;
    color: var(--vpd-text-muted);
    text-decoration: line-through;
}

.vpd-price-current {
    font-size: 20px;
    font-weight: 700;
    color: var(--vpd-success);
}

/* Add to Cart Button */
.vpd-add-to-cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--vpd-gradient-primary);
    border: none;
    border-radius: var(--vpd-radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--vpd-transition-fast);
}

.vpd-add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.vpd-add-to-cart-btn svg {
    width: 18px;
    height: 18px;
}

.vpd-add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ========================================
   No Products
   ======================================== */
.vpd-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    background: var(--vpd-bg-card);
    border: 1px dashed var(--vpd-border-color);
    border-radius: var(--vpd-radius-lg);
}

.vpd-no-products-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.vpd-no-products h3 {
    font-size: 20px;
    margin: 0 0 10px;
    color: var(--vpd-text-primary);
}

.vpd-no-products p {
    color: var(--vpd-text-secondary);
    margin: 0;
}

/* ========================================
   Pagination
   ======================================== */
.vpd-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--vpd-border-color);
}

.vpd-pagination-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vpd-bg-card);
    border: 1px solid var(--vpd-border-color);
    border-radius: var(--vpd-radius-md);
    color: var(--vpd-text-primary);
    cursor: pointer;
    transition: var(--vpd-transition-fast);
}

.vpd-pagination-btn:hover:not(:disabled) {
    background: var(--vpd-primary);
    border-color: var(--vpd-primary);
}

.vpd-pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.vpd-pagination-btn svg {
    width: 20px;
    height: 20px;
}

.vpd-pagination-info {
    font-size: 15px;
    color: var(--vpd-text-secondary);
    font-family: var(--vpd-font-mono);
}

.vpd-current-page {
    color: var(--vpd-primary-light);
    font-weight: 600;
}

/* ========================================
   Loader
   ======================================== */
.vpd-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 60px;
    color: var(--vpd-text-secondary);
}

.vpd-loader.active {
    display: flex;
}

.vpd-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--vpd-border-color);
    border-top-color: var(--vpd-primary);
    border-radius: 50%;
    animation: vpd-spin 0.8s linear infinite;
}

@keyframes vpd-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Categories Grid
   ======================================== */
.vpd-categories-grid {
    display: grid;
    gap: 20px;
}

.vpd-category-card {
    display: flex;
    flex-direction: column;
    background: var(--vpd-bg-card);
    border: 1px solid var(--vpd-border-color);
    border-radius: var(--vpd-radius-lg);
    overflow: hidden;
    text-decoration: none;
    transition: var(--vpd-transition-normal);
}

.vpd-category-card:hover {
    transform: translateY(-4px);
    border-color: var(--vpd-primary);
    box-shadow: var(--vpd-shadow-glow);
}

.vpd-category-image {
    aspect-ratio: 16/9;
    background: var(--vpd-bg-dark);
    overflow: hidden;
}

.vpd-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.vpd-category-card:hover .vpd-category-image img {
    transform: scale(1.05);
}

.vpd-category-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    opacity: 0.3;
}

.vpd-category-info {
    padding: 20px;
    text-align: center;
}

.vpd-category-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--vpd-text-primary);
    margin: 0 0 6px;
}

.vpd-category-count {
    font-size: 13px;
    color: var(--vpd-text-muted);
}

/* ========================================
   Vendors Grid
   ======================================== */
.vpd-vendors-grid {
    display: grid;
    gap: 20px;
}

.vpd-vendor-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    background: var(--vpd-bg-card);
    border: 1px solid var(--vpd-border-color);
    border-radius: var(--vpd-radius-lg);
    text-decoration: none;
    transition: var(--vpd-transition-normal);
}

.vpd-vendor-card:hover {
    transform: translateY(-4px);
    border-color: var(--vpd-primary);
    box-shadow: var(--vpd-shadow-glow);
}

.vpd-vendor-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--vpd-gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
}

.vpd-vendor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vpd-vendor-avatar span {
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.vpd-vendor-info {
    text-align: center;
}

.vpd-vendor-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--vpd-text-primary);
    margin: 0 0 6px;
}

.vpd-vendor-count {
    font-size: 13px;
    color: var(--vpd-text-muted);
}

/* ========================================
   Toast Notifications
   ======================================== */
.vpd-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--vpd-bg-card);
    border: 1px solid var(--vpd-border-color);
    border-radius: var(--vpd-radius-md);
    color: var(--vpd-text-primary);
    font-size: 14px;
    box-shadow: var(--vpd-shadow-lg);
    z-index: 99999;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.vpd-toast.show {
    transform: translateX(0);
}

.vpd-toast.success {
    border-left: 4px solid var(--vpd-success);
}

.vpd-toast.error {
    border-left: 4px solid var(--vpd-error);
}

.vpd-toast.info {
    border-left: 4px solid var(--vpd-primary);
}

.vpd-toast-icon {
    font-size: 20px;
}

.vpd-toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--vpd-text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1200px) {
    .vpd-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .vpd-columns-3,
    .vpd-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vpd-filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vpd-search-wrapper {
        min-width: 100%;
    }
    
    .vpd-filters-group {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .vpd-store {
        padding: 20px 15px;
    }
    
    .vpd-filters-bar {
        padding: 15px;
        gap: 15px;
    }
    
    .vpd-columns-2,
    .vpd-columns-3,
    .vpd-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .vpd-products-grid {
        gap: 16px;
    }
    
    .vpd-card-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vpd-add-to-cart-btn {
        justify-content: center;
    }
    
    .vpd-products-grid.vpd-list-view .vpd-product-card {
        flex-direction: column;
    }
    
    .vpd-products-grid.vpd-list-view .vpd-card-image-wrapper {
        width: 100%;
    }
    
    .vpd-toast {
        left: 15px;
        right: 15px;
        bottom: 15px;
    }
}

/* ========================================
   Featured Products
   ======================================== */
.vpd-featured-section {
    margin-bottom: 40px;
}

.vpd-featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.vpd-featured-grid .vpd-product-card.vpd-featured {
    grid-column: span 2;
    grid-row: span 2;
}

.vpd-featured-grid .vpd-product-card.vpd-featured .vpd-card-image-wrapper {
    aspect-ratio: 1;
}

@media (max-width: 992px) {
    .vpd-featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vpd-featured-grid .vpd-product-card.vpd-featured {
        grid-column: span 2;
        grid-row: span 1;
    }
}

@media (max-width: 576px) {
    .vpd-featured-grid {
        grid-template-columns: 1fr;
    }
    
    .vpd-featured-grid .vpd-product-card.vpd-featured {
        grid-column: span 1;
    }
}
