/* ===== KILIMALL-STYLE PRODUCT CARDS & CAROUSEL ===== */

/* Category Header Row - Fixed overlapping */
.logos-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0 15px 0;
    padding: 0 8px;
    position: relative;
    border-bottom: 2px solid #ff6b00;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.logos-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    text-transform: capitalize;
    padding-bottom: 6px;
    flex: 1;
    min-width: 150px;
    line-height: 1.2;
}

.logos-pointer {
    display: none;
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
    background: rgba(255, 107, 0, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
}

.logos-pointer-right {
    text-align: right;
}

/* Main Wrapper */
.logos-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 auto;
    max-width: 100%;
    padding: 0 40px;
}

/* Scroll Container */
.logos-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px 4px 15px 4px;
    scroll-snap-type: x mandatory;
    cursor: grab;
}

.logos-scroll::-webkit-scrollbar {
    display: none;
}

.logos-scroll:active {
    cursor: grabbing;
}

/* Product Card - Kilimall Style */
.product-card {
    flex: 0 0 auto;
    width: 160px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    scroll-snap-align: start;
    position: relative;
    border: 1px solid #e8e8e8;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Product Badges */
.product-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 2;
    text-transform: uppercase;
    line-height: 1;
}

.free-badge {
    background: #28a745;
    color: white;
}

.premium-badge {
    background: #ffc107;
    color: #333;
}

/* Image Wrapper - Original image size */
.image-wrapper {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.logos-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .logos-img {
    transform: scale(1.03);
}

/* Product Info Section - Reduced by half */
.product-info {
    padding: 6px 8px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.product-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
    margin: 0 0 4px 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 1.8em;
}

/* Ratings Section - Compact */
.product-ratings {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    gap: 2px;
    flex-wrap: wrap;
}

.stars {
    display: flex;
    gap: 1px;
    flex-shrink: 0;
}

.star {
    font-size: 0.7rem;
    color: #ddd;
    line-height: 1;
}

.star.full {
    color: #ffc107;
}

.star.half {
    background: linear-gradient(90deg, #ffc107 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rating-value {
    font-size: 0.65rem;
    font-weight: 600;
    color: #333;
    margin-left: 1px;
    flex-shrink: 0;
}

.reviews {
    font-size: 0.6rem;
    color: #666;
    flex-shrink: 0;
}

/* Price Section - Compact */
.product-price {
    margin-top: 2px;
}

.current-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ff6b00;
    line-height: 1.1;
}

.member-price {
    font-size: 0.7rem;
    font-weight: 600;
    color: #28a745;
    background: #f8f9fa;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
    line-height: 1.1;
    display: inline-block;
}

/* Navigation Arrows - ALWAYS VISIBLE */
.logos-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex !important; /* Force display on all screens */
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible !important;
}

.logos-arrow:hover {
    background: #ff6b00;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.logos-arrow.left {
    left: 5px;
}

.logos-arrow.right {
    right: 5px;
}

.logos-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.logos-arrow:disabled:hover {
    background: white;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%);
}

/* Error and No Content States */
.error, .no-categories {
    text-align: center;
    padding: 30px 15px;
    color: #666;
    font-size: 1rem;
}

.error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 15px;
}

/* ===== SWIPE ANIMATIONS ===== */

/* Pulse animation for swipe indicators */
@keyframes swipeBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(-5px);
    }
    60% {
        transform: translateX(-3px);
    }
}

@keyframes swipeBounceRight {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(5px);
    }
    60% {
        transform: translateX(3px);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 768px) {
    .logos-wrapper {
        padding: 0 35px;
    }
    
    .logos-label-row {
        margin: 20px 0 12px 0;
        padding: 0 6px;
        min-height: 35px;
    }
    
    .logos-title {
        font-size: 1.2rem;
        padding-bottom: 4px;
    }
    
    .logos-pointer {
        display: block;
        font-size: 0.75rem;
        animation: swipeBounce 2s infinite;
    }
    
    .logos-pointer-right {
        animation: swipeBounceRight 2s infinite;
    }
    
    .product-card {
        width: 145px;
        min-height: 200px;
    }
    
    .image-wrapper {
        height: 100px;
    }
    
    .product-info {
        padding: 5px 6px;
        min-height: 70px;
    }
    
    .product-name {
        font-size: 0.75rem;
        min-height: 1.6em;
        margin-bottom: 3px;
    }
    
    /* Keep arrows visible but adjust size */
    .logos-arrow {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .logos-arrow.left {
        left: 3px;
    }
    
    .logos-arrow.right {
        right: 3px;
    }
    
    .product-ratings {
        margin-bottom: 3px;
    }
    
    .current-price {
        font-size: 0.8rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .logos-wrapper {
        padding: 0 32px;
    }
    
    .logos-label-row {
        margin: 15px 0 10px 0;
        padding: 0 4px;
        min-height: 30px;
    }
    
    .logos-title {
        font-size: 1.1rem;
        min-width: 120px;
    }
    
    .logos-scroll {
        gap: 10px;
        padding: 6px 3px 12px 3px;
    }
    
    .product-card {
        width: 135px;
        min-height: 180px;
        border-radius: 6px;
    }
    
    .image-wrapper {
        height: 90px;
        padding: 4px;
    }
    
    .product-info {
        padding: 4px 5px;
        min-height: 60px;
    }
    
    .product-name {
        font-size: 0.72rem;
        min-height: 1.4em;
        margin-bottom: 2px;
    }
    
    /* Adjust arrows for mobile */
    .logos-arrow {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .logos-arrow.left {
        left: 2px;
    }
    
    .logos-arrow.right {
        right: 2px;
    }
    
    .stars {
        gap: 0;
    }
    
    .star {
        font-size: 0.65rem;
    }
    
    .rating-value {
        font-size: 0.6rem;
    }
    
    .reviews {
        font-size: 0.55rem;
    }
    
    .current-price {
        font-size: 0.75rem;
    }
    
    .member-price {
        font-size: 0.65rem;
        padding: 1px 3px;
    }
    
    .product-badge {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .logos-wrapper {
        padding: 0 30px;
    }
    
    .logos-label-row {
        margin: 12px 0 8px 0;
        min-height: 28px;
    }
    
    .logos-title {
        font-size: 1rem;
    }
    
    .product-card {
        width: 125px;
        min-height: 170px;
    }
    
    .image-wrapper {
        height: 80px;
        padding: 3px;
    }
    
    .product-info {
        padding: 3px 4px;
        min-height: 55px;
    }
    
    .product-name {
        font-size: 0.7rem;
        min-height: 1.3em;
    }
    
    /* Smaller arrows for very small screens */
    .logos-arrow {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .logos-arrow.left {
        left: 1px;
    }
    
    .logos-arrow.right {
        right: 1px;
    }
    
    .product-ratings {
        flex-wrap: nowrap;
        gap: 1px;
    }
    
    .stars {
        flex-shrink: 1;
    }
    
    .rating-value,
    .reviews {
        flex-shrink: 1;
        white-space: nowrap;
    }
    
    .current-price {
        font-size: 0.72rem;
    }
}

/* Very Small Screens (iPhone SE etc) */
@media (max-width: 320px) {
    .logos-wrapper {
        padding: 0 28px;
    }
    
    .product-card {
        width: 118px;
        min-height: 160px;
    }
    
    .image-wrapper {
        height: 75px;
    }
    
    .product-info {
        min-height: 50px;
    }
    
    .product-name {
        font-size: 0.68rem;
    }
    
    .logos-arrow {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    .logos-arrow:hover {
        transform: translateY(-50%);
        background: white;
        color: #333;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    
    .logos-arrow:active {
        background: #ff6b00;
        color: white;
        transform: translateY(-50%) scale(0.95);
    }
}

/* Desktop - Show both arrows and swipe capability */
@media (min-width: 769px) {
    .logos-pointer {
        display: none; /* Hide swipe text on desktop */
    }
    
    .logos-scroll {
        cursor: grab; /* Still allow drag on desktop */
    }
    
    .logos-scroll:hover {
        cursor: grab;
    }
    
    .logos-scroll:active {
        cursor: grabbing;
    }
}

/* Loading Optimization */
.logos-img {
    background: #f8f9fa;
    transform: translateZ(0);
}

/* Smooth animations */
.product-card {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure no horizontal overflow */
body {
    overflow-x: hidden;
}

/* Fix for very small screens */
@media (max-width: 280px) {
    .logos-wrapper {
        padding: 0 26px;
    }
    
    .product-card {
        width: 110px;
        min-height: 150px;
    }
    
    .image-wrapper {
        height: 70px;
    }
    
    .product-name {
        font-size: 0.65rem;
    }
    
    .logos-arrow {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

/* Prevent overlapping with other sections */
.category-section {
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.logos-label-row {
    z-index: 2;
    position: relative;
}

.logos-wrapper {
    z-index: 1;
    position: relative;
}

/* Scroll snap improvement */
.logos-scroll {
    scroll-snap-type: x mandatory;
    scroll-padding: 0 20px;
}

.product-card {
    scroll-snap-align: start;
}

/* Performance optimizations */
.logos-scroll {
    will-change: transform;
    backface-visibility: hidden;
}

.product-card {
    contain: layout style paint;
}

/* Ensure arrows are always clickable */
.logos-arrow {
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}