/* =========================================================
   ForexMotors – Car Colors (Premium Redesign)
   /assets/css/car-colors.css
   ========================================================= */

/* ── Widget Container ────────────────────────────────────── */
.fm-car-colors-section {
    font-family: inherit;
    margin: 0;
    padding: 0;
}

/* ── Section Heading ─────────────────────────────────────── */
.fm-section-heading {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #1a1a2e;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fm-section-heading::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #c0392b, #e74c3c);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Image Viewer ─────────────────────────────────────────── */
.fm-color-image-viewer {
    position: relative;
    width: 100%;
    max-height: 320px;
    overflow: hidden;
    border-radius: 10px;
    background: #f4f5f7;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-color-image-viewer img.fm-viewer-img {
    width: 100%;
    height: 100%;
    max-height: 320px;
    object-fit: contain;   /* show full car, no crop */
    display: block;
    border-radius: 10px;
    opacity: 1;
    transition: opacity 0.38s ease;
    position: relative;    /* not absolute, so height flows naturally */
}

.fm-color-image-viewer img.fm-viewer-img.fm-fading {
    opacity: 0;
}

/* Loading shimmer */
.fm-viewer-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        #f0f0f0 25%,
        #e8e8e8 50%,
        #f0f0f0 75%);
    background-size: 200% 100%;
    animation: fm-shimmer 1.4s infinite;
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.fm-viewer-shimmer.fm-loading {
    opacity: 1;
}

@keyframes fm-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Navigation arrows */
.fm-viewer-prev,
.fm-viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    font-size: 14px;
    color: #333;
    line-height: 1;
}

.fm-color-image-viewer:hover .fm-viewer-prev,
.fm-color-image-viewer:hover .fm-viewer-next {
    opacity: 1;
}

.fm-viewer-prev { left: 10px; }
.fm-viewer-next { right: 10px; }

.fm-viewer-prev:hover,
.fm-viewer-next:hover {
    background: rgba(255,255,255,1);
    box-shadow: 0 3px 14px rgba(0,0,0,0.2);
}

/* Image counter badge */
.fm-viewer-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* ── Color Name Badge ─────────────────────────────────────── */
.fm-active-color-name {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    min-height: 22px;
    letter-spacing: 0.01em;
}

.fm-active-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.12);
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ── Swatches Row ─────────────────────────────────────────── */
.fm-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}


/* Inner colour disc */
.fm-swatch::after {
    content: '';
    display: block;
    border-radius: 50%;
    background: var(--swatch-color, #ccc);
    border: 1.5px solid rgba(0,0,0,0.1);
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.4), inset 0 -1px 2px rgba(0,0,0,0.15);
    transition: border-color 0.2s;
}

/* ── Swatch sizes ─────────────────────────────────────────── */
/* The ::after disc fills the button minus the 3px border gap */
.fm-swatch::after {
    width:  calc(100% - 4px);
    height: calc(100% - 4px);
}


/* ── Thumbnail Strip ──────────────────────────────────────── */
.fm-color-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.fm-color-thumb-btn {
    width: 58px;
    height: 58px;
    border-radius: 7px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    background: #eee;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
    flex-shrink: 0;
}

.fm-color-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fm-color-thumb-btn.fm-thumb-active {
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.2);
}

.fm-color-thumb-btn:hover {
    border-color: #999;
    transform: translateY(-1px);
}

/* ── No Colors Message ────────────────────────────────────── */
.fm-no-colors {
    color: #999;
    font-size: 13px;
    font-style: italic;
}

/* ── Editor Placeholder ───────────────────────────────────── */
.fm-elementor-placeholder {
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #ccc;
    border-radius: 8px;
    color: #666;
    font-size: 13px;
    text-align: center;
}

/* ── Floating Bar (fallback) ──────────────────────────────── */
.fm-car-colors-section.fm-floating-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e5e5e5;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.fm-car-colors-section.fm-floating-bar .fm-section-heading {
    font-size: 13px;
    margin: 0;
    border: none;
    padding: 0;
}

.fm-car-colors-section.fm-floating-bar .fm-active-color-name,
.fm-car-colors-section.fm-floating-bar .fm-color-thumbs,
.fm-car-colors-section.fm-floating-bar .fm-color-image-viewer {
    display: none;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .fm-swatch.fm-swatch-large {
        width: 40px;
        height: 40px;
    }
    .fm-swatch.fm-swatch-large::after {
        width: 34px;
        height: 34px;
    }
    .fm-color-thumb-btn {
        width: 48px;
        height: 48px;
    }
}
