/* ============================================
   LuxeDrive Morocco — Custom Styles
   Supplements Tailwind CSS
   ============================================ */

/* ---- Smooth scroll ---- */
html { scroll-behavior: smooth; }

/* ---- RTL Support ---- */
.rtl-mode { direction: rtl; text-align: right; }
.rtl-mode .flex { flex-direction: row-reverse; }
.rtl-mode .space-x-2 > * + * { margin-left: 0; margin-right: 0.5rem; }
.rtl-mode .md\:flex-row { flex-direction: row-reverse; }
/* Exceptions: keep normal flow for specific elements */
.rtl-mode nav .flex,
.rtl-mode .no-rtl-flip { flex-direction: row; }
.rtl-mode .grid { direction: rtl; }

/* ---- Custom Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes bounceGentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-slide-in-right { animation: slideInRight 0.5s ease-out forwards; }
.animate-bounce-gentle { animation: bounceGentle 3s infinite ease-in-out; }

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > * { opacity: 0; animation-fill-mode: forwards; }

/* ---- Hero Section ---- */
.hero-gradient {
    background: linear-gradient(135deg, rgba(10,22,40,0.92) 0%, rgba(10,22,40,0.7) 50%, rgba(10,22,40,0.85) 100%);
}

/* ---- Card Styles ---- */
.car-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.car-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px -12px rgba(0,0,0,0.15);
}

/* ---- Gold Underline ---- */
.gold-underline {
    position: relative;
    display: inline-block;
}
.gold-underline::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #C8A45C;
    border-radius: 2px;
}

/* ---- Buttons ---- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #C8A45C;
    color: #0A1628;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary:hover {
    background: #D4B87A;
    box-shadow: 0 8px 25px -5px rgba(200,164,92,0.3);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid #C8A45C;
    color: #C8A45C;
    padding: 0.65rem 1.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-outline:hover {
    background: #C8A45C;
    color: #0A1628;
}

/* ---- Lazy Loading Placeholder ---- */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0ede6 25%, #e8e4db 50%, #f0ede6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
img[loading="lazy"].loaded {
    animation: none;
    background: none;
}

/* ---- Gallery Lightbox ---- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.5rem;
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #F8F6F0; }
::-webkit-scrollbar-thumb { background: #C8A45C; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #B08D3E; }

/* ---- Selection Color ---- */
::selection { background: rgba(200,164,92,0.3); color: #0A1628; }

/* ---- Focus States (Accessibility) ---- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #C8A45C;
    outline-offset: 2px;
}

/* ---- Alpine.js Cloak ---- */
[x-cloak] { display: none !important; }

/* ---- Print Styles ---- */
@media print {
    header, footer, .fixed, .sticky { display: none !important; }
    main { padding: 0 !important; }
    .car-card { break-inside: avoid; }
}

/* ---- Spec Grid ---- */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.spec-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #FAFAF8;
    border-radius: 0.75rem;
    border: 1px solid rgba(200,164,92,0.15);
}
.spec-item svg { color: #C8A45C; flex-shrink: 0; }
