/* ════════════════════════════════════════════════════════════════════
   Enhanced Card System - Modern & Interactive
   ════════════════════════════════════════════════════════════════════ */

:root {
    --card-bg: #fff;
    --card-border-color: rgba(226, 232, 240, 0.8);
    --card-border-radius: 24px;
    --card-padding: 24px;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.12);
    --card-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Base Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border-color);
    border-radius: var(--card-border-radius);
    padding: var(--card-padding);
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(37, 99, 235, 0.3);
}

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

/* Card Variants */
.card-primary {
    background: var(--card-gradient);
    color: white;
    border-color: transparent;
}

.card-primary::before {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0) 100%);
}

.card-secondary {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.card-glass {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.card-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.card-dark::before {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
}

/* Card Sizes */
.card-sm {
    --card-padding: 16px;
    --card-border-radius: 16px;
}

.card-lg {
    --card-padding: 32px;
    --card-border-radius: 32px;
}

.card-xl {
    --card-padding: 40px;
    --card-border-radius: 40px;
}

/* Interactive Cards */
.card-clickable {
    cursor: pointer;
    user-select: none;
}

.card-clickable:active {
    transform: translateY(-6px) scale(1.01);
}

/* Card with Icon */
.card-icon {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.card-icon .icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-gradient);
    color: white;
    flex-shrink: 0;
}

/* Card Stats */
.card-stat {
    text-align: center;
    padding: 20px;
}

.card-stat .stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Syne', sans-serif;
    margin-bottom: 8px;
    background: var(--card-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-stat .stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* Card Header */
.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    margin-bottom: 4px;
    color: #1e293b;
}

.card-subtitle {
    font-size: 0.875rem;
    color: #64748b;
}

/* Card Footer */
.card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Loading Skeleton Card */
.card-skeleton {
    background: linear-gradient(90deg, 
        #f8fafc 25%, 
        #e2e8f0 50%, 
        #f8fafc 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-color: #e2e8f0;
}

/* ── Professional Static Card Design ─────────────────────────── */
.b2b-card-static-wrapper {
    width: 100%;
    margin-bottom: 24px;
}

.b2b-card-static {
    width: 100%;
    aspect-ratio: 1.586/1; /* Standard credit card ratio */
    position: relative;
    border-radius: 20px;
    padding: 24px;
    color: white;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.b2b-product-card:hover .b2b-card-static {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.b2b-card-static::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 100% 0%, rgba(255,255,255,0.1) 0%, transparent 50%),
        linear-gradient(125deg, 
            rgba(255, 255, 255, 0.2) 0%, 
            rgba(255, 255, 255, 0.05) 40%, 
            rgba(255, 255, 255, 0) 50%, 
            rgba(255, 255, 255, 0.05) 60%, 
            rgba(255, 255, 255, 0.1) 100%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.b2b-card-static::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.b2b-card-static > * {
    position: relative;
    z-index: 2;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Unique Dual-Tone Divided Backgrounds */
.card-grad-gaming { 
    background: linear-gradient(135deg, #4f46e5 50%, #7c3aed 50%);
}
.card-grad-crypto { 
    background: linear-gradient(135deg, #f59e0b 50%, #d97706 50%);
}
.card-grad-entertainment { 
    background: linear-gradient(135deg, #dc2626 50%, #991b1b 50%);
}
.card-grad-shopping { 
    background: linear-gradient(135deg, #059669 50%, #065f46 50%);
}
.card-grad-general { 
    background: linear-gradient(135deg, #1e293b 50%, #0f172a 50%);
}

/* Glass split line */
.card-split-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-50%) rotate(45deg);
    z-index: 1;
}

/* Swing Pattern (Wave effect) */
.card-swing-pattern {
    position: absolute;
    top: 50%;
    left: 0;
    width: 200%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 600'%3E%3Cpath d='M0 300 C 150 150, 350 450, 500 300 C 650 150, 800 450, 800 300 L 800 600 L 0 600 Z' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E");
    background-size: 50% 100%;
    transform: translateY(-50%);
    opacity: 0.6;
    animation: waveSwing 10s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes waveSwing {
    0% { transform: translate(0, -50%); }
    100% { transform: translate(-50%, -50%); }
}

/* Abstract Mesh/Sphere elements for cards */
.b2b-card-static::before {
    content: '';
    position: absolute;
    top: -15%; right: -5%;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    filter: blur(15px);
    border-radius: 50%;
    z-index: 0;
}

.b2b-card-static::after {
    content: '';
    position: absolute;
    bottom: -5%; left: -2%;
    width: 100px; height: 100px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    filter: blur(20px);
    border-radius: 50%;
    z-index: 0;
}

/* Additional mesh overlay */
.card-mesh-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.1) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 0, 0, 0.1) 0, transparent 50%);
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
}

.card-chip {
    width: 42px;
    height: 32px;
    background: linear-gradient(135deg, #f3f4f6 0%, #d1d5db 100%);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    opacity: 0.9;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.5);
}

.card-chip::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 0.5px solid rgba(0,0,0,0.1);
    border-radius: 2px;
}

.card-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    margin: 0;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0.95;
}

.card-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.7;
    margin-bottom: 2px;
    font-weight: 600;
}

.card-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card-brand-logo {
    height: 30px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* ── Professional B2B Product Container ─────────────────────────── */
.b2b-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 24px 0;
}

.b2b-product-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    transition: all 0.4s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: none;
    overflow: visible;
}

.b2b-product-card:hover {
    transform: translateY(-8px);
}

.b2b-product-image-wrapper {
    width: 100%;
    aspect-ratio: 1.586/1;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    position: relative;
    z-index: 1;
}

.b2b-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.b2b-product-card:hover .b2b-product-image {
    transform: scale(1.05);
}

/* Floating Logo Container Improvement (Moved to details section) */
.b2b-logo-container {
    display: none; /* No longer used on card overlay */
}

.b2b-product-category {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #3b82f6;
    background: #eff6ff;
    padding: 6px 14px;
    border-radius: 99px;
    display: inline-block;
    margin-bottom: 14px;
    width: fit-content;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.b2b-product-name {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.b2b-product-card:hover .b2b-product-name {
    color: #2563eb;
}

.b2b-product-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.6;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 450;
}

.b2b-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.b2b-product-currency {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.b2b-product-btn {
    background: #0f172a;
    color: #ffffff;
    font-family: 'Syne', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 12px 22px;
    border-radius: 14px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.b2b-product-card:hover .b2b-product-btn {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.b2b-product-btn:active {
    transform: translateY(0);
}

.b2b-product-popular-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

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

/* Card List */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-list .card {
    margin: 0;
}

/* Card Grid */
.card-grid {
    display: grid;
    gap: 24px;
}

.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Mobile Responsive */
@media (max-width: 768px) {
    :root {
        --card-padding: 20px;
        --card-border-radius: 20px;
    }
    
    .card {
        margin: 8px 0;
    }
    
    .card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .card-grid {
        gap: 16px;
        grid-template-columns: 1fr !important;
    }
    
    .card-stat .stat-value {
        font-size: 1.5rem;
    }
    
    .card-icon {
        gap: 12px;
    }
    
    .card-icon .icon-wrapper {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    :root {
        --card-padding: 16px;
        --card-border-radius: 16px;
    }
    
    .card-sm {
        --card-padding: 12px;
        --card-border-radius: 12px;
    }
    
    .card-lg {
        --card-padding: 20px;
        --card-border-radius: 20px;
    }
}
