/**
 * Autonis Core - Luxury Automotive Header & Footer Stylesheet
 * Philosophy: Dark Obsidian Glassmorphism, Precision Cockpit Telemetry & Local Vazirmatn
 * Direction: RTL-First
 */

/* ==========================================================================
   WORDPRESS THEME & FULL-BLEED INTEGRATION (Kill White Padding & 645px Caps)
   ========================================================================== */
html:has(.autonis-header-wrapper),
html:has(.autonis-landing-wrapper),
body:has(.autonis-header-wrapper),
body:has(.autonis-landing-wrapper),
body.page-id-40 {
    background-color: #070a13 !important;
    color: #f8fafc !important;
    --wp--preset--color--base: #070a13 !important;
    --wp--style--root--padding-right: 0px !important;
    --wp--style--root--padding-left: 0px !important;
    --wp--style--root--padding-top: 0px !important;
    --wp--style--root--padding-bottom: 0px !important;
}

body:has(.autonis-header-wrapper) .wp-site-blocks,
body:has(.autonis-landing-wrapper) .wp-site-blocks,
body.page-id-40 .wp-site-blocks {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    background-color: #070a13 !important;
    overflow-x: hidden !important;
}

body:has(.autonis-landing-wrapper) main,
body:has(.autonis-header-wrapper) main,
body.page-id-40 main,
body:has(.autonis-landing-wrapper) main.wp-block-group,
body:has(.autonis-header-wrapper) main.wp-block-group {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: #070a13 !important;
}

body:has(.autonis-landing-wrapper) .entry-content,
body:has(.autonis-header-wrapper) .entry-content,
body.page-id-40 .entry-content,
body:has(.autonis-landing-wrapper) .wp-block-post-content,
body.page-id-40 .wp-block-post-content {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
}

/* Remove 645px global content constraints from WordPress block themes */
.is-layout-constrained> :where(:not(.alignleft):not(.alignright)):has(.autonis-landing-wrapper),
.is-layout-constrained> :where(:not(.alignleft):not(.alignright)):has(.autonis-header-wrapper),
.is-layout-constrained> :where(:not(.alignleft):not(.alignright)):has(.autonis-footer-wrapper),
.is-layout-constrained>.autonis-landing-wrapper,
.is-layout-constrained>.autonis-header-wrapper,
.is-layout-constrained>.autonis-footer-wrapper,
.entry-content:has(.autonis-landing-wrapper),
.entry-content:has(.autonis-header-wrapper),
.entry-content:has(.autonis-footer-wrapper) {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Hide default theme separator lines that clash with dark luxury design */
body:has(.autonis-header-wrapper) hr.wp-block-separator,
body:has(.autonis-landing-wrapper) hr.wp-block-separator,
body.page-id-40 hr.wp-block-separator,
.wp-block-separator.has-alpha-channel-opacity {
    display: none !important;
}

/* Neutralize rogue <p> and <br> tags injected by WordPress wpautop in layouts */
.autonis-header-wrapper p,
.autonis-footer-wrapper p,
.autonis-landing-wrapper p:empty {
    margin: 0;
}

.autonis-header-wrapper br,
.autonis-footer-wrapper br {
    display: none !important;
}

.autonis-header-inner>p,
.autonis-header-controls>p,
.autonis-topbar-inner>p,
.autonis-topbar-right>p,
.autonis-topbar-left>p,
.autonis-nav-menu>p,
.autonis-footer-assurances>p,
.autonis-footer-columns>p,
.autonis-footer-bottom>p {
    display: contents !important;
}

/* ==========================================================================
   HEADER COMPONENT
   ========================================================================== */
.autonis-header-wrapper {
    position: relative;
    width: 100%;
    direction: rtl;
    text-align: right;
    font-family: var(--atn-font-sans, 'Vazirmatn', sans-serif);
    color: var(--atn-text-inverse, #f8fafc);
    box-sizing: border-box;
    z-index: 990;
}

.autonis-header-wrapper *,
.autonis-header-wrapper *::before,
.autonis-header-wrapper *::after,
.autonis-footer-wrapper *,
.autonis-footer-wrapper *::before,
.autonis-footer-wrapper *::after {
    box-sizing: border-box;
}

/* Top Telemetry Notification Strip */
.autonis-header-topbar {
    background: #05080f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 7px 0;
    font-size: var(--atn-fs-2xs, 11px);
    color: var(--atn-slate-400, #94a3b8);
}

.autonis-topbar-inner {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.autonis-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.autonis-topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.autonis-topbar-link {
    color: var(--atn-slate-300, #cbd5e1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color var(--atn-transition-snappy, 140ms ease);
}

.autonis-topbar-link:hover {
    color: var(--atn-accent-400, #fbbf24);
}

.autonis-currency-tag {
    background: rgba(245, 158, 11, 0.12);
    color: var(--atn-accent-400, #fbbf24);
    padding: 2px 8px;
    border-radius: var(--atn-radius-full, 9999px);
    font-family: var(--atn-font-mono, monospace);
    font-weight: 700;
}

/* Main Navigation Bar (Sticky Glassmorphism) */
.autonis-main-header {
    background: rgba(9, 13, 22, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 995;
    transition: all var(--atn-transition-smooth, 220ms ease);
}

.autonis-header-inner {
    max-width: 1380px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Brand Identity */
.autonis-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}

.autonis-brand-emblem {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--atn-accent-400, #fbbf24);
    font-size: 22px;
    transition: transform var(--atn-transition-snappy, 140ms ease);
}

.autonis-brand:hover .autonis-brand-emblem {
    transform: scale(1.06);
    box-shadow: 0 0 16px var(--atn-accent-glow, rgba(217, 119, 6, 0.4));
}

.autonis-brand-title {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #ffffff;
    line-height: 1.1;
    margin: 0;
    font-family: var(--atn-font-sans);
}

.autonis-brand-title span {
    color: var(--atn-accent-400, #fbbf24);
}

.autonis-brand-tagline {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--atn-slate-400, #94a3b8);
    display: block;
    font-weight: 600;
}

/* Navigation Links (Desktop) */
.autonis-nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 1080px) {
    .autonis-nav-menu {
        display: none;
    }
}

.autonis-nav-item a {
    color: var(--atn-slate-200, #e2e8f0);
    text-decoration: none !important;
    font-size: var(--atn-fs-sm, 13px);
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--atn-radius-full, 9999px);
    transition: all var(--atn-transition-snappy, 140ms ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.autonis-nav-item a:hover,
.autonis-nav-item.is-active a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.autonis-nav-item.is-active a {
    color: var(--atn-accent-400, #fbbf24);
    background: rgba(245, 158, 11, 0.1);
}

/* Header Controls: Garage Chip & Cart */
.autonis-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Active Vehicle Chip in Header */
.autonis-header-garage-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 14px;
    border-radius: var(--atn-radius-full, 9999px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
    cursor: pointer;
    border: none;
    color: #ffffff;
    font-family: inherit;
    transition: all var(--atn-transition-snappy, 140ms ease);
}

.autonis-header-garage-chip:hover {
    background: rgba(245, 158, 11, 0.14);
    box-shadow: 0 0 16px var(--atn-accent-glow, rgba(217, 119, 6, 0.3));
    transform: translateY(-1px);
}

.autonis-header-vehicle-name {
    font-size: var(--atn-fs-xs, 12px);
    font-weight: 700;
}

.autonis-header-garage-chip .dashicons-car {
    color: var(--atn-accent-400, #fbbf24);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Cart Counter Pill */
.autonis-header-cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--atn-accent-500, #f59e0b), var(--atn-accent-600, #d97706));
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 8px 16px;
    border-radius: var(--atn-radius-full, 9999px);
    font-size: var(--atn-fs-xs, 12px);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
    transition: all var(--atn-transition-snappy, 140ms ease);
}

.autonis-header-cart-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.55);
}

.autonis-cart-badge-count {
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 9999px;
    padding: 1px 6px;
    font-family: var(--atn-font-mono, monospace);
}

/* Mobile Hamburger Toggle */
.autonis-hamburger-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
}

@media (max-width: 1080px) {
    .autonis-hamburger-toggle {
        display: inline-flex;
    }
}

/* Mobile Drawer */
.autonis-mobile-drawer {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85%;
    background: rgba(9, 13, 22, 0.98);
    backdrop-filter: blur(28px);
    z-index: 1050;
    padding: 24px;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
    transform: translateX(100%);
    transition: transform var(--atn-transition-smooth, 220ms ease);
    overflow-y: auto;
}

.autonis-mobile-drawer.is-open {
    transform: translateX(0);
    display: block;
}

.autonis-drawer-backdrop {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1040;
}

.autonis-drawer-backdrop.is-open {
    display: block;
}

.autonis-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.autonis-drawer-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
}

.autonis-drawer-links {
    list-style: none;
    margin: 0 0 24px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.autonis-drawer-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    transition: background var(--atn-transition-snappy, 140ms ease);
}

.autonis-drawer-links a:hover {
    background: rgba(245, 158, 11, 0.12);
    color: var(--atn-accent-400, #fbbf24);
}

/* ==========================================================================
   FOOTER COMPONENT
   ========================================================================== */
.autonis-footer-wrapper {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, #090d16 0%, #04060a 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--atn-text-inverse, #f8fafc);
    direction: rtl;
    text-align: right;
    font-family: var(--atn-font-sans, 'Vazirmatn', sans-serif);
    padding: 60px 0 28px 0;
    overflow: hidden;
}

.autonis-footer-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    width: 600px;
    height: 300px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.08) 0%, transparent 70%);
    pointer-events: none;
    filter: blur(80px);
}

.autonis-footer-inner {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Footer Top Assurance Strip */
.autonis-footer-assurances {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-bottom: 48px;
    margin-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 1024px) {
    .autonis-footer-assurances {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .autonis-footer-assurances {
        grid-template-columns: 1fr;
    }
}

.autonis-assurance-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.autonis-assurance-icon {
    font-size: 26px;
    color: var(--atn-accent-400, #fbbf24);
    flex-shrink: 0;
}

.autonis-assurance-text strong {
    font-size: var(--atn-fs-sm, 13px);
    font-weight: 700;
    color: #ffffff;
    display: block;
    margin-bottom: 2px;
}

.autonis-assurance-text span {
    font-size: var(--atn-fs-2xs, 11px);
    color: var(--atn-slate-400, #94a3b8);
    display: block;
}

/* Footer Main Columns */
.autonis-footer-columns {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 36px;
    margin-bottom: 48px;
}

@media (max-width: 1024px) {
    .autonis-footer-columns {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .autonis-footer-columns {
        grid-template-columns: 1fr;
    }
}

.autonis-footer-brand p {
    font-size: var(--atn-fs-xs, 12px);
    line-height: 1.8;
    color: var(--atn-slate-400, #94a3b8);
    margin: 14px 0 20px 0;
    max-width: 320px;
}

.autonis-footer-col h5 {
    font-size: var(--atn-fs-base, 14px);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 18px 0;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autonis-footer-col h5::before {
    content: '';
    width: 4px;
    height: 14px;
    background: var(--atn-accent-500, #f59e0b);
    border-radius: 2px;
}

.autonis-footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.autonis-footer-links a {
    color: var(--atn-slate-300, #cbd5e1);
    text-decoration: none;
    font-size: var(--atn-fs-xs, 12px);
    transition: all var(--atn-transition-snappy, 140ms ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.autonis-footer-links a:hover {
    color: var(--atn-accent-400, #fbbf24);
    transform: translateX(-4px);
}

/* Contact Details in Footer */
.autonis-footer-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: var(--atn-fs-xs, 12px);
    color: var(--atn-slate-300, #cbd5e1);
}

.autonis-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.autonis-contact-row .dashicons {
    color: var(--atn-accent-400, #fbbf24);
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

/* Bottom Legal & Compliance Strip */
.autonis-footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-size: var(--atn-fs-2xs, 11px);
    color: var(--atn-slate-500, #64748b);
}

.autonis-footer-disclaimer {
    max-width: 700px;
    line-height: 1.6;
}