/**
 * Interactive 3D Product Carousel (Layered Product Roulette)
 * Specially crafted for 6Valley Multi-Vendor Marketplace
 */

.c3d-container-wrapper {
    position: relative;
    width: 100%;
    margin: 15px 0 35px;
    padding: 10px 0 25px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* Header Separator */
.c3d-header-separator {
    position: relative;
    z-index: 10;
    width: 100%;
}

.c3d-header-separator .category-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 5px 0;
}

.c3d-header-separator .category-separator::before,
.c3d-header-separator .category-separator::after {
    content: "";
    flex: 1;
    border-bottom: 9px double #ffa500;
    margin: 0 5px;
}

.c3d-header-separator .category-separator span {
    background-color: #ffa500;
    color: #ffffff;
    padding: 6px 20px;
    border-radius: 50px;
    font-weight: bold;
    white-space: nowrap;
    min-width: 25%;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* 3D Stage */
.c3d-stage {
    position: relative;
    width: 100%;
    height: 490px;
    perspective: 1200px;
    -webkit-perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
}

/* Track holding all slides */
.c3d-track {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Individual Slide */
.c3d-slide {
    position: absolute;
    width: 290px;
    max-width: 85vw;
    height: auto;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 0.5s ease, 
                filter 0.5s ease;
    will-change: transform, opacity;
    cursor: pointer;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

/* Visible active state (Center) */
.c3d-slide.c3d-active {
    visibility: visible;
    opacity: 1;
    z-index: 50;
    pointer-events: auto;
    cursor: default;
}

/* Flanking positions */
.c3d-slide.c3d-pos-minus-1,
.c3d-slide.c3d-pos-plus-1,
.c3d-slide.c3d-pos-minus-2,
.c3d-slide.c3d-pos-plus-2 {
    visibility: visible;
    pointer-events: auto;
}

/* Card Styling matching reference mockup */
.c3d-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px;
    transition: box-shadow 0.4s ease;
}

.c3d-slide.c3d-active .c3d-card {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

/* Top bar: Wishlist + Discount badge */
.c3d-card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 5;
}

.c3d-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none !important;
}
.c3d-icon-btn:hover {
    color: #ef4444;
    transform: scale(1.08);
}
.c3d-icon-btn.active, .c3d-icon-btn.wishlist_icon_active {
    color: #ef4444;
}

.c3d-badge-discount {
    background: #ff4d4f;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(255, 77, 79, 0.35);
}

/* Product Image */
.c3d-card-img-wrap {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}
.c3d-card-img {
    max-width: 88%;
    max-height: 88%;
    object-fit: contain;
    transition: transform 0.4s ease;
}
.c3d-slide.c3d-active:hover .c3d-card-img {
    transform: scale(1.05);
}

/* Card Body */
.c3d-card-body {
    display: flex;
    flex-direction: column;
    text-align: left;
}
[dir="rtl"] .c3d-card-body {
    text-align: right;
}

.c3d-card-category {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.c3d-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.c3d-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}
.c3d-card-title a:hover {
    color: #4f46e5;
}

/* Rating */
.c3d-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.c3d-stars {
    display: flex;
    gap: 2px;
    font-size: 12px;
}
.c3d-stars .fa-star.active {
    color: #f59e0b;
}
.c3d-stars .fa-star.inactive {
    color: #e2e8f0;
}
.c3d-rating-text {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

/* Price */
.c3d-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.c3d-price-current {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}
.c3d-price-original {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
}
.c3d-price-off-pill {
    background: #ccfbf1;
    color: #0f766e;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Actions */
.c3d-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}
.c3d-btn-cart {
    flex: 1;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transition: all 0.25s ease;
    cursor: pointer;
}
.c3d-btn-cart:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

.c3d-btn-quickview {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.c3d-btn-quickview:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Nav Buttons (< and >) */
.c3d-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    font-size: 16px;
    z-index: 60;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}
.c3d-nav-btn:hover {
    background: #ffffff;
    color: #4f46e5;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}
.c3d-prev-btn {
    left: 20px;
}
.c3d-next-btn {
    right: 20px;
}

/* Dots Indicators */
.c3d-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    position: relative;
    z-index: 10;
}
.c3d-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.c3d-dot.active {
    width: 24px;
    border-radius: 12px;
    background: #4f46e5;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

/* Preview Modal Overrides */
.c3d-preview-mode {
    margin: 0 !important;
    padding: 10px 0 !important;
}
.c3d-preview-mode .c3d-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}
.c3d-preview-mode .c3d-nav-btn:hover {
    background: #ffffff;
    color: #1e293b;
}
.c3d-preview-mode .c3d-dot {
    background: rgba(255, 255, 255, 0.4);
}
.c3d-preview-mode .c3d-dot.active {
    background: #ffffff;
}

/* Reduced Motion preference */
@media (prefers-reduced-motion: reduce) {
    .c3d-slide {
        transition: none !important;
    }
}

/* Mobile & Tablet Responsive */
@media (max-width: 768px) {
    .c3d-stage {
        height: 460px;
    }
    .c3d-slide {
        width: 260px;
    }
    .c3d-card-img-wrap {
        height: 170px;
    }
    .c3d-prev-btn {
        left: 5px;
        width: 38px;
        height: 38px;
        font-size: 13px;
    }
    .c3d-next-btn {
        right: 5px;
        width: 38px;
        height: 38px;
        font-size: 13px;
    }
}
