/* Best Sellers & Latest Products Grid Layout */
.best-seller-section,
.latest-products-section {
    margin: 40px 0;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #f9f9f9;
    padding-bottom: 15px;
}
.section-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    position: relative;
}
.section-header h3::after {
    content: "";
    position: absolute;
    bottom: -17px;
    right: 0; /* RTL */
    width: 60px;
    height: 2px;
    background: #1e5631;
}
.section-header a {
    font-size: 14px;
    color: #7f8c8d;
    text-decoration: none;
    transition: 0.3s;
}
.section-header a:hover {
    color: #1e5631;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.v-card {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 15px;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}
.v-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
    border-color: #e0e0e0;
}
.v-card-img-link {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f9f9f9;
}
.v-card-img-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: 0.5s;
}
.v-card:hover .v-card-img-link img {
    transform: scale(1.08);
}

.v-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.v-card-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: 0.3s;
}
.v-card-title:hover {
    color: #8e44ad;
}

.v-card-author {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.v-card-price-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.v-current-price {
    font-size: 18px;
    font-weight: 800;
    color: #2c3e50;
}
.v-old-price {
    font-size: 13px;
    text-decoration: line-through;
    color: #bdc3c7;
}
.v-discount-badge {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Header Badge Count */
.elegant-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #c5a059;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.3);
}

/* Quantity Control Style */
.qty-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 2px solid #1e5631;
    border-radius: 20px;
    padding: 0 5px;
    height: 40px;
    min-width: 100px;
    box-shadow: 0 4px 6px rgba(30, 86, 49, 0.2);
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #1e5631;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.qty-btn:hover {
    background: #fdf5ff;
}

.qty-btn:active {
    background: #e8f5e9;
    transform: scale(0.9);
}

.qty-display {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    width: 30px;
    text-align: center;
    user-select: none;
}

/* Subcategories Horizontal Scroll */
.subcat-grid {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 5px;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    scrollbar-width: none;
}
.subcat-grid:active {
    cursor: grabbing;
}
.subcat-grid::-webkit-scrollbar {
    display: none;
}

.vibe-subcat-card {
    flex: 0 0 auto;
    width: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px 15px;
    transition: all 0.3s ease;
    text-decoration: none;
}
.vibe-subcat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: #1e5631;
}
.vibe-subcat-img-wrapper {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    border-radius: 50%;
    overflow: hidden;
    background: #f9f9f9;
    padding: 10px;
    transition: 0.3s;
}
.vibe-subcat-card:hover .vibe-subcat-img-wrapper {
    background: #fdf5ff;
}
.vibe-subcat-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.vibe-subcat-title {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 5px;
    transition: 0.3s;
}
.vibe-subcat-card:hover .vibe-subcat-title {
    color: #1e5631;
}
.vibe-subcat-count {
    font-size: 12px;
    color: #95a5a6;
    background: #f4f6f8;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Premium Hover Overlay Effect */
.v-card {
    position: relative;
    overflow: hidden;
}

.v-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0) 70%
    ); /* Subtle bottom-weighted gradient */
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 2;
    pointer-events: none;
}

.v-card-actions {
    position: absolute !important;
    bottom: 10px !important; /* Positioned at the bottom */
    right: 10px !important; /* Positioned at the right */
    transform: translateY(20px);
    opacity: 0;
    z-index: 3;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    gap: 5px;
    width: auto;
    margin: 0;
    pointer-events: none;
    background: transparent;
    padding: 0;
    border: none;
}

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

.v-card:hover .v-card-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.v-add-btn,
.v-wishlist-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px; /* Slightly squared for a modern look */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #2c3e50;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.v-add-btn:hover {
    background: #1e5631; /* Deep Green */
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(30, 86, 49, 0.4);
}

.v-wishlist-btn:hover {
    background: #c5a059; /* Gold */
    color: #fff;
    backdrop-filter: blur(5px);
    border: 1px solid #1e5631;
    border-radius: 10px;
    height: 36px;
    box-shadow: 0 4px 12px rgba(30, 86, 49, 0.15);
    z-index: 20; 
    position: relative;
}

.v-wishlist-btn.active {
    background: #e74c3c !important;
    color: #fff !important;
    border-color: #e74c3c !important;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: #f3f4f6;
    color: #1e5631;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
}

.qty-btn:hover {
    background: #1e5631;
    color: #fff;
}

.qty-display {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
    text-align: center;
}

@media (max-width: 768px) {
    /* DEFAULT GRID VIEW (2 Columns) */
    .products-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .v-card {
        flex-direction: column; /* Vertical Stack */
        align-items: stretch;
        text-align: center;
        padding: 10px;
        height: 100%;
    }

    .v-card-img-link {
        width: 100%;
        height: 160px; /* Fixed height for consistency */
        margin-bottom: 10px;
    }

    .v-card-content {
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .v-card-price-box {
        justify-content: center;
    }

    .v-card-actions {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        justify-content: center;
        margin-top: 10px;
        width: 100%;
    }
    
    .v-card::before {
        display: none;
    }

    /* HORIZONTAL VIEW (List View - 1 Column) */
    .products-horizontal {
        grid-template-columns: 1fr !important;
    }

    .products-horizontal .v-card {
        flex-direction: row;
        text-align: right;
        align-items: center;
    }

    .products-horizontal .v-card-img-link {
        width: 110px;
        height: 110px;
        margin-bottom: 0;
    }

    .products-horizontal .v-card-content {
        text-align: right;
        display: block;
    }

    .products-horizontal .v-card-price-box {
        justify-content: flex-start;
    }

    .products-horizontal .v-card-actions {
        justify-content: flex-start; /* Or keep center if preferred, but usually start for RTL list */
        margin-top: 5px;
    }
}

/* Status Indicators Style */
.v-status-indicators {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 4;
    transition: opacity 0.3s ease;
}

.v-status-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cart-dot {
    background: #1e5631; /* Green */
}

.wish-dot {
    background: #c5a059; /* Gold */
}

/* Optional: hide indicators on hover if it feels too busy, 
   but user might want them to stay. Let's keep them with slight fade. */
.v-card:hover .v-status-indicators {
    opacity: 0.5;
}
