/*---------------
  # Theme toggle + dark mode
  ---------------*/

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #485a73;
    transition: color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    color: #a51d21;
    transform: translateY(-1px);
}

.theme-toggle-track {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    width: 58px;
    height: 28px;
    padding: 0 5px;
    border-radius: 999px;
    border: 1px solid #c8d1de;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover .theme-toggle-track {
    border-color: #a51d21;
    background: rgba(165, 29, 33, 0.05);
}

.theme-icon {
    position: relative;
    z-index: 2;
    width: 14px;
    height: 14px;
    justify-self: center;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.theme-icon-sun {
    color: #a51d21;
    opacity: 1;
}

.theme-icon-moon {
    color: #8a97ab;
    opacity: 0.7;
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f3f5f8;
    box-shadow: 0 1px 3px rgba(20, 28, 40, 0.16);
    z-index: 1;
    transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

html[data-theme="dark"] .theme-toggle {
    color: #d5dde8;
}

html[data-theme="dark"] .theme-toggle-track {
    background: #1a2030;
    border-color: #3a4356;
}

html[data-theme="dark"] .theme-toggle:hover .theme-toggle-track {
    border-color: #a51d21;
    background: rgba(165, 29, 33, 0.14);
}

html[data-theme="dark"] .theme-icon-sun {
    color: #8a97ab;
    opacity: 0.7;
}

html[data-theme="dark"] .theme-icon-moon {
    color: #f1f5fb;
    opacity: 1;
}

html[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(30px);
    background: #2a3344;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

#info_bar .info-bar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

#info_bar .theme-toggle::after {
    top: calc(100% + 8px);
}

#info_bar .theme-toggle::before {
    top: calc(100% + 2px);
}

.header-mobile-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    flex-shrink: 0;
    margin-left: auto;
}

#header_page .navbar-brand {
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
}

#header_page #navbar_top {
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
}

@media (max-width: 1199.98px) {
    /* Firefox: keep logo + theme/menu on one row; collapse opens on next row */
    #header_page #navbar_top {
        flex-wrap: wrap;
    }

    #header_page .navbar-brand {
        flex: 1 1 0;
        min-width: 0;
        max-width: calc(100% - 108px);
        margin-right: 0;
    }

    #header_page .header-mobile-controls {
        order: 2;
        margin-left: auto;
    }

    #header_page .navbar-collapse {
        flex-basis: 100%;
        flex-grow: 1;
        order: 3;
        width: 100%;
    }

    #header_page .logo {
        font-size: 22px;
        letter-spacing: 0;
        padding-left: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    #header_page .navbar-brand img {
        max-height: 30px;
        width: auto;
        flex-shrink: 0;
    }
}

.theme-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 7px 12px;
    border-radius: 8px;
    background: #fff;
    color: #1b1b1b;
    border: 1px solid rgba(165, 29, 33, 0.25);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 40;
}

.theme-toggle::before {
    content: "";
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 40;
    filter: drop-shadow(0 -1px 0 rgba(165, 29, 33, 0.18));
}

html[data-theme="dark"] .theme-toggle::after {
    background: #fff;
    color: #12161f;
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.theme-toggle:hover::after,
.theme-toggle:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.theme-toggle:hover::before,
.theme-toggle:focus-visible::before {
    opacity: 1;
}

@media (hover: none) {
    .theme-toggle::after,
    .theme-toggle::before {
        display: none;
    }
}

/*---------------
  # Dark theme
  ---------------*/

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background: #0f131a;
    color: #d7dee8;
}

html[data-theme="dark"] #info_bar {
    background: #151a23;
    border-bottom-color: #2a3140;
}

html[data-theme="dark"] #info_bar .contact-info a,
html[data-theme="dark"] #info_bar .contact-info .info-bar-contact-link,
html[data-theme="dark"] #info_bar .info-bar-privacy-link {
    color: #c5d0df;
}

html[data-theme="dark"] #info_bar .contact-info a:hover,
html[data-theme="dark"] #info_bar .contact-info .info-bar-contact-link:hover,
html[data-theme="dark"] #info_bar .info-bar-privacy-link:hover {
    color: #ff6b6e;
}

html[data-theme="dark"] #header_page {
    background: rgba(18, 22, 31, 0.94);
    border-bottom-color: rgba(48, 56, 72, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .logo {
    color: #e8edf5;
}

html[data-theme="dark"] .nav-menu a:not(.a-privacy):not(.header-cta-link) {
    color: #d7dee8;
}

html[data-theme="dark"] .nav-menu li.active > a:not(.header-cta-link),
html[data-theme="dark"] .nav-menu a:not(.header-cta-link):hover {
    color: #ff6b6e;
}

html[data-theme="dark"] .navbar-light .navbar-toggler {
    border-color: #3a4356;
    background: #1a2030;
}

html[data-theme="dark"] .navbar-light .navbar-toggler-icon {
    filter: invert(1) grayscale(1);
}

html[data-theme="dark"] .section-bg-color {
    background-color: #151a23;
}

html[data-theme="dark"] .why-us .icon-boxes .icon-box {
    background: #1c2230;
    border-color: #323848;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .why-us .icon-boxes .icon-box h4 {
    color: #f1f5fb;
}

html[data-theme="dark"] .why-us .icon-boxes .icon-box p {
    color: #9aa6b8;
}

html[data-theme="dark"] .why-us .icon-boxes .icon-box .icon-wrap {
    background: rgba(165, 29, 33, 0.18);
}

html[data-theme="dark"] .about-us .about-row {
    background: #1c2230;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .about-us .about-copy,
html[data-theme="dark"] .about-us h2,
html[data-theme="dark"] .about-us h3 {
    color: #f1f5fb;
}

html[data-theme="dark"] .about-us p {
    color: #b6c1d1;
}

html[data-theme="dark"] .about-us .about-eyebrow {
    background: rgba(165, 29, 33, 0.2);
    color: #ff8a8c;
}

html[data-theme="dark"] .about-us .about-highlight {
    background: #151a23;
    border-color: #323848;
}

html[data-theme="dark"] .about-us .about-highlight strong {
    color: #ff6b6e;
}

html[data-theme="dark"] .about-us .about-highlight span {
    color: #9aa6b8;
}

html[data-theme="dark"] .section-title h2,
html[data-theme="dark"] .section-title-bg-w h2 {
    color: #f1f5fb;
}

html[data-theme="dark"] .section-title p,
html[data-theme="dark"] .section-title-bg-w p {
    color: #a9b5c7;
}

html[data-theme="dark"] .our-values {
    background: #12171f;
}

html[data-theme="dark"] .our-values .our-values-box,
html[data-theme="dark"] .our-values .our-values-box.white {
    background: #1c2230;
    border-color: #323848;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    color: #d7dee8;
}

html[data-theme="dark"] .our-values .our-values-box h3,
html[data-theme="dark"] .our-values .our-values-box h4 {
    color: #f1f5fb;
}

html[data-theme="dark"] .our-values .our-values-box p {
    color: #9aa6b8;
}

html[data-theme="dark"] .faq-section,
html[data-theme="dark"] #faq {
    background: #151a23;
}

html[data-theme="dark"] .faq-section .faq-item {
    background: #1c2230;
    border-color: #323848;
}

html[data-theme="dark"] .faq-section .faq-item summary {
    color: #f1f5fb;
}

html[data-theme="dark"] .faq-section .faq-item p {
    color: #b6c1d1;
}

html[data-theme="dark"] .contact {
    background: #12171f;
}

html[data-theme="dark"] .contact .info .address,
html[data-theme="dark"] .contact .info .email,
html[data-theme="dark"] .contact .info .phone,
html[data-theme="dark"] .contact .info .work-time {
    background: #1c2230;
    border-color: #323848;
    box-shadow: none;
}

html[data-theme="dark"] .contact .info i {
    background: rgba(165, 29, 33, 0.18);
    color: #ff6b6e;
}

html[data-theme="dark"] .contact .info h4,
html[data-theme="dark"] .contact .info p,
html[data-theme="dark"] .contact .info a {
    color: #d7dee8;
}

html[data-theme="dark"] .contact .contact-form-panel {
    background: #1c2230;
    border-color: #323848;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .contact .contact-privacy-note {
    color: #8b97a8;
}

html[data-theme="dark"] .contact .php-email-form,
html[data-theme="dark"] .contact form {
    background: transparent;
}

html[data-theme="dark"] .contact .form-control {
    background: #151a23;
    border-color: #3a4356;
    color: #e8edf5;
}

html[data-theme="dark"] .contact .form-control::placeholder {
    color: #8b97a8;
}

html[data-theme="dark"] .contact .form-control:focus {
    border-color: #a51d21;
    background: #1a2030;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(165, 29, 33, 0.2);
}

html[data-theme="dark"] .footer-copyright-section,
html[data-theme="dark"] #footer {
    background: #0c1017;
    color: #aeb8c8;
}

html[data-theme="dark"] #footer a,
html[data-theme="dark"] .footer-cookie-btn {
    color: #c5d0df;
}

html[data-theme="dark"] #footer a:hover,
html[data-theme="dark"] .footer-cookie-btn:hover {
    color: #ff6b6e;
}

html[data-theme="dark"] .footer-heading,
html[data-theme="dark"] .footer-brand strong {
    color: #f1f5fb;
}

html[data-theme="dark"] .footer-bottom {
    border-top-color: #2a3140;
    color: #8b97a8;
}

html[data-theme="dark"] .back-to-top {
    background: #a51d21;
}

html[data-theme="dark"] .map-consent-placeholder,
html[data-theme="dark"] #map-consent-placeholder {
    background: #1c2230;
    color: #c5d0df;
    border-color: #323848;
}

html[data-theme="dark"] .nav-menu {
    background: transparent;
}

@media (max-width: 1199.98px) {
    html[data-theme="dark"] .navbar-collapse {
        background: #151a23;
        border: 1px solid #2a3140;
        border-radius: 12px;
        margin-top: 10px;
        padding: 12px;
    }

    html[data-theme="dark"] .nav-menu a.nav-mobile-policy-link {
        color: #c5d0df;
    }
}

/* Already-dark sections stay coherent */
html[data-theme="dark"] .section-bg,
html[data-theme="dark"] .counts-section,
html[data-theme="dark"] .products-services {
    background-color: #12171f;
}
