/* eSIM Category Best Sellers Widget - FIXED VERSION */

/* Main Container */
.bestsellers-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.bestsellers-container {
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    padding: 15px;
}

/* Products List */
.bestsellers-list {
    display: grid;
    gap: 12px;
}

/* Individual Product Item - Grid Card Design */
.bestseller-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    border: 1px solid #E5E7EB;
    position: relative;
    display: flex !important; /* FIXED: Force flex display */
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
    flex-shrink: 0;
    box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
    opacity: 1 !important; /* FIXED: Force opacity */
    visibility: visible !important; /* FIXED: Force visibility */
    transition: all 0.3s ease;
}

/* FIXED: Hover states */
.bestseller-item:hover {
    transform: translateY(-2px);
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
}

/* FIXED: Selected state - chỉ thay đổi border và background, KHÔNG ẩn */
.bestseller-item.selected {
    border-color: #4CAF50 !important;
    background: rgba(76, 175, 80, 0.05) !important;
    display: flex !important; /* Đảm bảo vẫn hiển thị */
    opacity: 1 !important;
    visibility: visible !important;
}

/* FIXED: Loading state - chỉ giảm opacity, không ẩn */
.bestseller-item.loading {
    opacity: 0.6 !important;
    pointer-events: none;
    display: flex !important; /* Vẫn hiển thị khi loading */
    visibility: visible !important;
}

/* Header Row - Package Label + Discount Badge */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Price Section - Side by side */
.price-section {
    display: flex;
    align-items: baseline;
    gap: 10px;
    justify-content: flex-start;
    margin: 8px 0;
}

.original-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    line-height: 1;
}

.current-price {
    font-size: 20px;
    font-weight: 700;
    color: #FF6B35;
    line-height: 1;
}

/* Product Info List with Icons */
.product-info-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.info-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon svg {
    width: 100%;
    height: 100%;
}

.info-label {
    color: #6B7280;
    min-width: 60px;
    font-weight: 500;
}

.info-value {
    color: #1F2937;
    font-weight: 600;
    flex: 1;
    text-align: right;
}

/* Package Label - Top Left */
.package-label {
    background: #FFF3E0;
    color: #E65100;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    display: inline-block;
}

/* Package types colors */
.package-label.daily {
    background: #FFF3E0;
    color: #E65100;
}

.package-label.fixed {
    background: #E8F5E9;
    color: #2E7D32;
}

.package-label.unlimited {
    background: #E3F2FD;
    color: #1565C0;
}

/* Product Title - Compact */
.product-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Product Meta - Data usage below title */
.product-meta {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.2;
    display: none !important; /* Hidden as requested */
}

/* Discount Badge - Inline with package label */
.discount-badge {
    background: #FF5252;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    display: inline-block;
}

/* Select Button - Compact */
.select-btn {
    background: #FF6B35;
    color: white;
    border: none;
    padding: 3px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
    width: 80%;
    transition: all 0.3s ease;
}

.select-btn:hover {
    background: #E55A2B;
    transform: translateY(-1px);
}

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

.select-btn .btn-arrow {
    font-size: 14px;
}

/* FIXED: Selected button state */
.select-btn.selected-state {
    background: #4CAF50 !important;
    color: white !important;
}

/* Feature Badges Section */
.feature-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0px 0px 8px 0px;
    flex-wrap: wrap;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    line-height: 1;
    background: #f0f0f0;
    width: 28px;
    height: 28px;
}

.feature-badge svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Individual badge styling */
.feature-badge.tiktok {
    background: #FFF0F5;
}

.feature-badge.sms {
    background: #E8F5E9;
}

.feature-badge.call {
    background: #E8F5E9;
}

/* Scroll Indicators */
.scroll-fade-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(248, 249, 250, 0.8) 50%, 
        rgba(248, 249, 250, 1) 100%
    );
    pointer-events: none;
    border-radius: 0 0 12px 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.bestsellers-container.has-more-content ~ .scroll-fade-indicator {
    opacity: 1;
}

/* Responsive Design */

/* Tablet Styles */
@media (max-width: 1024px) {
    .bestsellers-container {
        padding: 12px;
    }
    .bestsellers-list {
        gap: 12px;
    }
    
    .bestseller-item {
        padding: 14px;
        min-height: 180px;
        display: flex !important; /* FIXED: Force display on tablet */
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .product-title {
        font-size: 13px;
    }
    
    .current-price {
        font-size: 16px;
    }
    
    .select-btn {
        font-size: 11px;
        padding: 8px 14px;
        min-height: 32px;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    .info-label {
        display: none;
    }
    
    .bestsellers-container {
        height: auto;
        padding: 0px;
    }
    
    .info-item {
        font-size: 14px;
    }
    
    .bestsellers-list {
        gap: 10px;
    }
    
    .bestseller-item {
        padding: 12px;
        min-height: 160px;
        display: flex !important; /* FIXED: Force display on mobile */
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .info-icon {
        width: 16px;
        height: 16px;
    }
    
    .package-label {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .current-price {
        font-size: 14px;
    }
    
    .select-btn {
        font-size: 10px;
        padding: 0px 12px;
        min-height: 28px;
    }
    
    .discount-badge {
        font-size: 8px;
        padding: 2px 5px;
    }
    
    .feature-badge {
        width: 24px;
        height: 24px;
        padding: 3px;
    }
    
    .feature-badge svg {
        width: 16px;
        height: 16px;
    }
}
@media (max-width: 320px) {
    .bestsellers-container {
    justify-items: center;
}
.bestsellers-list {
    grid-template-columns: repeat(1, 1fr)!important;
    width: 70%;
}
}
/* Very small mobile */
@media (max-width: 380px) {

    .bestsellers-list {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 6px;
    }
    
    .bestseller-item {
        min-height: 140px;
        display: flex !important; /* FIXED: Force display on small mobile */
        opacity: 1 !important;
        visibility: visible !important;
        padding: 10px !important;
    }
}

/* Accessibility */
.bestseller-item:focus {
    outline: 1px solid #4CAF50;
}

.select-btn:focus {
    outline: 1px solid #fff;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.3);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bestseller-item {
        border-width: 2px;
    }
    
    .package-label {
        border: 1px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bestseller-item,
    .select-btn {
        transition: none;
    }
}

/* FIXED: Ensure no items are hidden by any CSS rules */
.bestseller-item,
.bestseller-item.selected,
.bestseller-item.loading,
.bestseller-item:hover,
.bestseller-item:focus {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Exception: Only reduce opacity for loading state */
.bestseller-item.loading {
    opacity: 0.6 !important;
}