/* ============================================
   Card Carousel Widget
   ============================================ */

.bai_cc_section {
    --bai-cc-items: 4.2;
    --bai-cc-gap: 16px;
    --bai-cc-bg: #f8f9fa;
    --bai-cc-primary: #0b66c2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.bai_cc_container {
    position: relative;
}

/* Track */
.bai_cc_track {
    display: flex;
    gap: var(--bai-cc-gap);
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding: 10px 0;
    cursor: grab;
}

.bai_cc_track::-webkit-scrollbar {
    display: none;
}

.bai_cc_track.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.bai_cc_track.dragging .bai_cc_item {
    pointer-events: none;
}

/* Card item */
.bai_cc_item {
    flex: 0 0 calc((100% - (var(--bai-cc-gap) * (var(--bai-cc-items) - 1))) / var(--bai-cc-items));
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    box-sizing: border-box;
}

/* Blue text card */
.bai_cc_blue-box {
    background-color: var(--bai-cc-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    text-decoration: none;
}

.bai_cc_blue-box h2 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 0;
    font-weight: 600;
}

/* Image card */
.bai_cc_img-box {
    position: relative;
    text-decoration: none;
}

.bai_cc_img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
}

.bai_cc_img-box h3 {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    margin: 0;
    color: #fff;
    z-index: 2;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    padding: 0 10px;
}

/* Fade layers */
.bai_cc_fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.bai_cc_fade--left {
    left: -1px;
    background: linear-gradient(to right, var(--bai-cc-bg) 15%, transparent);
    opacity: 0;
}

.bai_cc_fade--right {
    right: -1px;
    background: linear-gradient(to left, var(--bai-cc-bg) 15%, transparent);
}

/* Nav buttons */
.bai_cc_btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bai-cc-primary);
    color: #fff;
    border: 3px solid var(--bai-cc-bg);
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
    padding: 0;
}

.bai_cc_btn:hover {
    filter: brightness(0.85);
    transform: translateY(-50%) scale(1.05);
}

.bai_cc_btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bai_cc_btn--left {
    left: -22px;
}

.bai_cc_btn--right {
    right: -22px;
}

.bai_cc_btn.show {
    opacity: 1;
    pointer-events: auto;
}

/* Progress bar */
.bai_cc_progress-track {
    margin-top: 35px;
    width: 100%;
    height: 3px;
    background-color: #e5e7eb;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
}

.bai_cc_progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--bai-cc-primary);
    border-radius: 2px;
    transition: left 0.1s linear;
}

/* Responsive defaults */
@media (max-width: 1024px) {
    .bai_cc_section { --bai-cc-items: 3; }
}

@media (max-width: 768px) {
    .bai_cc_section { --bai-cc-items: 2; }
    .bai_cc_blue-box h2 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .bai_cc_section { --bai-cc-items: 1.2; }
    .bai_cc_btn { display: none; }
}
