/* =============================================
   CSS Custom Styles — มานะรถบ้าน (manarodbaan)
   Tailwind config อยู่ใน index.html (inline script)
   ============================================= */

/* Base Body */
body { font-family: 'Prompt', sans-serif; background-color: #F8FAFC; color: #1E293B; }

/* ซ่อน Scrollbar เฉพาะมือถือ/แท็บเล็ต (< 1024px) ส่วน Desktop แสดง */
@media (max-width: 1023px) {
  .hide-scroll::-webkit-scrollbar { display: none; }
  .hide-scroll { -ms-overflow-style: none; scrollbar-width: none; }
}

/* Custom Checkbox — Modern Square */
.custom-checkbox { width: 16px; height: 16px; border-radius: 4px; border: 1px solid #CBD5E1; appearance: none; outline: none; cursor: pointer; position: relative; }
.custom-checkbox:checked { background-color: #FF6B00; border-color: #FF6B00; }
.custom-checkbox:checked::after { content: '✓'; position: absolute; color: white; font-size: 12px; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: 700; }

/* Filter Brand Checkbox */
.filter-brand-cb { width: 18px; height: 18px; border-radius: 5px; border: 2px solid #CBD5E1; background: #fff; appearance: none; outline: none; cursor: pointer; flex-shrink: 0; position: relative; transition: all 0.15s ease; }
.filter-brand-cb:hover { border-color: #FF6B00; }
.filter-brand-cb:checked { background: #FF6B00; border-color: #FF6B00; }
.filter-brand-cb:checked::after { content: '✓'; position: absolute; color: white; font-size: 13px; font-weight: 700; top: 50%; left: 50%; transform: translate(-50%, -50%); line-height: 1; }

/* =============================================
   SIDEBAR & FILTER STYLES
   ============================================= */

/* Sidebar scroll container — constrained height + scroll */
.sidebar-scroll {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sidebar-scroll::-webkit-scrollbar {
    display: none;
}

/* Filter content expand/collapse with smooth transition */
.filter-content {
    transition: max-height 0.35s ease-in-out, opacity 0.25s ease-in-out, padding 0.25s ease-in-out;
    overflow: hidden;
    box-sizing: border-box;
}

.filter-content.expanded {
    opacity: 1;
    padding-bottom: 8px;
}

.filter-content.collapsed {
    opacity: 0;
    padding-bottom: 0 !important;
}

/* Suppress transitions during initial height setup — no visible animation */
.filter-content.no-transition {
    transition: none !important;
}

/* Article content — since CDN Tailwind doesn't include @tailwindcss/typography (prose) */
.article-content h1 {
font-size: 28px;
font-weight: 700;
line-height: 1.3;
margin: 32px 0 16px;
color: #1e293b;
}
.article-content h2 {
font-size: 22px;
font-weight: 700;
line-height: 1.35;
margin: 28px 0 14px;
color: #1e293b;
}
.article-content h3 {
font-size: 18px;
font-weight: 600;
line-height: 1.4;
margin: 24px 0 12px;
color: #334155;
}
.article-content h4 {
font-size: 16px;
font-weight: 600;
margin: 20px 0 10px;
color: #334155;
}
.article-content p {
margin-bottom: 16px;
line-height: 1.75;
color: #475569;
}
.article-content ul, .article-content ol {
margin: 12px 0;
padding-left: 24px;
}
.article-content li {
margin-bottom: 8px;
line-height: 1.6;
}
.article-content img {
max-width: 100%;
height: auto;
border-radius: 8px;
margin: 24px auto;
display: block;
}
.article-content blockquote {
border-left: 4px solid #FF6B00;
padding: 12px 20px;
margin: 20px 0;
background: #fff7ed;
border-radius: 0 8px 8px 0;
font-style: italic;
color: #334155;
}
.article-content a {
color: #FF6B00;
text-decoration: underline;
}
.article-content a:hover {
color: #e65c00;
}
.article-content table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
.article-content th, .article-content td {
border: 1px solid #e2e8f0;
padding: 10px 14px;
text-align: left;
}
.article-content th {
background: #f8fafc;
font-weight: 600;
}
.article-content code {
background: #f1f5f9;
padding: 2px 6px;
border-radius: 4px;
font-size: 0.9em;
}
.article-content pre {
background: #1e293b;
color: #e2e8f0;
padding: 16px;
border-radius: 8px;
overflow-x: auto;
margin: 20px 0;
}
.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Quill alignment classes (Quill uses class-based not inline-style) */
.article-content .ql-align-center { text-align: center; }
.article-content .ql-align-right { text-align: right; }
.article-content .ql-align-justify { text-align: justify; }
.article-content .ql-align-left { text-align: left; }

/* Chevron icon rotation when expanded */
.chevron-icon {
    transition: transform 0.3s ease;
}

.chevron-icon.rotated {
    transform: rotate(180deg);
}

/* Filter pill buttons */
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 12px;
    border: 1.5px solid #E5E7EB;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: #FF6B00;
    color: #FF6B00;
    background: #FFF7ED;
}

.filter-pill.active {
    background: #FF6B00;
    border-color: #FF6B00;
    color: #fff;
}

/* Fix sticky elements inside the sidebar */
aside .sticky {
    z-index: 5;
}

aside .sticky.top-0 {
    z-index: 10;
}

/* Hero Background */
.hero-bg {
    background-color: #f5f5f5;
    aspect-ratio: 1983 / 1115;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.3) 40%, transparent 65%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 5;
    padding: 12px 28px 12px 28px;
    background: none;
    border-left: none;
    text-align: left;
    width: auto;
    display: inline-block;
    max-width: 100%;
}

.hero-content h1,
.hero-content p {
    text-shadow: 0 2px 12px rgba(0,0,0,0.85);
}

@media (max-width: 768px) {
    .hero-bg {
        aspect-ratio: auto;
        min-height: 350px;
    }
    .hero-content {
        padding: 10px 16px 10px 20px;
        background: linear-gradient(to right, rgba(0,0,0,0.55) 0%, transparent 100%);
    }
}

/* Mobile Menu Transition */
#mobile-menu { transition: transform 0.3s ease-in-out; }
.menu-open { transform: translateX(0) !important; }

/* Color Swatch Selected State — replaces Tailwind's non-existent `selected:` variant */
.filter-group .group.selected span:first-of-type {
    border-color: #FF6B00 !important;
    box-shadow: 0 0 0 3px white, 0 0 0 5px #FF6B00 !important;
}
.filter-group .group.selected span:first-of-type {
    transform: scale(1.1);
}

/* =============================================
   SOCIAL ICON STYLES — Floating, Footer, Contact Cards
   ============================================= */

/* Fade-in animation */
@keyframes social-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: social-fade-in 0.5s ease-out both; }
.animate-fade-in > a:nth-child(1) { animation-delay: 0.1s; }
.animate-fade-in > a:nth-child(2) { animation-delay: 0.25s; }

/* Floating button brand backgrounds */
.social-btn-line {
    background: transparent !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important;
}
.social-btn-line:hover {
    box-shadow: 0 6px 25px rgba(0,0,0,0.12) !important;
    background: rgba(0,0,0,0.03) !important;
}
.social-btn-messenger {
    background: transparent !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important;
}
.social-btn-messenger:hover {
    box-shadow: 0 6px 25px rgba(0,0,0,0.12) !important;
    background: rgba(0,0,0,0.03) !important;
}
.social-btn-line,
.social-btn-messenger {
    transition: all 0.25s ease;
    position: relative;
    cursor: pointer;
    border: none;
    outline: none;
}
.social-btn-line::after,
.social-btn-messenger::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    animation: social-pulse 2s ease-in-out infinite;
    z-index: -1;
}
.social-btn-line::after { background: rgba(6, 199, 85, 0.3); }
.social-btn-messenger::after { background: rgba(0, 132, 255, 0.3); }

@keyframes social-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0; }
}

/* Footer social links */
.social-footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #9CA3AF;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease;
    text-decoration: none;
}
.social-footer-link:hover {
    color: #FF6B00;
    background: rgba(255, 107, 0, 0.12);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.2);
}
.social-footer-link svg {
    width: 18px;
    height: 18px;
}

/* Contact page social cards */
.social-contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #F1F5F9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
    text-decoration: none;
    margin-bottom: 0.5rem;
}
.social-contact-card:hover {
    border-color: #E2E8F0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.social-contact-card:hover .w-12.h-12 {
    transform: scale(1.08);
}
.social-contact-card .w-12.h-12 {
    transition: transform 0.25s ease;
}
.social-contact-card svg.w-5.h-5 {
    width: 22px;
    height: 22px;
}

/* Contact page info icons (phone, mail, etc) */
.contact-info-icon {
    transition: transform 0.2s ease;
}
.contact-info-icon:hover {
    transform: scale(1.1);
}

/* CTA buttons gradient brand colors */
.cta-btn-line {
    background: linear-gradient(135deg, #06C755, #05a34a);
}
.cta-btn-messenger {
    background: linear-gradient(135deg, #0084FF, #0073e6);
}
.reviews-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.reviews-track {
    display: flex;
    gap: 16px;
    width: max-content;
    animation: marquee-scroll 40s linear infinite;
    will-change: transform;
    padding: 4px 0;
}

.reviews-wrapper:hover .reviews-track {
    animation-play-state: paused;
}

.reviews-track .review-card {
    flex-shrink: 0;
    width: 300px;
}

.reviews-track .avatar-fallback {
    flex-shrink: 0;
}

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

/* Responsive card widths */
@media (max-width: 640px) {
    .reviews-track .review-card {
        width: 260px;
    }
}

/* =============================================
   PRINT STYLES — Fix 11: ซ่อน nav, sidebar, ads
   ============================================= */
@media print {
    #navbar-include,
    #footer-include,
    [data-social],
    .hero-bg,
    #sidebar-filters,
    .sticky,
    .fav-btn,
    .video-card,
    iframe,
    noscript {
        display: none !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }
    a {
        color: #000 !important;
        text-decoration: underline;
    }
    .max-w-[1400px],
    .max-w-[800px],
    .max-w-[1200px] {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    @page {
        margin: 1.5cm;
    }
}

/* ===== jQuery UI Price Range Slider ===== */
#price-slider-container {
    margin: 8px 0 4px 0;
}
.price-slider-ui {
    height: 6px;
    border: none;
    background: #e5e7eb;
    border-radius: 999px;
    position: relative;
    margin: 0 10px;
}
.price-slider-ui .ui-slider-range {
    background: #FF6B00;
    border-radius: 999px;
}
.price-slider-ui .ui-slider-handle {
    width: 20px;
    height: 20px;
    background: #FF6B00;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    outline: none;
    top: 50%;
    transform: translateY(-50%);
    margin-left: -10px;
}
.price-slider-ui .ui-slider-handle:hover {
    background: #E65C00;
}
.price-slider-ui .ui-slider-handle:active,
.price-slider-ui .ui-slider-handle:focus {
    background: #E65C00;
    box-shadow: 0 0 0 3px rgba(255,107,0,0.3);
}
.price-slider-ui .ui-widget-header {
    background: #FF6B00;
}
.price-slider-ui .ui-state-default,
.price-slider-ui .ui-widget-content .ui-state-default,
.price-slider-ui .ui-widget-header .ui-state-default {
    background: #FF6B00;
    border: 3px solid #fff;
    border-radius: 50%;
}

/* ===== Strobe Button (Sell Car CTA) ===== */
@keyframes strobe {
    0%, 19% { background: #FF6B00; color: #fff; }
    20%, 39% { background: #0B1221; color: #fff; }
    40%, 59% { background: #FFD700; color: #000; }
    60%, 79% { background: #FF4500; color: #fff; }
    80%, 100% { background: #0B1221; color: #fff; }
}
.btn-strobe {
    animation: strobe 0.8s steps(1) infinite !important;
    border: none !important;
}
.btn-strobe:hover {
    animation: strobe 0.4s steps(1) infinite !important;
    filter: brightness(1.1);
}
/* Highlight text sync with strobe */
@keyframes hlFlash {
    0%, 19% { color: #fff; }
    20%, 39% { color: #FF6B00; }
    40%, 59% { color: #000; }
    60%, 79% { color: #fff; }
    80%, 100% { color: #FF6B00; }
}
.btn-strobe .strobe-highlight {
    animation: hlFlash 0.8s steps(1) infinite;
}
