/* ==========================================================================
   1. ROOT TOKENS (Variables)
   ========================================================================== */

:root {
    /* Colors */
    --primary: #1f3c72;
    --primary-light: #2192cd;
    --accent: #2192cd;
    --accent-hover: #1a7ba9;
    --primary-rgb: 31, 60, 114;
    --accent-rgb: 33, 146, 205;
    --light-bg: #f7f9fc;
    --gray-light: #f7f9fc;
    --gray-medium: #e6e9f0;
    --gray-dark: #5a6a8a;
    --gray-text: #5a6a8a;
    --text: #333;
    --text-color: #333;
    --white: #FFFFFF;
    --error-color: #FF4D4F;
    --success-color: #52C41A;

    /* Motion tokens */
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --dur-fast: 150ms;
    --dur-med: 220ms;
    --dur-slow: 320ms;

    /* Sizing and Spacing */
    --radius: 10px;
    --border-radius: 10px;
    --radius-card: 16px;
    --gap-sm: 8px;
    --gap-md: 16px;
    --gap-lg: 24px;
    --container-width: 1400px;

    /* Effects */
    --box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 10px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 20px rgba(0,0,0,0.10);
    --transition-speed: 0.6s;
    --button-transform: translateY(-1px);
    --button-shadow-hover: 0 3px 8px rgba(0, 0, 0, 0.1);

    /* Common Animations */
    --cubic-bezier: cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* ==========================================================================
   2. GLOBAL BASE STYLES & TYPOGRAPHY
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', Arial, sans-serif;
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    font-size: 1rem; /* follow html scale */
    font-weight: 400;
}

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 1rem; }
ul { list-style: none; }
a { text-decoration: none; color: inherit; transition: color var(--transition-speed) ease; }
img { max-width: 100%; height: auto; }

/* Headings */
h1, h2, h3, h4, h5, h6 { color: var(--primary); font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; }
h1 { font-size: 10rem; margin-bottom: 1.25rem; }
h2 { font-size: 2.25rem; margin-bottom: 1.75rem; text-align: center; }
h3 { font-size: 1.75rem; margin-bottom: 1.25rem; }
h4 { font-size: 1.35rem; margin-bottom: 1rem; }

/* Generic Buttons & Reveal Logic */
.btn, .slider-btn, button { cursor: pointer; border: none; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Utility Classes */
.abs-pos { position: absolute; }
.is-hidden { display: none !important; }
svg.hidden-svg { position: absolute; }

/* ==========================================================================
   3. NAVIGATION (Navbar, Menu, Search)
   ========================================================================== */

.navbar { position: fixed; top: 0; left: 0; width: 100%; background-color: var(--white); box-shadow: none; z-index: 1000; transition: all var(--transition-speed) ease; }
.navbar.scrolled { padding: 8px 0; background-color: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px); box-shadow: var(--box-shadow); }

.nav-container { display: flex; justify-content: space-between; align-items: center; padding: 18px 30px; max-width: var(--container-width); margin: 0 auto; }
.nav-logo { flex: 0 0 200px; }
.nav-logo img { max-height: 220px; height: auto; width: auto; transition: transform var(--transition-speed) ease; }
.nav-logo img:hover { transform: scale(1.01); }

/* Menu & Dropdowns */
.nav-menu { display: flex; gap: 35px; }
.nav-menu li { position: relative; }
.nav-menu a { color: var(--text); font-weight: 500; font-size: 1.05rem; position: relative; padding: 5px 0; transition: all var(--transition-speed) ease; }
.nav-menu a:hover { color: var(--accent); }
.nav-menu a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0; background-color: var(--accent); transition: width var(--transition-speed) ease; }
.nav-menu a:hover::after { width: 100%; }

.has-dropdown::after { content: "▼"; font-size: 0.7em; margin-left: 5px; vertical-align: middle; transition: transform var(--transition-speed) ease; }
.nav-menu li:hover .has-dropdown::after { transform: rotate(180deg); }

.dropdown-menu {
    position: absolute; top: 100%; left: 0; background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--box-shadow); border-radius: var(--radius); min-width: 220px; opacity: 0; visibility: hidden;
    transform: translateY(10px); transition: all var(--transition-speed) ease; z-index: 100; padding: 8px 0;
}
.dropdown-menu li a { display: block; padding: 10px 16px; color: var(--text); }
.dropdown-menu li a:hover { background-color: rgba(var(--accent-rgb), 0.08); color: var(--accent); }
.nav-menu li:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

/* Navigation Search */
.nav-actions { display: flex; align-items: center; gap: 15px; }
.nav__search-btn { background: none; border: none; cursor: pointer; padding: 10px; height: 100%; display: inline-flex; align-items: center; transition: transform 0.3s ease; margin-right: 4px; }
.nav__search-btn img { height: 20px; width: auto; }
.nav__search-input { width: 0; opacity: 0; border: none; border-bottom: 1px solid #ccc; background: transparent; padding: 8px 0; font-size: 0.95rem; color: var(--text); transition: transform 0.3s ease, width 0.3s ease, opacity 0.3s ease; margin-left: 0; }
.nav__search-input::placeholder { color: #ccc; }
.nav__search-input:focus { outline: none; }
.nav__search-input.active { border-bottom: 1px solid #ccc; width: 200px; opacity: 1; padding-right: 25px; }
.nav__search-btn.active { transform: translateX(-5px); }
.nav__search-close { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; cursor: pointer; opacity: 0; transition: opacity 0.3s ease; display: flex; align-items: center; justify-content: center; color: #666; font-size: 18px; z-index: 10; }
.nav__search-close::before { content: "×"; }
.nav__search-close.active { opacity: 1; }

/* Shop Buttons & Mobile Toggle */
.shop-btn {
    background: var(--accent);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 8px rgba(33, 146, 205, 0.3);
}
.shop-btn::after { content: '→'; font-size: 1.1rem; transition: transform var(--transition-speed) ease; }
.shop-btn:hover { background-color: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(33, 146, 205, 0.4); }
.shop-btn:hover::after { transform: translateX(3px); }

.mobile-menu-toggle {
    display: none; width: 36px; height: 36px; cursor: pointer; padding: 6px; z-index: 1001;
    background-image: url('../assets/icons/menu_blau.svg'); background-size: contain; background-repeat: no-repeat; background-position: center;
}
.mobile-menu-toggle span { display: block; height: 3px; width: 100%; background-color: var(--primary); border-radius: 4px; transition: all var(--transition-speed) ease; }
.mobile-menu-toggle.active { background-image: url('../assets/icons/xblau.svg'); }
.mobile-shop-item { display: none; }

/* ==========================================================================
   4. HERO SECTIONS & SIDEBAR
   ========================================================================== */

.hero-section { position: relative; height: 95vh; min-height: 700px; display: flex; align-items: center; justify-content: center; color: var(--white); overflow: hidden; margin-top: 0; }
.hero-content { position: relative; z-index: 1; text-align: left; max-width: 1400px; width: 100%; margin: 0 auto; padding-left: 30px; display: flex; align-items: center; height: 95vh; animation: fadeInUp 1.5s ease-out; }

.hero-text h1 { font-size: 4.5rem;margin-bottom: 0.5rem;color: var(--white);text-shadow: 0 2px 4px rgba(0,0,0,0.6);letter-spacing: -0.02em; }
.hero-subline {font-size: 1.6rem;margin-bottom: 0;color: var(--white);line-height: 1.5;font-weight: 400;max-width: 800px;margin-left: 0;margin-right: auto;display: inline-block;text-shadow: 0 2px 4px rgba(0,0,0,0.6);}

@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.video-background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }
.video-background video, .video-background img { width: 100%; height: 100%; object-fit: cover; }
.video-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Social Sidebar */
.social-sidebar {
    position: fixed; right: 25px; top: 85%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 8px; z-index: 100;
    background-color: white; padding: 12px; border-radius: 8px;
}
.social-sidebar__icon {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    color: var(--primary); transition: all var(--transition-speed) ease;
}
.social-sidebar__icon:hover { transform: translateY(-2px); color: #00B8D9; }

/* ==========================================================================
   5. FEATURED CONTENT (Intro, FAQ, Newsletter)
   ========================================================================== */

/* Company Introduction */
.company-intro { padding: 8rem 0; background-color: var(--white); }
.section-title { text-align: center; font-size: 2.5rem; font-weight: 700; margin-bottom: 40px; color: var(--primary); }
.section-subtitle { text-align: center; color: var(--gray-text); margin-bottom: 40px; max-width: 800px; margin-left: auto; margin-right: auto; }

/* FAQ Section */
.faq-section { padding: 4rem 0; background-color: var(--accent); }
.faq-title { text-align: center; margin-bottom: 10px; color: var(--white); }
.faq-subtitle { text-align: center; color: var(--white); margin-bottom: 40px; max-width: 800px; margin-left: auto; margin-right: auto; }
.faq-container { display: flex; gap: 40px; }
.faq-list { flex: 0.6; width: 100%; }
.faq-item { margin-bottom: 15px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--box-shadow); }
.faq-question { background-color: var(--white); padding: 15px 20px; font-weight: 500; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-toggle { width: 20px; height: 20px; position: relative; transform: rotate(0deg); transition: transform 0.7s ease; }
.faq-toggle::before, .faq-toggle::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 2px; background-color: var(--gray-dark); transform: translate(-50%, -50%); transition: opacity 0.3s ease, background-color 0.3s ease; }
.faq-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item.active .faq-toggle { transform: rotate(180deg); }
.faq-item.active .faq-toggle::after { opacity: 0; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; background-color: #ffffff }
.faq-answer-content { padding: 0 20px 20px; color: var(--gray-text); }
.faq-image { flex: 1.6; position: sticky; top: 20px; border-radius: var(--radius); overflow: hidden; max-width: 700px; height: auto; align-self: flex-start; display: block; }
.faq-image img { width: 100%; height: auto; display: block; }

/* Newsletter Section */
.newsletter { background: var(--primary); color: #fff; padding: 6rem 0; text-align: center; }
.newsletter-content { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.newsletter h2 { color: var(--white); margin-bottom: 15px; }
.newsletter p { margin-bottom: 30px; color: rgba(255, 255, 255, 0.8); font-size: 1.1rem; }
.newsletter-form { display: flex; max-width: 800px; margin: 0 auto; }
.newsletter-input { flex: 1; padding: 15px 20px; border: none; border-radius: var(--radius) 0 0 var(--radius); font-size: 1.1rem; }

.newsletter-btn {
    padding: 6px 35px; background-color: var(--accent); color: var(--white); border: none; border-radius: 0 var(--radius) var(--radius) 0;
    font-weight: 500; font-size: 0.85rem; cursor: pointer; position: relative; overflow: hidden; transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 8px rgba(33, 146, 205, 0.1);
}
.newsletter-btn:disabled { padding: 6px 35px; font-size: 0.85rem; opacity: 0.8; cursor: not-allowed; }
.newsletter-btn::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent); transform: translateX(-100%); transition: transform 0.8s ease; pointer-events: none; }
.newsletter-btn:hover { background-color: var(--accent); transform: var(--button-transform); box-shadow: var(--button-shadow-hover); }
.newsletter-btn:hover::before { transform: translateX(100%); }

/* Newsletter Steps & Forms */
#newsletter-step2-wrapper { overflow: hidden; max-height: 0; transition: max-height 450ms ease-in-out; display: none; }
#newsletter-step2-wrapper.active { max-height: 1200px; display: block; }
#newsletter-step2 { opacity: 0; transform: scale(0.98); transform-origin: top center; transition: opacity 250ms ease-in-out, transform 250ms ease-in-out; }
#newsletter-step2-wrapper.active #newsletter-step2 { opacity: 1; transform: scale(1); }

.newsletter-btn.slide-out { transform: translateY(120%); opacity: 1; transition: transform 450ms ease-in-out; }
.newsletter-form.slide-out { overflow: hidden; }
.newsletter-form.slide-out .newsletter-input, .newsletter-form.slide-out .newsletter-btn { transform: translateY(120%); transition: transform 450ms ease-in-out; }

.newsletter-form-group { flex: 1; margin-bottom: 16px; }
.newsletter-form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--white); font-size: 1rem; text-align: left; }
.newsletter-form-group input, .newsletter-form-group select, .newsletter-form-group textarea { width: 100%; padding: 12px; border: none; background-color: var(--white); border-radius: var(--border-radius); font-family: 'Inter', sans-serif; font-size: 1rem; }
.newsletter-form-group input:focus, .newsletter-form-group select:focus, .newsletter-form-group textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.newsletter-form-group input.error, .newsletter-form-group select.error, .newsletter-form-group textarea.error { border: 1px solid var(--error-color); }

.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.error-message { color: var(--error-color); font-size: 0.8rem; margin-top: 4px; min-height: 16px; }

.submit-btn {
    background-color: var(--accent); color: var(--white); border: none; padding: 12px 24px; border-radius: var(--border-radius);
    font-weight: 500; cursor: pointer; font-size: 1rem; position: relative; overflow: hidden; transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 8px rgba(33, 146, 205, 0.1);
}
.submit-btn::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent); transform: translateX(-100%); transition: transform 0.8s ease; pointer-events: none; }
.submit-btn:hover { background-color: var(--accent-hover); transform: var(--button-transform); box-shadow: var(--button-shadow-hover); }
.submit-btn:hover::before { transform: translateX(100%); }

/* ==========================================================================
   6. FOOTER
   ========================================================================== */

.footer { background-color: var(--white); color: var(--primary); padding: 4rem 0 1.5rem; }
.footer-content { display: flex; justify-content: space-between; margin-bottom: 3rem; }
.footer-left { flex: 0 0 40%; }
.footer-left .logo { height: 90px; margin-bottom: 20px; }
.footer-left .castrol-logo { height: 72px; margin-top: 8px; display: block; }
.footer-right { flex: 0 0 50%; display: flex; justify-content: space-between; }
.footer-column { flex: 0 0 45%; }
.footer-column h4 { color: var(--primary); margin-bottom: 20px; font-size: 1.2rem; }
.footer-column li, .footer-column p, .footer-column a { margin-bottom: 10px; color: rgba(var(--primary-rgb), 0.8); }
.footer-column a:hover { color: var(--accent); }
.footer .footer-right .footer-column .footer-social a { display: inline-flex; width: 24px; height: 24px; opacity: 0.85; transition: opacity 0.2s ease, transform 0.2s ease; }

/* Business Hours Table */
.footer .hours-table { border-collapse: collapse; font-variant-numeric: tabular-nums; color: rgba(var(--primary-rgb), 0.8); }
.footer .hours-table th { text-align: left; padding: 0 12px 0 0; vertical-align: top; white-space: nowrap; color: var(--primary); font-weight: 700; }
.footer .hours-table td { padding: 0 12px 0 0; }
.footer .hours-table td.from, .footer .hours-table td.to { min-width: 4.5ch; }
.footer .hours-table tr + tr td, .footer .hours-table tr + tr th { padding-top: 4px; }

/* Footer Bottom Bar */
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid rgba(var(--primary-rgb), 0.1); }
.footer-bottom p, .footer-bottom a { color: rgba(var(--primary-rgb), 0.6); font-size: 0.9rem; }
.footer-bottom nav { display: flex; gap: 20px; }
.footer-bottom a:hover { color: var(--accent); }

/* Global Contact Utilities */
a[href^="tel:"] { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); }
a[href^="tel:"]:visited { color: var(--primary); }
a[href^="tel:"]::before {
    content: ""; width: 12px; height: 12px; display: inline-block; background-color: currentColor;
    -webkit-mask-image: url('../assets/icons/telefon.svg'); -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain;
    mask-image: url('../assets/icons/telefon.svg'); mask-repeat: no-repeat; mask-position: center; mask-size: contain; flex: 0 0 auto;
}

/* ==========================================================================
   7. MEDIA QUERIES
   ========================================================================== */

@media (max-width: 1024px) {
    .faq-container { flex-direction: column; }
    .faq-image { display: none; }
}

@media (max-width: 767px) {
    .social-sidebar { display: none; }
}

/* Responsive navbar sizing */
@media (max-width: 1400px) {
    .nav-logo { flex: 0 0 200px; }
    .nav-logo img { max-height: 200px; }
    .nav-menu { gap: 36px; }
    .nav-menu a { font-size: 1.1rem; }
    .nav-actions { gap: 16px; }
}

@media (max-width: 1024px) {
    .nav-container { padding: 20px 24px; }
    .nav-logo { flex: 0 0 160px; }
    .nav-logo img { max-height: 160px; }
    .nav-menu { gap: 28px; }
    .nav-menu a { font-size: 1rem; }
    .nav__search-input.active { width: 180px; }
}

@media (max-width: 767px) {
    .nav-container { padding: 16px 16px; }
    .nav-logo { flex: 0 0 120px; }
    .nav-logo img { max-height: 120px; }
    .nav-menu { gap: 18px; }
    .nav-menu a { font-size: 0.95rem; }
    .shop-btn { padding: 10px 16px; font-size: 0.95rem; }
    .nav__search-input.active { width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .newsletter-form.slide-out .newsletter-input, .newsletter-form.slide-out .newsletter-btn { transition: none; transform: none; }
    #newsletter-step2-wrapper, #newsletter-step2 { transition: none; }
}

/* ==========================================================================
   9. TYPOGRAPHY TWEAKS – SUPERSCRIPTS
   Purpose: Reduce excessive spacing around superscripts like the registered mark (®)
   ========================================================================== */
/* Tighter superscripts (e.g., ®) */
sup {
    display: inline;         /* ensure it behaves as true inline for tighter flow */
    line-height: 1;          /* avoid expanding line box height */
    margin-left: 0;          /* no extra gap before/after */
    font-size: 0.65em;       /* keep small but readable */
    vertical-align: text-top;/* align closer to cap height for compact look */
}
