/**
 * Bento Grid + Glassmorphism Cards
 * Modern card design system for homepage
 * Keeps "Digital Services Made Simple" section unchanged
 */

:root {
    /* Cyberpunk Neon Colors */
    --card-primary: #00d4ff;
    --card-secondary: #ff4444;
    --card-accent: #b45aff;
    --card-success: #00ff88;
    --card-warning: #ffaa00;

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 20px;
    --glass-hover: rgba(255, 255, 255, 0.08);

    /* Dark Background */
    --dark-bg: #0a0a0a;
    --dark-secondary: #1a1a2e;
}

/* Featured Products Section */
.featured-products-section {
    padding: 60px 0;
    margin-top: 40px;
    position: relative;
}

.featured-products-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--card-primary), transparent);
    opacity: 0.3;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--card-primary), var(--card-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}

/* Bento Grid System */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Bento Card Sizes */
.bento-card {
    position: relative;
    min-height: 200px;
}

.bento-large {
    grid-column: span 8;
    grid-row: span 2;
    min-height: 420px;
}

.bento-medium {
    grid-column: span 4;
    min-height: 200px;
}

.bento-small {
    grid-column: span 3;
    min-height: 180px;
}

/* Mobile Responsive Bento */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .bento-large,
    .bento-medium,
    .bento-small {
        grid-column: span 1;
        min-height: 320px;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .bento-large {
        grid-column: span 12;
    }

    .bento-medium {
        grid-column: span 6;
    }

    .bento-small {
        grid-column: span 4;
    }
}

/* Glassmorphism Card Base */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 0.5px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;

    /* Performance optimization */
    will-change: transform, box-shadow, border-color;
    contain: layout style paint;
}

/* Glass Hover Effect */
.glass-card:hover {
    background: var(--glass-hover);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-8px);
    box-shadow:
        0 20px 60px rgba(0, 212, 255, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* Glass Gradient Overlay */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 212, 255, 0.05) 0%,
        transparent 40%,
        rgba(180, 90, 255, 0.03) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

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

/* Card Image Container */
.card-image-wrapper {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e, #0a0a0a);
}

.bento-large .card-image-wrapper {
    height: 240px;
}

.bento-medium .card-image-wrapper {
    height: 160px;
}

.bento-small .card-image-wrapper {
    height: 120px;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover .card-image {
    transform: scale(1.08);
}

/* Badges */
.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    z-index: 2;
}

.discount-badge,
.hot-badge,
.new-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(10px);
}

.discount-badge {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    font-size: 0.9rem;
}

.hot-badge {
    background: linear-gradient(135deg, var(--card-warning), #ff8800);
    color: #000;
    animation: pulse 2s infinite;
}

.new-badge {
    background: linear-gradient(135deg, var(--card-success), #00cc66);
    color: #000;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Card Content */
.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.bento-small .card-content {
    padding: 15px;
}

.card-category {
    color: var(--card-primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.glass-card:hover .card-title {
    color: var(--card-primary);
}

.bento-large .card-title {
    font-size: 1.75rem;
}

.bento-small .card-title {
    font-size: 1rem;
}

.card-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bento-small .card-description {
    display: none;
}

/* Card Stats */
.card-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stars {
    color: var(--card-warning);
    letter-spacing: 2px;
}

.rating-text {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.card-sold {
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-sold-icon {
    color: var(--card-success);
}

/* Card Footer - Thumb Zone */
.card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.card-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-original {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

.price-current {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bento-small .price-current {
    font-size: 1.25rem;
}

/* Thumb Zone Buy Button */
.card-buy-btn {
    background: linear-gradient(135deg, var(--card-primary), #0099cc);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.card-buy-btn:active {
    transform: translateY(0);
}

.bento-small .card-buy-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
}

/* Quick Actions */
.card-quick-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

.glass-card:hover .card-quick-actions {
    opacity: 1;
    transform: translateY(0);
}

.quick-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: var(--card-primary);
    color: #000;
    transform: scale(1.1);
}

/* Mobile - Always show quick actions */
@media (max-width: 768px) {
    .card-quick-actions {
        position: static;
        opacity: 1;
        transform: none;
        justify-content: center;
        margin-top: 15px;
    }
}

/* Trending Categories Section */
.trending-categories-section {
    padding: 60px 0;
    background: linear-gradient(180deg, transparent, rgba(26, 26, 46, 0.3), transparent);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.category-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 0.5px solid var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, var(--card-primary), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.category-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--card-primary);
}

.category-card:hover::before {
    opacity: 0.1;
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.category-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.category-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Loading Skeleton */
.skeleton-card {
    background: linear-gradient(135deg, #1a1a2e, #0a0a0a);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.skeleton-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    to { left: 100%; }
}

/* Staggered Entry Animations */
.glass-card {
    opacity: 0;
    animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card:nth-child(1) { animation-delay: 0.05s; }
.glass-card:nth-child(2) { animation-delay: 0.10s; }
.glass-card:nth-child(3) { animation-delay: 0.15s; }
.glass-card:nth-child(4) { animation-delay: 0.20s; }
.glass-card:nth-child(5) { animation-delay: 0.25s; }
.glass-card:nth-child(6) { animation-delay: 0.30s; }
.glass-card:nth-child(7) { animation-delay: 0.35s; }
.glass-card:nth-child(8) { animation-delay: 0.40s; }

/* Accessibility */
.glass-card:focus-within {
    outline: 3px solid var(--card-primary);
    outline-offset: 4px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .glass-card {
        opacity: 1;
        animation: none;
    }
}