/* --- Basic Reset & Global Styles --- */
* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    font-size: 17px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #333;
    line-height: 1.6;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}












/* Prevent body scroll when side nav is open */
body.side-nav-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    color: #1a1a1a;
    margin-bottom: 1rem;
    line-height: 1.3;
}

h2 { font-size: 2rem; text-align: center; margin-bottom: 2rem;}
h3 { font-size: 1.5rem; margin-bottom: 1.5rem; color: #333;}
h4 { font-size: 1.2rem; color: #444; }


a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
    color: #0056b3;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul { list-style: none; }
table { width: 100%; border-collapse: collapse; }

section {
    padding: 20px 0 40px 0; /* Reduced top padding */
}

/* Accessibility: Hide visually but keep for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}


/* --- Header --- */
header {
    background-color: #ffffff;
    padding: 8px 0; /* Reduced padding */
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Blog Navigation */
.blog-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.blog-nav a {
    color: #495057;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.blog-nav a:hover {
    color: #D90429;
    background: #fef2f2;
    transform: translateY(-1px);
}

.blog-nav a.active {
    color: #ffffff;
    background: #D90429;
    box-shadow: 0 2px 8px rgba(217, 4, 41, 0.3);
}

@media (max-width: 768px) {
    .blog-nav {
        display: none;
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px 20px;
    padding: 10px 0;
}
header .logo img {
    height: 38px; /* Slightly smaller logo */
}

/* === Main Navigation Styles === */
/* Desktop Only */
.main-nav-desktop {
    display: flex;
    gap: 12px;
    margin: 0;
    order: 2;
}
.main-nav-desktop a {
    padding: 8px 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
    background-color: #D90429;
    text-decoration: none;
    border-radius: 6px;
    border: 2px solid #D90429;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(217, 4, 41, 0.2);
}
.main-nav-desktop a:hover {
    background-color: #A90321;
    border-color: #A90321;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(217, 4, 41, 0.3);
    text-decoration: none;
    color: #ffffff;
}

/* ================================== */

/* === Tagline Styles === */
.tagline {
    font-family: 'Poppins', sans-serif;
    font-weight: 500; /* Base weight for rest of tagline */
    font-size: 0.9rem; /* Adjusted size */
    color: #1a1a1a; /* Black for base text */
    text-align: center;
    flex-grow: 1; /* Take up space */
    margin: 0 5px; /* Minimal margin */
    padding: 0; /* Removed padding */
    border: none; /* Removed borders */
    order: 1; /* Order for flexbox layout */
    min-width: 200px; /* Prevent shrinking too much */
}
.tagline span.separator {
    color: #D90429; /* Red color for dots */
    font-weight: 700; /* Make dots bolder */
    margin: 0 2px; /* Add slight space around dots */
}
.tagline-pix, .tagline-amp {
    font-weight: 700; /* Make PiX AMP bolder */
    font-size: 1rem; /* Adjusted size */
    margin: 0; /* Ensure no extra margin */
    padding: 0; /* Ensure no extra padding */
}
.tagline-pix { color: #D90429; }
.tagline-amp { color: #1a1a1a; }

.tagline-mobile { display: none; } /* Hide mobile tagline by default */
/* ============================= */

/* === Language Link Styles === */
.language-switcher-links {
    display: flex;
    align-items: center;
    gap: 5px; /* Space between links/separators */
    order: 3; /* Order for flexbox layout */
}
.lang-link {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.85rem; /* Smaller font */
    color: #555; /* Grey inactive color */
    text-decoration: none;
    padding: 4px 6px; /* Small padding */
    border-radius: 3px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.lang-link:hover {
    background-color: #f0f0f0; /* Light grey hover */
    color: #1a1a1a; /* Black text on hover */
    text-decoration: none;
}
.lang-link.active {
    color: #D90429; /* Red for active language */
    font-weight: 700; /* Bolder active language */
    background-color: #fce8ec; /* Light red background */
    pointer-events: none; /* Make active link non-clickable */
    cursor: default;
}
.lang-separator {
    color: #ccc; /* Light grey separator */
    font-size: 0.85rem;
    line-height: 1;
}
/* ============================= */

/* --- Hamburger Menu (Mobile Only) --- */
.hamburger-menu {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin: 0;
    order: 4; /* Position it last in the flex row */
    z-index: 1100; /* Above header, side nav, overlay */
}
.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333; /* Black bars */
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}
.hamburger-menu.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }


/* --- Side Navigation Panel (Mobile Only) --- */
.side-nav {
    position: fixed; top: 0; right: -280px; width: 280px; max-width: 80%; height: 100%; background-color: #ffffff; box-shadow: -2px 0 5px rgba(0,0,0,0.1); padding: 60px 20px 20px; transition: right 0.3s ease-in-out; z-index: 1050; overflow-y: auto;
}
.side-nav.active { right: 0; }
.side-nav nav { display: flex; flex-direction: column; }
.side-nav a {
    color: #333;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
    display: block;
}
.side-nav a:hover {
    background-color: #D90429;
    color: #ffffff;
    text-decoration: none;
}
.side-nav a:last-child { border-bottom: none; }


/* --- Overlay --- */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); opacity: 0; visibility: hidden; transition: opacity 0.3s ease-in-out, visibility 0s 0.3s linear; z-index: 1000;
}
.overlay.active { opacity: 1; visibility: visible; transition: opacity 0.3s ease-in-out, visibility 0s 0s linear; }


/* --- Buttons --- */
.cta-button {
    display: inline-block;
    background-color: #D90429; /* Red */
    color: #ffffff;
    padding: 12px 28px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
}

.cta-button:hover {
    background-color: #A90321; /* Darker Red */
    text-decoration: none;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cta-button.secondary {
    background-color: #f0f9f0;
    border: 2px solid #c3e6c3;
    color: #28a745;
}
.cta-button.secondary:hover {
    background-color: #e8f5e8;
    color: #1e7e34;
}

/* --- Clean Navigation Hub --- */
.navigation-hub {
    background: linear-gradient(135deg, #fef7f7 0%, #fce8ec 100%);
    color: #333;
    padding: 60px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid #f8d7da;
    position: relative;
    overflow: hidden;
}

.navigation-hub::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100'%3E%3Cpath d='M0 50 Q150 20 300 50 T600 50 T900 50 T1200 50 L1200 100 L0 100 Z' fill='rgba(217, 4, 41, 0.08)'/%3E%3C/svg%3E");
    background-size: 1200px 100px;
    animation: waveFlow 15s linear infinite;
}

.navigation-hub::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60'%3E%3Cellipse cx='100' cy='30' rx='60' ry='20' fill='rgba(217, 4, 41, 0.04)'/%3E%3Cellipse cx='300' cy='25' rx='80' ry='25' fill='rgba(217, 4, 41, 0.05)'/%3E%3Cellipse cx='550' cy='35' rx='70' ry='22' fill='rgba(217, 4, 41, 0.045)'/%3E%3C/svg%3E");
    background-size: 1200px 60px;
    animation: cloudMove 25s linear infinite;
}

.nav-cards::before {
    content: '';
    position: absolute;
    bottom: 45px;
    left: 0;
    width: 80px;
    height: 48px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 48'%3E%3Cellipse cx='40' cy='24' rx='35' ry='18' fill='rgba(217, 4, 41, 0.2)'/%3E%3Cellipse cx='40' cy='16' rx='24' ry='13' fill='rgba(217, 4, 41, 0.15)'/%3E%3Ccircle cx='24' cy='38' r='6' fill='rgba(217, 4, 41, 0.3)'/%3E%3Ccircle cx='56' cy='38' r='6' fill='rgba(217, 4, 41, 0.3)'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    animation: beetleRide 15s linear infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes waveFlow {
    0% { background-position: 0 0; }
    100% { background-position: 1200px 0; }
}

@keyframes cloudMove {
    0% { background-position: 0 0; }
    100% { background-position: 1200px 0; }
}

@keyframes beetleRide {
    0% { left: 0; transform: translateY(0); }
    12.5% { transform: translateY(-8px); }
    25% { transform: translateY(0); }
    37.5% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    62.5% { transform: translateY(-8px); }
    75% { transform: translateY(0); }
    87.5% { transform: translateY(-8px); }
    100% { left: 100%; transform: translateY(0); }
}

.navigation-hub-compact {
    padding: 20px 0;
}

.navigation-hub-compact h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.navigation-hub-compact .nav-cards {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.navigation-hub-compact .nav-card {
    padding: 15px 12px;
    overflow: hidden;
}

.navigation-hub-compact .nav-card * {
    pointer-events: none;
}

.navigation-hub-compact .nav-icon {
    font-size: 1.5rem;
}

.navigation-hub-compact h3 {
    font-size: 1rem;
    word-break: keep-all;
    hyphens: none;
}

.navigation-hub-compact p {
    font-size: 0.8rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .navigation-hub-compact {
        padding: 15px 0;
    }
    
    .navigation-hub-compact h2 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .navigation-hub-compact .nav-cards {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px;
    }
    
    .navigation-hub-compact .nav-card {
        padding: 10px 8px;
        min-width: 0;
    }
    
    .navigation-hub-compact .nav-icon {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    
    .navigation-hub-compact h3 {
        font-size: 0.75rem;
        margin-bottom: 0;
        line-height: 1.2;
        word-break: keep-all;
        hyphens: none;
    }
    
    .navigation-hub-compact p {
        display: none;
    }
}

.navigation-hub h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #1a1a1a;
}

.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-card {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: block;
    position: relative;
    z-index: 20;
}

.nav-card:hover {
    transform: translateY(-10px);
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #D90429;
    border-color: #D90429;
}

.nav-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    animation: breathe 2.5s ease-in-out infinite;
    transition: all 0.3s ease;
    transform-origin: center;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.nav-card:hover .nav-icon {
    animation: breathe-fast 1s ease-in-out infinite;
}

@keyframes breathe-fast {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.25); }
}

.nav-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.nav-card p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
    margin: 0;
}

@media (max-width: 768px) {
    .navigation-hub {
        padding: 40px 0;
    }
    
    .navigation-hub h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    
    .nav-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .nav-card {
        padding: 25px 15px;
    }
    
    .navigation-hub-compact .nav-cards {
        grid-template-columns: 1fr;
    }
    
    .navigation-hub-compact h3 {
        font-size: 0.9rem;
    }
    
    .navigation-hub-compact p {
        font-size: 0.75rem;
    }
}

/* --- Clean Calculator Hub --- */
.calculator-hub {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    padding: 30px 40px;
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.calculator-hub h1 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 25px;
}

/* --- Content Formatting (NEW) --- */
.intro-content {
    max-width: 900px;
    margin: 20px auto 40px auto;
    padding: 0 10px;
    line-height: 1.7;
    font-size: 1.05rem;
}

.intro-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #222;
    text-align: left;
    border-bottom: 2px solid #D90429; /* Red underline for modern emphasis */
    padding-bottom: 5px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.intro-content p {
    margin-bottom: 1.5rem;
    color: #495057; /* Slightly softer text color */
}

.intro-content p strong {
    color: #1a1a1a; /* Ensure emphasized terms stand out */
    font-weight: 700;
}

.intro-content a {
    text-decoration: underline; /* Emphasize links in content */
}

.seo-link-box {
    margin-top: 30px;
    padding: 15px;
    border-left: 5px solid #D90429;
    background-color: #f8f9fa;
    font-style: italic;
    font-size: 0.95rem;
}
/* --- END Content Formatting --- */

/* --- Forms --- */
#importTaxForm, #standaloneFinanceForm, #financeForm {
    margin-top: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px 30px;
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 14px 16px;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    color: #2d3748;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

    /* Mobile select field fixes */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: 'Lato', sans-serif;
    line-height: 1.5;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 10px;
    cursor: pointer;
}

/* Specific adjustments for select elements */
.form-group select {
    padding-right: 35px; /* Make room for custom arrow */
}

/* Remove default arrow on IE/Edge */
.form-group select::-ms-expand {
    display: none;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .form-group input[type="number"],
    .form-group input[type="text"],
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px; /* Slightly larger padding for touch */
        min-height: 48px; /* Ensure consistent height */
        box-sizing: border-box; /* Include padding in width calculation */
    }
    
    .form-group select {
        padding-right: 40px; /* More space for arrow on mobile */
        background-size: 14px 12px; /* Larger arrow for mobile */
        background-position: right 14px center;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .form-group select {
        /* Remove iOS default styling completely */
        -webkit-appearance: none;
        border-radius: 4px; /* Ensure consistent border radius */
    }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .form-group select {
        background-color: #f8f9fa !important; /* Force background color */
        color: #495057 !important; /* Force text color */
    }
}

/* Remove spin buttons */
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="text"][inputmode="numeric"]::-webkit-outer-spin-button,
.form-group input[type="text"][inputmode="numeric"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
    display: none; /* Added for extra safety */
}
.form-group input[type="number"],
.form-group input[type="text"][inputmode="numeric"] {
    -moz-appearance: textfield;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #D90429;
    outline: 0;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(217, 4, 41, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #a0aec0;
}

#importTaxForm .cta-button,
#standaloneFinanceForm .cta-button,
#financeForm .cta-button {
    display: block;
    width: fit-content;
    margin: 25px auto 0;
}

/* Advanced Costs */
.advanced-toggle {
    margin: 20px 0;
    padding-left: 5px;
}
.advanced-toggle label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: #0056b3;
    font-weight: 600;
}
.advanced-toggle label:hover {
    color: #007bff;
}
.advanced-toggle input[type="checkbox"] {
    margin-right: 10px;
    height: 17px;
    width: 17px;
    accent-color: #D90429;
}

.advanced-costs {
    margin-top: 15px;
    padding: 20px;
    background-color: #f1f3f5;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin-bottom: 25px;
}
.advanced-costs h4 {
    margin-bottom: 20px;
    text-align: center;
    color: #495057;
    font-size: 1.1rem;
}
.advanced-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px 25px;
    margin-bottom: 0;
}

/* --- Disclaimers --- */
.disclaimer {
    background-color: #fffbeb; /* Very pale yellow */
    border: 1px solid #ffeeba;   /* Soft yellow border */
    color: #665b3c;           /* Softer, less saturated brown text */
    padding: 12px 15px;
    margin: 25px 0;
    border-radius: 5px;

    /* --- FONT STYLES --- */
    font-family: 'Open Sans', sans-serif; /* Use the new font */
    font-size: 0.75rem;        /* Smaller font */
    line-height: 1.6;          /* Adjust line height */
}
.disclaimer p {
    margin-bottom: 5px;
}
.disclaimer p:last-child {
    margin-bottom: 0;
}
.disclaimer strong {
    font-family: 'Open Sans', sans-serif; /* Ensure strong tag also uses it */
    font-weight: 600;     /* Use semi-bold */
    display: inline;      /* Make it flow with the text */
    margin-bottom: 0;
    color: #856404;       /* Darker brown for the title */
}
/* --- Loading & Error --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #D90429; /* Red spinner */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-overlay p {
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
}

.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    margin: 20px auto;
    border-radius: 5px;
    text-align: center;
    max-width: 800px;
    font-weight: 600;
}


/* --- Result Section Layout --- */
.results-container {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 25px;
    background: -webkit-gradient(linear, left top, right bottom, from(#f8f9fa), to(#e9ecef));
    background: -webkit-linear-gradient(315deg, #f8f9fa 0%, #e9ecef 100%);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 35px;
    border-radius: 12px;
    -webkit-box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    margin-top: 40px;
    overflow: visible;
    width: 100%;
    max-width: 100%;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    position: relative;
}



/* Total Cost Box - Green */
.total-cost-box {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #10b981 100%);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
    color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    margin-bottom: 10px;
}

.total-cost-box h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.95;
    color: #ffffff;
}

.total-cost-box .amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Monthly Payment Box - Red */
.monthly-payment-box {
    background: linear-gradient(135deg, #D90429 0%, #A90321 50%, #D90429 100%);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
    color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(217, 4, 41, 0.3);
    margin-bottom: 10px;
}

.monthly-payment-box h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.95;
    color: #ffffff;
}

.monthly-payment-box .amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Cost Blocks Container */
.cost-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Individual Cost Block */
.cost-block {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-left: 4px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cost-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.cost-block.cif-block { border-left-color: #3b82f6; }
.cost-block.tax-block { border-left-color: #ef4444; }
.cost-block.other-block { border-left-color: #f59e0b; }

.cost-block h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cost-block .block-amount {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.cost-block.cif-block .block-amount { color: #3b82f6; }
.cost-block.tax-block .block-amount { color: #ef4444; }
.cost-block.other-block .block-amount { color: #f59e0b; }

.cost-block .block-details {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.6;
}

.cost-block .detail-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}

.cost-block .detail-item:last-child {
    border-bottom: none;
}

.cost-block .detail-label {
    font-weight: 500;
}

.cost-block .detail-value {
    font-weight: 600;
    color: #1e293b;
}
/* Container for finance options form */
.finance-options-container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 8px;
    margin-top: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.finance-options-container h3 { text-align: center; }

@media (max-width: 576px) {
    .finance-options-container {
        padding: 20px 15px;
        margin-top: 20px;
    }
}


.results-container > .results-main {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    gap: 30px;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
}

.results-container > .results-main > #importCostResults,
.results-container > .results-main > #financeResults {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 280px;
}

.results-container > .results-main > .results-visuals {
    flex: 1;
    min-width: 280px;
    background-color: #ffffff;
    padding: 25px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Result Block Headers */
.results-main h3 {
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    color: #333;
}
.results-visuals h4 { text-align: center; margin-bottom: 20px; color: #444; }

/* Final Cost Styling */
.final-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #D90429;
    text-align: center;
}
.final-value span { display: block; font-size: 1rem; color: #555; font-weight: normal; margin-bottom: 5px; }
.final-cost-import { margin-top: 25px; }

/* Result Table Styling */
.results-table { 
    width: 100%; 
    max-width: 100%;
    margin-bottom: 20px; 
    font-size: 0.95rem; 
    table-layout: fixed;
    -webkit-text-size-adjust: 100%;
}
.results-table td { padding: 12px 5px; border-bottom: 1px solid #e9ecef; }
.results-table tr:last-child td { border-bottom: none; }
.results-table td:last-child { text-align: right; font-weight: bold; color: #333; }
.results-table .total-row td { font-weight: bold; font-size: 1.1rem; padding-top: 12px; color: #1a1a1a; }
.results-table .total-row td:last-child { color: #D90429; }
.results-table .cif-total-row td { font-weight: bold; font-size: 1.1rem; padding-top: 12px; color: #1a1a1a; }
.results-table .cif-total-row td:last-child { color: #3b82f6; }
.results-table .other-total-row td { font-weight: bold; font-size: 1.1rem; padding-top: 12px; color: #1a1a1a; }
.results-table .other-total-row td:last-child { color: #f59e0b; }
.results-table .advanced-cost-row td { color: #555; font-size: 0.9rem; padding-top: 5px; padding-bottom: 5px; }
.results-table .cif-total-row { border-bottom: 3px solid #3b82f6 !important; }
.results-table .section-separator { border-top: 3px solid #ef4444; padding-top: 15px; }
.results-table .section-end { border-bottom: 3px solid #ef4444 !important; padding-bottom: 15px; }
.results-table .advanced-cost-row.section-separator { border-top: 3px solid #f59e0b; }
.results-table .other-total-row.section-end { border-bottom: 3px solid #f59e0b !important; }

/* Chart Containers */
#taxChartContainer, #financeChartContainer { 
    position: relative; 
    width: 100%; 
    max-width: 400px;
    margin: 0 auto;
}
#taxChartContainer { height: 300px; }
#financeChartContainer { height: 300px; }
#taxChart, #financeChart { 
    max-width: 100%;
    height: auto !important;
}

/* --- Slider Styles --- */
.form-group-slider { }
.slider-container { display: flex; align-items: center; gap: 15px; margin-top: 5px; }
input[type="range"] {
    flex-grow: 1; height: 8px; cursor: pointer; background: #e9ecef; border-radius: 5px; appearance: none; -webkit-appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
    appearance: none; -webkit-appearance: none; height: 18px; width: 18px; background: #D90429; border-radius: 50%; cursor: pointer; margin-top: -5px;
}
input[type="range"]::-moz-range-thumb {
    height: 16px; width: 16px; background: #D90429; border-radius: 50%; border: none; cursor: pointer;
}
.slider-value {
    font-weight: 600; color: #333; background-color: #f8f9fa; padding: 5px 10px; border-radius: 4px; border: 1px solid #ced4da; font-size: 0.9rem; min-width: 160px; text-align: center; white-space: nowrap;
}


/* --- Footer --- */
footer {
    background: linear-gradient(180deg, #1a1d23 0%, #0f1115 100%);
    color: #b8bcc4;
    padding: 40px 0 20px 0;
    margin-top: 60px;
    font-size: 0.9rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a,
.social-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b8bcc4;
    text-decoration: none;
    padding: 5px 0;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover,
.social-links a:hover {
    color: #D90429;
    transform: translateX(3px);
    text-decoration: none;
}

.footer-links .icon,
.social-links .icon {
    font-size: 1.1rem;
    width: 18px;
    text-align: center;
}

.social-links .icon svg {
    transition: all 0.3s ease;
    width: 18px;
    height: 18px;
}

.social-links a:hover .icon svg {
    fill: #D90429;
    transform: scale(1.1);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #2a2e35;
    color: #8a8e96;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    footer {
        padding: 20px 0 10px 0;
        margin-top: 30px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        text-align: left;
    }
    
    .footer-section:last-child {
        grid-column: 1 / -1;
    }
    
    .footer-section h4 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .footer-links {
        align-items: flex-start;
        gap: 4px;
    }
    
    .footer-links a {
        font-size: 0.8rem;
        padding: 2px 0;
    }
    
    .social-links {
        flex-direction: row !important;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    .social-links a {
        flex-direction: row;
    }
    
    .social-links a span:last-child {
        display: none;
    }
    
    .social-links .icon svg {
        width: 24px;
        height: 24px;
    }
    
    .footer-bottom {
        padding-top: 10px;
        font-size: 0.75rem;
    }
}


/* --- Hamburger Menu (Mobile Only) --- */
.hamburger-menu {
    display: none; background: none; border: none; cursor: pointer; padding: 10px; margin: 0; order: 4; z-index: 1100;
}
.hamburger-menu span {
    display: block; width: 25px; height: 3px; background-color: #333; margin: 5px 0; transition: all 0.3s ease-in-out;
}
.hamburger-menu.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.side-nav {
    position: fixed; top: 0; right: -280px; width: 280px; max-width: 80%; height: 100%; background-color: #ffffff; box-shadow: -2px 0 5px rgba(0,0,0,0.1); padding: 60px 20px 20px; transition: right 0.3s ease-in-out; z-index: 1050; overflow-y: auto;
}
.side-nav.active { right: 0; }
.side-nav nav { display: flex; flex-direction: column; }
.side-nav a {
    color: #333; padding: 15px 10px; font-size: 1.1rem; font-family: 'Poppins', sans-serif; text-decoration: none; border-bottom: 1px solid #eee; transition: background-color 0.2s ease;
}
.side-nav a:hover { background-color: #f8f8f8; color: #D90429; }
.side-nav a:last-child { border-bottom: none; }


/* --- Overlay --- */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); opacity: 0; visibility: hidden; transition: opacity 0.3s ease-in-out, visibility 0s 0.3s linear; z-index: 1000;
}
.overlay.active { opacity: 1; visibility: visible; transition: opacity 0.3s ease-in-out, visibility 0s 0s linear; }


/* --- Responsive Adjustments --- */

@media (max-width: 992px) {
    /* Stack main results and chart sidebars */
    .results-container { 
        -webkit-box-orient: vertical;
        -webkit-flex-direction: column;
        flex-direction: column; 
    }
    .results-container > .results-main {
        -webkit-box-orient: vertical;
        -webkit-flex-direction: column;
        flex-direction: column;
    }
    .results-container > .results-main > #importCostResults,
    .results-container > .results-main > #financeResults,
    .results-container > .results-main > .results-visuals {
        width: 100%;
        min-width: 100%;
    }
    .results-visuals { 
        margin-top: 20px; 
        max-width: 100%; 
        margin-left: auto; 
        margin-right: auto; 
        order: 1;
        padding: 20px 15px;
    }
    .results-main { order: 0; }
    #taxChartContainer, #financeChartContainer { 
        max-width: 100%; 
        height: 280px;
        width: 100%;
    }
}

/* === MODIFIED Mobile Header Styles (768px and below) === */
@media (max-width: 768px) {
    header { position: fixed; top: 0; left: 0; right: 0; padding: 10px 0; z-index: 1000; }
    body { padding-top: 70px; }
    .header-content { gap: 8px 10px; justify-content: space-between; display: flex; }
    header .logo { order: 1; margin-right: auto; }
    header .logo img { height: 30px; }

    /* Hide Desktop Nav Button & Desktop Tagline */
    .main-nav-desktop, .tagline-desktop { display: none; }

    /* Hide Mobile Tagline */
    .tagline-mobile { display: none; }

    .language-switcher-links { order: 2; gap: 3px; }
    .lang-link { font-size: 0.8rem; padding: 3px 5px; }
    .lang-separator { font-size: 0.8rem; }

    /* Show Hamburger Menu */
    .hamburger-menu { display: block; order: 3; }

    .calculator-hub, .results-container, .finance-partners, .finance-options-container { padding: 20px; }
    .results-main, .results-visuals { min-width: unset; }
}

@media (max-width: 576px) {
     h1 { font-size: 1.8rem; }
     h2 { font-size: 1.5rem; }
     .form-grid { grid-template-columns: 1fr; }
     .partner-grid { grid-template-columns: 1fr; }
     .final-value { font-size: 1.4rem;}
     
     .results-container {
         padding: 15px;
         gap: 15px;
         margin-top: 20px;
     }
     
     .total-cost-box,
     .monthly-payment-box {
         padding: 20px 15px;
     }
     
     .total-cost-box .amount,
     .monthly-payment-box .amount {
         font-size: 1.8rem;
         word-break: break-all;
     }
     
     .cost-blocks {
         grid-template-columns: 1fr;
         gap: 15px;
     }
     
     .cost-block {
         padding: 15px;
     }
     
     .cost-block .block-amount {
         font-size: 1.4rem;
         word-break: break-all;
     }
     
     .results-container {
         padding: 15px 10px;
         border-radius: 8px;
     }
     
     .results-main {
         width: 100%;
     }
     
     #importCostResults {
         width: 100%;
         overflow-x: visible;
     }
     
     .results-table {
         font-size: 0.85rem;
         width: 100%;
         table-layout: auto;
     }
     
     .results-table td {
         padding: 10px 5px;
         font-size: 0.85rem;
         word-wrap: break-word;
         -webkit-hyphens: auto;
         -ms-hyphens: auto;
         hyphens: auto;
         overflow-wrap: break-word;
     }
     
     .results-table td:first-child {
         font-size: 0.8rem;
         width: 60%;
         max-width: 60%;
     }
     
     .results-table td:last-child {
         font-size: 0.85rem;
         width: 40%;
         max-width: 40%;
         text-align: right;
     }
     
     footer {
         padding: 15px 0 8px 0;
         margin-top: 20px;
     }
     
     .footer-content {
         gap: 12px;
     }
     
     .social-links {
         flex-direction: row;
         flex-wrap: nowrap;
         justify-content: space-between;
         gap: 4px;
         width: 100%;
     }
     
     .social-links a {
         flex-direction: column;
         gap: 2px;
         font-size: 0.7rem;
         min-width: 60px;
     }
}

/* --- Sticky Footer Fix --- */
html { 
    height: 100%; 
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
body { 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    position: relative;
}
main.container { flex-grow: 1; }

/* === FLOATING ACTION CTA (FINAL BLINKING BOX) === */
.floating-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    right: 20px;
    bottom: 20px;
    min-width: 140px;
    background-color: #D90429;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 6px 15px rgba(217, 4, 41, 0.6);
    text-align: center;
    text-transform: uppercase;
    z-index: 999;
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: blink-shadow 1.5s infinite ease-in-out;
    overflow: hidden;
    text-decoration: none;
    opacity: 1;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform, opacity;
}

.floating-cta.hidden {
    opacity: 0;
    pointer-events: none;
    -webkit-transform: translateY(20px);
    transform: translateY(20px);
}

.floating-cta::before {
    content: '🚗';
    position: absolute;
    left: -30px;
    top: 50%;
    -webkit-transform: translateY(-50%) scaleX(-1);
    transform: translateY(-50%) scaleX(-1);
    font-size: 1.2rem;
    opacity: 0.7;
    animation: drive 3s infinite linear;
}

@keyframes drive {
    0% { left: -30px; }
    100% { left: calc(100% + 10px); }
}

.floating-cta:hover {
    background-color: #A90321;
    text-decoration: none;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    animation: none;
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
}

@keyframes blink-shadow {
    0% { box-shadow: 0 6px 15px rgba(217, 4, 41, 0.6); }
    50% { box-shadow: 0 0 10px rgba(217, 4, 41, 0.2); }
    100% { box-shadow: 0 6px 15px rgba(217, 4, 41, 0.6); }
}

@media (max-width: 576px) {
    .floating-cta {
        min-width: 110px;
        font-size: 0.75rem;
        padding: 8px 12px;
        right: 10px;
        bottom: 10px;
    }
}

/* Add this CSS rule to your global stylesheet */
.results-table tr.no-bottom-border td {
    border-bottom: none !important; /* Removes the line under the main tax row */
}

/* Ensure the detail row itself has padding and a border on its bottom */
.results-table tr.detail-row td {
    border-top: none; /* Removes the line above the detail row */
    border-bottom: 1px solid #ddd; /* Re-applies the line under the detail section */
    padding-top: 0;
    padding-bottom: 5px;
}

/* --- 1. GUARANTEED FIX: REMOVE LINE UNDER THE PARENT TAX ROW --- */
/* Targets the cell itself in the parent row (CID, SUR, XID, LXT, VEL, COM, VAT) */
.results-table tr.no-bottom-border td {
    border-bottom: none !important; 
}

/* --- 2. GUARANTEED FIX: REMOVE LINE ABOVE THE DETAIL ROW --- */
/* Targets the cell itself in the detail row (which sits immediately under the parent) */
.results-table tr.detail-info-row td {
    border-top: none !important;
    border-bottom: 1px solid #ddd;
    color: #64748b;
    font-weight: 500;
    font-size: 0.9em;
    padding-top: 2px !important;
    padding-bottom: 5px !important;
    vertical-align: top;
    padding-left: 20px !important;
}

/* --- 3. Style for the Info Icon placeholder (Unicode) --- */
.results-table tr.detail-info-row .info-icon {
    content: "\2139"; 
    font-style: normal;
    font-weight: bold;
    color: #007bff;
    margin-right: 5px;
}

/* --- 4. Style for inline detail text (used on CIF, CID, SUR, VAT descriptions) --- */
.results-table .tax-info {
    color: #007bff;
    font-weight: 500;
    font-size: 0.95em;
    margin-left: 5px;
    white-space: nowrap;
}

/* Align label and tooltip perfectly on one line */
.label-with-tooltip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2; /* ensures vertical centering matches */
  vertical-align: middle;
}

.label-with-tooltip label {
  margin: 0;
}

/* Tooltip container */
.tooltip-container {
  position: relative;
  display: inline-block;
}

/* Info icon styling */
.info-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 50%;
  background-color: #7c7979;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  position: relative;
  top: -1px;
  transition: background-color 0.2s;
  /* Safari touch support */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.info-icon:hover,
.info-icon:focus,
.info-icon:active {
  background-color: #a12000;
  outline: none;
}

.tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  max-width: 90vw; /* Responsive width */
  background-color: #333;
  color: #fff;
  text-align: left;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  z-index: 1000;
  transition: opacity 0.3s, visibility 0.3s;
  pointer-events: none;
  /* Safari improvements */
  -webkit-transform: translateX(-50%);
  word-wrap: break-word;
}

.tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* Enhanced hover/touch support for all devices */
.tooltip-container:hover .tooltip-content,
.tooltip-container:focus .tooltip-content,
.tooltip-container:active .tooltip-content {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
  .info-icon {
    width: 20px;
    height: 20px;
    font-size: 13px;
  }
  
  .tooltip-content {
    width: 280px;
    max-width: 85vw;
    font-size: 14px;
    padding: 15px;
    /* On mobile, show tooltip below the icon instead */
    bottom: auto;
    top: 125%;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .tooltip-content::after {
    top: auto;
    bottom: 100%;
    border-color: transparent transparent #333 transparent;
  }
}

/* Safari-specific fixes */
@supports (-webkit-appearance: none) {
  .tooltip-container {
    /* Make the container tappable on Safari */
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  }
  
  .info-icon {
    /* Ensure proper touch handling */
    -webkit-user-select: none;
    user-select: none;
  }
}

/* --- Car Specs & Blog Pages --- */
.content-page {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.search-filter {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

#carSearch,
#makeFilter,
.search-input,
.filter-select {
    width: 100%;
    padding: 12px 14px;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #495057;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: 'Lato', sans-serif;
    line-height: 1.5;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

.filter-select {
    min-width: 150px;
}

#carSearch:focus,
#makeFilter:focus,
.search-input:focus,
.filter-select:focus {
    border-color: #D90429;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(217, 4, 41, 0.25);
}

#carSearch::placeholder,
.search-input::placeholder {
    color: #a0aec0;
}

#makeFilter,
.filter-select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 10px;
    padding-right: 35px;
    cursor: pointer;
}

#makeFilter::-ms-expand,
.filter-select::-ms-expand {
    display: none;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.spec-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.spec-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.spec-image {
    height: 200px;
    overflow: hidden;
}

.spec-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spec-content {
    padding: 20px;
}

.spec-content h3 {
    color: #D90429;
    margin-bottom: 5px;
    font-size: 1.3rem;
}

.spec-year {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.spec-details {
    margin-bottom: 15px;
}

.spec-item {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.spec-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-tag {
    background-color: #f8f9fa;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid #dee2e6;
}

.blog-categories {
    display: flex;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid #D90429;
    background-color: transparent;
    color: #D90429;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.category-btn:hover,
.category-btn.active {
    background-color: #D90429;
    color: #ffffff;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.blog-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.blog-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #D90429;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.blog-content {
    padding: 20px;
}

.blog-content h3 {
    margin-bottom: 10px;
}

.blog-content h3 a {
    color: #1a1a1a;
    text-decoration: none;
}

.blog-content h3 a:hover {
    color: #D90429;
}

.blog-excerpt {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
}

.read-more {
    color: #D90429;
    font-weight: 600;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* --- Guide Page Styles --- */
.content-guide {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.highlight-box {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.highlight-box h4 {
    margin-top: 0;
    color: #D90429;
}

.formula-box {
    background-color: #fce8ec;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.formula-box h4 {
    margin-top: 0;
    color: #D90429;
}

.formula {
    font-size: 1.0em;
    font-weight: 700;
}

.note {
    font-size: 0.9em;
    margin-top: 10px;
}

.guide-list {
    list-style: disc;
    margin-left: 20px;
    font-size: 0.95em;
    margin-bottom: 20px;
}

.cta-section {
    margin-top: 40px;
    padding: 20px;
    border: 2px solid #D90429;
    border-radius: 8px;
    background-color: #fce8ec;
}

.disclaimer-section {
    margin-top: 40px;
    font-size: 0.9em;
    color: #666;
}

.text-center {
    text-align: center;
    margin-top: 20px;
}

.link-bold {
    font-weight: 700;
}

/* --- Breadcrumb Navigation --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #D90429;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #999;
}

/* --- Language Switcher --- */
.language-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.lang-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background-color: #f8f9fa;
    border-color: #D90429;
}

.lang-btn.active {
    background-color: #D90429;
    color: #fff;
    border-color: #D90429;
}
/* --- FAQ Accordion Styles --- */
.faq-container {
    margin-top: 20px;
}

.faq-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-question {
    background-color: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background-color: #e9ecef;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: bold;
    color: #D90429;
    transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
    content: '−';
    transform: rotate(0deg);
}

.faq-answer {
    padding: 20px;
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
}

.faq-answer p {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

.faq-item summary {
    outline: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
