/* ==========================================================================
   Madurai Car Rentals — design tokens
   Palette pulled from approved mockups: navy header/footer, gold accent,
   white content sections. Kept deliberately close to the mockup since
   that direction is already chosen — not a default I'm picking myself.
   ========================================================================== */

:root {
    --navy-900: #0F1B2E;
    --navy-800: #16233B;
    --navy-700: #1E304F;
    --gold-500: #F5A623;
    --gold-600: #DB930F;
    --cream-50: #FFFDF9;
    --ink-900: #1A1A2E;
    --ink-600: #5A6072;
    --ink-400: #8B90A0;
    --line-200: #E8E6E1;
    --success-600: #1FA855;

    --font-display: 'Sora', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-card: 0 4px 20px rgba(15, 27, 46, 0.08);
    --shadow-lifted: 0 12px 32px rgba(15, 27, 46, 0.14);
    --container: 1160px;
}

* { box-sizing: border-box; }
/*
 * Guarantee against page-level horizontal scroll, not just a manual audit.
 * Applied to html specifically (not body) and only the x-axis, which
 * should not break the site's vertical (top:) sticky sidebar/nav elements,
 * since sticky-vs-overflow compatibility is checked per axis in modern
 * browsers - only y-axis overflow affects top: sticky positioning.
 * This doesn't replace the intentional, contained horizontal scroll used
 * by the fare carousel and tablet table - those stay, since a swipeable
 * card row is exactly what "looks like an app" usually means (Instagram,
 * Swiggy, Uber's vehicle picker all use this same pattern). This guards
 * against the page itself ever sliding sideways by accident, which is a
 * different, genuinely bad thing.
 */
html { overflow-x: hidden; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink-900);
    background: var(--cream-50);
    line-height: 1.55;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 0.5em; line-height: 1.15; }
p { margin: 0 0 1em; color: var(--ink-600); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid var(--gold-500);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---- Buttons ------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-gold { background: var(--gold-500); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-600); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--line-200); color: var(--ink-900); }
.btn-outline:hover { border-color: var(--navy-800); }
.btn-whatsapp { background: var(--success-600); color: #fff; }
.btn-whatsapp:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }
.btn .icon { width: 18px; height: 18px; }

/* ---- Top utility bar ------------------------------------------------ */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line-200);
    font-size: 0.85rem;
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    padding-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--navy-900); }
/* Global default: every <svg class="icon"> is unsized by the icon() PHP
   helper (viewBox only, no width/height attrs), so without this rule
   browsers fall back to the default replaced-element size (300x150px),
   which is the "all icons huge" bug. This rule is the safety net —
   every icon on the site is guaranteed a sane size even if a new one
   gets added somewhere with no specific selector below. */
.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.brand .icon { width: 26px; height: 26px; color: var(--gold-500); }
.brand small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.62rem; letter-spacing: 0.06em; color: var(--ink-400); text-transform: uppercase; }
.topbar-links { display: flex; align-items: center; gap: 22px; color: var(--ink-600); }
.topbar-links .icon { width: 16px; height: 16px; color: var(--gold-500); vertical-align: -3px; margin-right: 4px; }

/* ---- Main nav --------------------------------------------------------*/
.navbar { background: var(--navy-900); }
.navbar .container { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: #D8DCE6; font-size: 0.92rem; font-weight: 500; padding: 8px 2px; }
.nav-links a:hover, .nav-links a.active { color: var(--gold-500); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
    .nav-links { display: none; }
    .nav-toggle { display: block; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; padding: 4px 8px; }
    .nav-links.open {
        display: flex; flex-direction: column; gap: 0;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--navy-900); padding: 8px 20px 16px; z-index: 40;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }
    .nav-links.open li { border-top: 1px solid rgba(255,255,255,0.1); }
    .nav-links.open a { display: block; padding: 12px 4px; }
    .navbar { position: relative; }
}

/* ---- Hero (real photo background, cropped from the project's own mockup) --*/
.hero-photo {
    position: relative;
    color: #fff;
    padding: 64px 0 90px;
    overflow: hidden;
    background-image:
        linear-gradient(100deg, rgba(15,27,45,0.94) 0%, rgba(15,27,45,0.82) 32%, rgba(15,27,45,0.35) 62%, rgba(15,27,45,0.15) 100%),
        url('../img/hero-bg.jpg');
    background-size: cover;
    background-position: center 30%;
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }
.hero-left { display: flex; flex-direction: column; }
.eyebrow { color: var(--gold-500); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3rem); }
.hero h1 .accent { color: var(--gold-500); }
.hero .lead { color: #B9C0D1; font-size: 1.05rem; max-width: 46ch; }
.trust-row { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 28px; }
.trust-row > * { min-width: 0; }
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: #C9CEDB; }
.trust-item .icon { width: 18px; height: 18px; color: var(--gold-500); }

.hero-quote-card { justify-self: end; }

.quote-card {
    background: #fff;
    color: var(--ink-900);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lifted);
    max-width: 420px;
}
.quote-card h3 { font-size: 1.15rem; }
.quote-card .sub { font-size: 0.85rem; color: var(--ink-400); margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink-600); margin-bottom: 6px; }
.field input, .field select {
    width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--line-200); font-family: var(--font-body); font-size: 0.92rem;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quote-card .btn { margin-top: 4px; }
.quote-alt { text-align: center; font-size: 0.82rem; color: var(--ink-400); margin-top: 16px; }
.quote-alt strong { color: var(--navy-900); display: block; font-size: 1rem; margin-top: 2px; }

@media (max-width: 860px) {
    .hero .container { grid-template-columns: 1fr; }
    .hero-quote-card { justify-self: stretch; }
}

/* ---- Section headers ---------------------------------------------------*/
.section { padding: 64px 0; }
.breadcrumbs { padding: 14px 0 0; }
.blog-content h2 { font-size: 1.3rem; margin-top: 28px; margin-bottom: 10px; }
.blog-content h3 { font-size: 1.1rem; margin-top: 20px; margin-bottom: 8px; }
.blog-content p { margin-bottom: 14px; line-height: 1.7; }
.blog-content ul, .blog-content ol { margin: 0 0 14px 20px; line-height: 1.8; }
.blog-content li { margin-bottom: 4px; }
.blog-content strong { color: var(--navy-900); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 0.8rem; }
.breadcrumbs li { color: var(--ink-400); display: flex; align-items: center; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: '/'; color: var(--line-200); margin-left: 6px; }
.breadcrumbs a { color: var(--ink-600); }
.breadcrumbs a:hover { color: var(--gold-600); text-decoration: underline; }
.breadcrumbs li[aria-current="page"] { color: var(--ink-900); font-weight: 500; }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head .eyebrow { color: var(--gold-600); }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

/* ---- Card grids ----------------------------------------------------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4, .grid-6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; } }

.card {
    background: #fff; border-radius: var(--radius-md); padding: 26px;
    box-shadow: var(--shadow-card); border: 1px solid var(--line-200);
}
.card .icon-badge {
    width: 46px; height: 46px; border-radius: 12px; background: rgba(245,166,35,0.12);
    display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.card .icon-badge .icon { width: 24px; height: 24px; color: var(--gold-600); }
.card h3 { font-size: 1.05rem; }
.card p { font-size: 0.9rem; margin-bottom: 0; }

.services-grid .card { text-align: center; }
.services-grid .icon-badge {
    width: 64px; height: 64px; background: transparent; margin: 0 auto 16px;
}
.services-grid .icon-badge .icon { width: 42px; height: 42px; }

.route-card { overflow: hidden; padding: 0; }
.route-card .thumb {
    height: 120px; background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
    display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.35);
}
.route-card .thumb .icon { width: 34px; height: 34px; }
.route-card .body { padding: 18px 20px; }
.route-card .price-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--ink-400); margin-top: 8px; }
.route-card .price-row strong { color: var(--navy-900); font-size: 0.95rem; }

.vehicle-card { text-align: center; display: flex; flex-direction: column; }
.vehicle-card .thumb {
    height: 90px; margin-bottom: 14px; border-radius: 10px; background: var(--cream-50);
    display: flex; align-items: center; justify-content: center; color: var(--ink-400);
}
.vehicle-card .thumb .icon { width: 40px; height: 40px; }
.vehicle-card .rate { color: var(--gold-600); font-weight: 700; font-size: 1.05rem; }
.vehicle-card .meta { font-size: 0.8rem; color: var(--ink-400); margin-bottom: 12px; }
.tag {
    display: inline-block; background: var(--cream-50); border: 1px solid var(--line-200);
    border-radius: 999px; padding: 4px 11px; font-size: 0.75rem; color: var(--ink-600);
}

/* ---- Trip detail chips (route pages) ---------------------------------*/
.chip-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 24px 0; }
@media (max-width: 520px) {
    .chip-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .chip-row .card { min-width: 0; }
}
.chip {
    flex: 1; min-width: 150px; background: #fff; border: 1px solid var(--line-200);
    border-radius: var(--radius-sm); padding: 14px 16px;
}
.chip .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-400); }
.chip .value { font-weight: 700; font-family: var(--font-display); margin-top: 2px; }

table.fare-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); }
table.fare-table th, table.fare-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line-200); font-size: 0.92rem; }
table.fare-table th { background: var(--navy-900); color: #fff; font-family: var(--font-display); font-weight: 600; }
table.fare-table tr:last-child td { border-bottom: none; }
table.fare-table tbody tr:nth-child(even) { background: #FAFBFC; }

/* ---- FAQ ------------------------------------------------------------ */
.faq-item { background: #fff; border: 1px solid var(--line-200); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.faq-item summary { padding: 16px 20px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.3rem; color: var(--gold-600); }
.faq-item[open] summary::after { content: '−'; }
.faq-item .faq-body { padding: 0 20px 18px; font-size: 0.92rem; color: var(--ink-600); }

/* ---- CTA band --------------------------------------------------------*/
.cta-band { background: var(--navy-900); color: #fff; border-radius: var(--radius-lg); padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band > * { min-width: 0; }
.cta-band h3 { margin-bottom: 4px; }
.cta-band p { color: #B9C0D1; margin-bottom: 0; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- Footer ---------------------------------------------------------- */
footer { background: var(--navy-900); color: #B9C0D1; padding: 56px 0 24px; margin-top: 40px; }
footer h4 { color: #fff; font-size: 0.95rem; }
footer a { color: #B9C0D1; font-size: 0.88rem; }
footer a:hover { color: var(--gold-500); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid > * { min-width: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid ul li { overflow-wrap: anywhere; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 40px; padding-top: 20px; font-size: 0.8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---- Sticky mobile call bar ------------------------------------------*/
.mobile-call-bar { display: none; }
@media (max-width: 640px) {
    .mobile-call-bar {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
        background: #fff; border-top: 1px solid var(--line-200); box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    }
    .mobile-call-bar a { flex: 1; min-width: 0; text-align: center; padding: 14px 0; font-weight: 700; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-call-bar .icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
    .mobile-call-bar a.call { background: var(--gold-500); color: var(--navy-900); }
    .mobile-call-bar a.wa { background: var(--success-600); color: #fff; }
    body { padding-bottom: 54px; }
}

.text-muted { color: var(--ink-400); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/*
 * Two-column layout with sticky sidebar - used on all 22 route pages and
 * every blog post (main content + quote form sidebar). Previously an
 * unprotected inline style with zero mobile breakpoint - on a real phone
 * this squeezed both columns into unusably narrow strips instead of
 * stacking. Found via code review, not visual testing (no browser
 * rendering tool available here) - worth confirming on a real device too.
 */
.two-col-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; margin-top: 20px; }
.two-col-layout > * { min-width: 0; }
@media (max-width: 860px) {
    .two-col-layout { grid-template-columns: 1fr; }
    .two-col-layout aside { position: static !important; }
}

@media (max-width: 700px) {
    .contact-layout { grid-template-columns: 1fr !important; }
}

/*
 * Fare cards: mobile alternative to the wide comparison table. A scrollable
 * table without a sticky first column loses the "which row is this" context
 * the moment you scroll right to see prices - confirmed as a real problem
 * via live screenshots, not just theory. Cards restructure the same data
 * vertically instead, so nothing scrolls out of context. Desktop/tablet
 * keep the full table (more scannable at that width); only mobile switches.
 */
.fare-table-wrapper { display: block; }
.fare-cards { display: none; }
@media (max-width: 700px) {
    .fare-table-wrapper { display: none; }
    .fare-cards { display: block; }
}

.route-fare-table-wrapper { display: block; }
.route-fare-cards { display: none; }
@media (max-width: 600px) {
    .route-fare-table-wrapper { display: none; }
    .route-fare-cards { display: flex; flex-direction: column; gap: 10px; }
}
.route-fare-card {
    display: grid; grid-template-columns: 48px 1fr auto auto; align-items: center; gap: 12px;
    background: #fff; border: 1px solid var(--line-200); border-radius: var(--radius-md);
    padding: 10px 14px; box-shadow: var(--shadow-card);
}
.route-fare-card img { width: 48px; height: 36px; object-fit: contain; }
.route-fare-card-name { font-weight: 600; font-size: 0.9rem; }
.route-fare-card-price { font-weight: 700; text-align: right; font-size: 0.92rem; white-space: nowrap; }

.fare-card2 {
    background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
    padding: 14px; margin-bottom: 16px; overflow: hidden;
}
.fare-card2-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.badge-type { background: var(--navy-900); color: #fff; font-size: 0.8rem; font-weight: 700; padding: 5px 12px; border-radius: 20px; }
.badge-ac2 { font-size: 0.78rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; }
.fare-card2.is-ac .badge-ac2 { background: #E6F7ED; color: var(--success-600); }
.fare-card2.is-nonac .badge-ac2 { background: #E8F0FE; color: #3B6FE0; }

.fare-card2-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.fare-card2-hero img { width: 45%; max-width: 160px; object-fit: contain; flex-shrink: 0; }
.fare-card2-meta { display: flex; flex-direction: column; gap: 10px; font-size: 0.85rem; color: var(--ink-600); }
.fare-card2-meta span { display: flex; align-items: center; gap: 6px; }
.fare-card2-meta .icon { width: 16px; height: 16px; flex-shrink: 0; }

.fare-card2-rates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.rate-box { background: #F7F8FA; border-radius: var(--radius-sm); padding: 10px 12px; text-align: center; }
.rate-box .label { font-size: 0.72rem; color: var(--ink-400); margin-bottom: 4px; }
.rate-box .value { font-size: 1.15rem; font-weight: 800; }
.fare-card2.is-nonac .rate-box .value { color: #3B6FE0; }
.fare-card2.is-ac .rate-box .value { color: var(--success-600); }

.fare-card2-extras { display: flex; justify-content: space-between; gap: 6px; font-size: 0.72rem; color: var(--ink-600); text-align: center; margin-bottom: 14px; }
.fare-card2-extras span { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fare-card2-extras .icon { width: 16px; height: 16px; color: var(--ink-400); }
.fare-card2-extras strong { color: var(--ink-900); font-size: 0.78rem; }

.fare-card2-cta { border: none; }
.fare-card2.is-nonac .fare-card2-cta { background: var(--navy-900); color: #fff; }
.fare-card2.is-ac .fare-card2-cta { background: var(--success-600); color: #fff; }

/*
 * Tablet: keep the full table (more scannable at this width than cards),
 * but pin the Car Type column while the rest scrolls - so you never lose
 * track of which row you're looking at while scrolling to see prices,
 * without needing the mobile card layout at a width where a table still
 * fits reasonably well.
 */
@media (min-width: 701px) and (max-width: 1023px) {
    .fare-table-wrapper td:first-child,
    .fare-table-wrapper th:first-child {
        position: sticky; left: 0; z-index: 2;
        background: #fff; box-shadow: 2px 0 4px rgba(0,0,0,0.06);
    }
    .fare-table-wrapper th:first-child { background: var(--navy-900); }
}
.fare-card { background: #fff; border: 1px solid var(--line-200); border-radius: var(--radius-md); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; }
.fare-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fare-card-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--navy-900); display: flex; align-items: center; justify-content: center; }
.fare-card-icon .icon { width: 24px; height: 24px; color: var(--gold-500); }
.fare-card-head h3 { font-size: 1rem; margin: 0 0 2px; line-height: 1.2; }
.fare-card-head .badge-ac { font-size: 0.78rem; color: var(--ink-400); }
.fare-card-rates { border-top: 1px solid var(--line-200); padding-top: 10px; margin-bottom: 14px; }
.fare-card-rates .rate-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.fare-card-rates .rate-row.primary { font-size: 0.95rem; border-bottom: 1px dashed var(--line-200); }
.fare-card-rates .rate-row.primary .value { font-weight: 700; color: var(--gold-600); font-size: 1.05rem; }
.fare-card-rates .rate-row.secondary { font-size: 0.8rem; color: var(--ink-600); padding: 4px 0; }
.fare-card-rates .rate-row .label { color: var(--ink-400); }
.fare-card .btn { margin-top: auto; }
