/* ===================================================
   Car 360° Viewer — Frontend Styles
   =================================================== */

.car360-viewer {
    --c360-radius: 16px;
    --c360-bg: #0c0c0f;
    --c360-surface: rgba(255,255,255,0.06);
    --c360-accent: #3b82f6;
    --c360-text: #ffffff;
    --c360-text-muted: #9ca3af;

    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Loader ---------- */
.car360-loader {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--c360-bg);
    border-radius: var(--c360-radius);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.car360-loader.car360-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.car360-loader-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: c360spin 0.7s linear infinite;
    margin-bottom: 14px;
}

@keyframes c360spin {
    to { transform: rotate(360deg); }
}

.car360-loader-text {
    font-size: 13px;
    color: var(--c360-text-muted);
}

.car360-loader-pct {
    color: var(--c360-text);
    font-weight: 600;
}

/* ---------- Stage ---------- */
.car360-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: radial-gradient(ellipse at 50% 100%, #1a1a2e 0%, var(--c360-bg) 70%);
    border-radius: var(--c360-radius);
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.car360-stage.is-dragging {
    cursor: grabbing;
    touch-action: none;
}

/* ---------- Canvas ---------- */
.car360-canvas {
    position: absolute;
    inset: 0;
}

.car360-canvas img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
    transition: opacity 0.06s ease;
}

.car360-canvas img.car360-active {
    opacity: 1;
}

/* ---------- Hint ---------- */
.car360-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 100px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.car360-hint.is-visible {
    opacity: 1;
    animation: c360pulse 2.5s ease-in-out infinite;
}

.car360-hint svg {
    animation: c360arrow 1.4s ease-in-out infinite;
}

@keyframes c360pulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 0.4; }
}

@keyframes c360arrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* ---------- Controls ---------- */
.car360-controls {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
}

.car360-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.65);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.car360-ctrl-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.car360-ctrl-btn.is-active {
    background: rgba(59,130,246,0.2);
    color: var(--c360-accent);
}

.car360-frame-num {
    font-size: 11px;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: rgba(255,255,255,0.35);
    padding: 0 10px;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* ---------- Progress ---------- */
.car360-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.04);
    z-index: 5;
}

.car360-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--c360-accent), #60a5fa);
    border-radius: 0 2px 2px 0;
    transition: width 0.12s ease;
    width: 0%;
}

/* ---------- Color Picker ---------- */
.car360-color-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding: 14px 20px;
    background: var(--c360-surface);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.05);
}

.car360-color-label {
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--c360-text-muted);
	font-family: 'h_regular';
	color: #000000;
}

.car360-color-name {
    font-size: 15px;
    font-weight: 600;
    color: #000000;
    padding: 3px 14px;
    background: rgba(255,255,255,0.06);
    border-radius: 100px;
    min-width: 80px;
    text-align: center;
    transition: all 0.3s;
	font-family: 'h_regular'; 
}

.car360-swatches {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.car360-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    background-color: var(--swatch-color);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.car360-swatch:hover {
    transform: scale(1.15);
    border-color: rgba(255,255,255,0.4);
	border: 1px solid black;
}

.car360-swatch--active {
    border-color: #fff;
    transform: scale(1.2);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12), 0 0 12px 2px rgba(255,255,255,0.15);
}

/* ===== Responsive ===== */

/* Small phones */
@media (max-width: 480px) {
    .car360-viewer {
        --c360-radius: 10px;
    }

    .car360-stage {
        aspect-ratio: 4 / 3;
    }

    .car360-canvas img {
        padding: 6px;
    }

    .car360-hint {
        padding: 8px 14px;
        font-size: 11px;
        gap: 6px;
    }

    .car360-hint svg {
        width: 18px;
        height: 18px;
    }

    .car360-controls {
        bottom: 8px;
        padding: 3px;
        gap: 1px;
        border-radius: 10px;
    }

    .car360-ctrl-btn {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .car360-ctrl-btn svg {
        width: 14px;
        height: 14px;
    }

    .car360-frame-num {
        font-size: 9px;
        padding: 0 6px;
    }

    .car360-color-picker {
        gap: 8px;
        padding: 10px 12px;
        border-radius: 10px;
        margin-top: 12px;
    }

    .car360-color-label {
        font-size: 9px;
    }

    .car360-color-name {
        font-size: 11px;
        padding: 2px 10px;
    }

    .car360-swatch {
        width: 30px;
        height: 30px;
    }

    .car360-swatches {
        gap: 6px;
    }
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .car360-stage {
        aspect-ratio: 16 / 10;
    }

    .car360-canvas img {
        padding: 10px;
    }
}

/* Large screens */
@media (min-width: 1024px) {
    .car360-viewer {
        --c360-radius: 20px;
    }

    .car360-canvas img {
        padding: 20px;
    }

    .car360-controls {
        bottom: 20px;
        padding: 6px;
        gap: 4px;
        border-radius: 16px;
		        display: none;
    }

    .car360-ctrl-btn {
        width: 42px;
        height: 42px;
    }

    .car360-color-picker {
        margin-top: 24px;
        padding: 16px 28px;
    }

    .car360-swatch {
        width: 42px;
        height: 42px;
		border: 1px solid black; 
    }

    .car360-swatches {
        gap: 10px;
    }
}
