/* ═══════════════════════════════════════════════════════════════
   Boomkay Motors — Custom Styles
   Complementary to Tailwind CSS
   ═══════════════════════════════════════════════════════════════ */

/* ─── Base Resets ──────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* ─── Scrollbar (Desktop) ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1A1A1A; }
::-webkit-scrollbar-thumb { background: #FF4500; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #FF6633; }

/* ─── Selection ───────────────────────────────────────────── */
::selection { background: rgba(255, 69, 0, 0.2); color: #FF4500; }

/* ─── Safe Area (for notched phones) ─────────────────────── */
.safe-area-pb { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ─── Condition Badges ────────────────────────────────────── */
.badge-mint      { background: linear-gradient(135deg, #10B981, #059669); color: #fff; }
.badge-excellent { background: linear-gradient(135deg, #3B82F6, #2563EB); color: #fff; }
.badge-good      { background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff; }
.badge-fair      { background: linear-gradient(135deg, #EF4444, #DC2626); color: #fff; }
.badge-default   { background: #6B7280; color: #fff; }

[class*="badge-"] {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ─── Card System ─────────────────────────────────────────── */
.car-card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.car-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08), 0 0 0 1px rgba(255,69,0,0.08);
}

.car-card .card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.car-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.car-card:hover .card-image img {
    transform: scale(1.06);
}

/* ─── Glassmorphism Panels ────────────────────────────────── */
.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ─── Hero Section ────────────────────────────────────────── */
.hero-gradient {
    background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 50%, #1A1A1A 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,69,0,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.hero-gradient::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, #F5F5F5, transparent);
    pointer-events: none;
}

/* ─── Feature Icons ───────────────────────────────────────── */
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,69,0,0.1), rgba(255,69,0,0.05));
    color: #FF4500;
    transition: all 0.3s ease;
}

.feature-icon:hover {
    background: linear-gradient(135deg, #FF4500, #CC3700);
    color: #fff;
    transform: scale(1.1) rotate(5deg);
}

/* ─── Filter Chips ────────────────────────────────────────── */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #E8E8E8;
    background: #fff;
    color: #2D2D2D;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-chip:hover, .filter-chip.active {
    background: #FF4500;
    color: #fff;
    border-color: #FF4500;
    box-shadow: 0 4px 12px rgba(255,69,0,0.25);
}

/* ─── Spec Pills ──────────────────────────────────────────── */
.spec-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    background: #F5F5F5;
    color: #6B7280;
}

/* ─── Section Reveal Animation ────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Staggered children animations ──────────────────────── */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Gallery Lightbox ────────────────────────────────────── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ─── Pulse Dot (for "Live" indicators) ──────────────────── */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    position: relative;
}

.pulse-dot::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.4);
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ─── Number Counter ──────────────────────────────────────── */
.counter {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* ─── Marquee Animation (Trust Ticker) ────────────────────── */
@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-33.333%); }
}

.animate-marquee {
    animation: marquee 20s linear infinite;
}

/* ─── Float Animation ─────────────────────────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* ─── Slide Up Animation ──────────────────────────────────── */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out both;
}

/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADING SYSTEM — "BoomSkeleton"
   Premium car-themed loading states
   ═══════════════════════════════════════════════════════════════ */

/* ─── Shimmer Base Animation ─────────────────────────────── */
@keyframes boomShimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

@keyframes boomShimmerWide {
    0%   { background-position: -800px 0; }
    100% { background-position: 800px 0; }
}

.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        #E8E8E8 0%,
        #F5F5F5 25%,
        #EFEFEF 35%,
        #F5F5F5 45%,
        #E8E8E8 100%
    );
    background-size: 800px 100%;
    animation: boomShimmer 1.8s ease-in-out infinite;
    border-radius: 8px;
}

/* ─── Skeleton Car Card ──────────────────────────────────── */
.skeleton-card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.skeleton-card .skeleton-image {
    aspect-ratio: 16 / 10;
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        #E0E0E0 0%,
        #EBEBEB 20%,
        #F0F0F0 40%,
        #EBEBEB 60%,
        #E0E0E0 100%
    );
    background-size: 800px 100%;
    animation: boomShimmerWide 2s ease-in-out infinite;
}

/* Car silhouette hint inside the skeleton image */
.skeleton-card .skeleton-image::after {
    content: '';
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 55%;
    height: 24%;
    background: rgba(0,0,0,0.03);
    border-radius: 40% 40% 4px 4px;
}

.skeleton-card .skeleton-image::before {
    content: '';
    position: absolute;
    bottom: 16%;
    left: 50%;
    transform: translateX(-50%);
    width: 65%;
    height: 8%;
    background: rgba(0,0,0,0.025);
    border-radius: 0 0 6px 6px;
}

/* Badge skeleton */
.skeleton-card .skeleton-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 56px;
    height: 20px;
    border-radius: 9999px;
    z-index: 2;
}

/* Photo count skeleton */
.skeleton-card .skeleton-photo-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 42px;
    height: 22px;
    border-radius: 8px;
    z-index: 2;
}

.skeleton-card .skeleton-body {
    padding: 1rem;
}

.skeleton-card .skeleton-title {
    height: 16px;
    width: 75%;
    margin-bottom: 10px;
}

.skeleton-card .skeleton-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.skeleton-card .skeleton-pill {
    height: 24px;
    width: 64px;
    border-radius: 8px;
}

.skeleton-card .skeleton-pill:nth-child(2) { width: 76px; }
.skeleton-card .skeleton-pill:nth-child(3) { width: 52px; }

.skeleton-card .skeleton-divider {
    height: 1px;
    background: #F0F0F0;
    margin-bottom: 12px;
}

.skeleton-card .skeleton-price {
    height: 22px;
    width: 45%;
    border-radius: 6px;
}

/* ─── Skeleton Pulse Variants (for dark backgrounds) ─────── */
.skeleton-shimmer-dark {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.03) 0%,
        rgba(255,255,255,0.06) 25%,
        rgba(255,255,255,0.08) 35%,
        rgba(255,255,255,0.06) 45%,
        rgba(255,255,255,0.03) 100%
    );
    background-size: 800px 100%;
    animation: boomShimmer 1.8s ease-in-out infinite;
    border-radius: 8px;
}

/* ─── Car Card Entrance Animation ────────────────────────── */
@keyframes cardEnter {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.car-card-enter {
    animation: cardEnter 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Stagger dynamically loaded cards */
.car-card-enter:nth-child(3n+1) { animation-delay: 0s; }
.car-card-enter:nth-child(3n+2) { animation-delay: 0.06s; }
.car-card-enter:nth-child(3n+3) { animation-delay: 0.12s; }

/* ─── Show More Button System ────────────────────────────── */
.show-more-section {
    text-align: center;
    padding: 2rem 0 1rem;
}

.show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, #FF4500, #FF6633);
    color: #fff;
    border: none;
    border-radius: 0.875rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.show-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 69, 0, 0.35);
}

.show-more-btn:active {
    transform: translateY(0);
}

.show-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(255, 69, 0, 0.15);
}

/* Loading spinner inside the button */
.show-more-btn .btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.show-more-btn.is-loading .btn-spinner { display: block; }
.show-more-btn.is-loading .btn-text { display: none; }
.show-more-btn.is-loading .btn-icon { display: none; }

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

/* Progress indicator */
.inventory-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.progress-bar-container {
    width: 200px;
    height: 4px;
    background: #E8E8E8;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF4500, #FF6633);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    font-size: 0.75rem;
    color: #9CA3AF;
    font-weight: 500;
    white-space: nowrap;
}

/* ─── Animated Car Buffer Loader (Page-Level) ────────────── */
@keyframes carDrive {
    0%   { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

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

.car-buffer-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0;
}

.car-buffer-loader .car-track {
    width: 200px;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.car-buffer-loader .car-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 30px;
    animation: carDrive 1.5s ease-in-out infinite;
}

.car-buffer-loader .car-icon svg {
    width: 100%;
    height: 100%;
    fill: #FF4500;
}

.car-buffer-loader .track-line {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #E8E8E8 20%, #E8E8E8 80%, transparent);
    border-radius: 1px;
}

.car-buffer-loader .loader-text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #9CA3AF;
    letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE-WIDE CAR LOADING OVERLAY — "BoomLoader"
   Themed loading screen for initial page loads & transitions
   ═══════════════════════════════════════════════════════════════ */

@keyframes boomCarBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

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

@keyframes boomRoadDash {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes boomLoaderFade {
    0%   { opacity: 1; }
    100% { opacity: 0; pointer-events: none; }
}

#boomLoader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #1A1A1A;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    transition: opacity 0.4s ease;
}

#boomLoader.fade-out {
    animation: boomLoaderFade 0.5s ease forwards;
}

#boomLoader .loader-car {
    width: 80px;
    height: 48px;
    position: relative;
    animation: boomCarBounce 0.8s ease-in-out infinite;
}

#boomLoader .loader-car svg {
    width: 100%;
    height: 100%;
}

#boomLoader .loader-road {
    width: 200px;
    height: 3px;
    border-radius: 2px;
    background: #2D2D2D;
    overflow: hidden;
    position: relative;
}

#boomLoader .loader-road::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        #FF4500 0px,
        #FF4500 12px,
        transparent 12px,
        transparent 24px
    );
    animation: boomRoadDash 0.6s linear infinite;
}

#boomLoader .loader-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* ─── Responsive Tweaks ───────────────────────────────────── */
@media (max-width: 768px) {
    .hero-gradient::after { height: 80px; }
    .progress-bar-container { width: 120px; }
}

/* ─── Print Styles ────────────────────────────────────────── */
@media print {
    header, footer, #mobile-nav, #whatsapp-fab, #boomLoader { display: none !important; }
    main { padding: 0 !important; }
}
