/* ================================================================
   COMMON.CSS — Shared Header / Footer / Global Reset
   ================================================================
   Layer 1: CSS Variables & Reset
   Layer 2: Header + Navigation + Hero
   Layer 3: Footer
   Layer 4: Shared Components (Language Switcher / Quote Button)
   Layer 5: Responsive (Header / Hero / Nav / Footer)
   ================================================================ */

/* ================================================================
   LAYER 1 — CSS Variables & Reset
   ================================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --color-primary: #060CBA;
    --color-primary-dark: #050A8F;
    --color-accent: #32F08C;
    --color-accent-hover: #32F08C;
    --color-dark: #151F30;
    --color-dark-secondary: #1F313B;
    --color-white: #FDFDFD;
    --color-black: #000000;
    --color-border-light: rgba(255, 255, 255, 0.15);
    --color-border-card: #E8E8E8;
    --color-dot-inactive: #D9D9D9;

    /* Typography */
    --font-primary: 'Montserrat', sans-serif;

    /* Layout */
    --page-margin: 120px;
    --page-width: 1920px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--color-white);
    color: var(--color-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-width: 320px;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.8;
}

/* ---- Section Gutter Helper ---- */
.section-gutter {
    padding-left: var(--page-margin);
    padding-right: var(--page-margin);
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    font-family: var(--font-primary);
    font-size: 24px;
    font-weight: 200;
    text-transform: capitalize;
    color: var(--color-dark-secondary);
    margin-top: 50px;
    margin-bottom: 4px;
}

/* ---- Section Title ---- */
.section-title {
    font-family: var(--font-primary);
    font-size: 48px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-dark-secondary);
    line-height: 100%;
    margin-bottom: 50px;
}

/* ================================================================
   LAYER 2 — Header + Navigation + Hero
   ================================================================ */

/* ---- Header + Hero Wrapper (shared background) ---- */
.header-hero-wrapper {
    position: relative;
    width: 100%;
    background: url('../images/bg_top.jpg') center / cover no-repeat;
    overflow: hidden;
}

/* ---- Header ---- */
.header {
    position: relative;
    width: 100%;
    z-index: 100;
}

.header__top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 70px;
    padding-left: var(--page-margin);
    padding-right: var(--page-margin);
    position: relative;
    border-bottom: 1px solid var(--color-border-light);
}

.header__logo-area {
    display: flex;
    align-items: center;
    gap: 0;
}

.header__logo-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    margin-right: 8px;
}

.header__brand-name {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 0.02px;
    color: var(--color-accent);
    white-space: nowrap;
    line-height: 1;
    text-transform: uppercase;
}

.header__logo-cert {
    height: 43px;
    flex-shrink: 0;
    margin-left: 12px;
}

.header__contact {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.header__phone {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}

/* ---- Mobile Menu Toggle ---- */
.header__menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 200;
    margin-left: auto;
}

.header__menu-toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--color-white);
    transition: all 0.3s ease;
}

.header__menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.header__menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.header__menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Navigation ---- */
.nav {
    width: 100%;
    padding: 42px var(--page-margin) 12px;
}

.nav__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 48px;
    padding: 0;
    flex-wrap: nowrap;
}

.nav__link {
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-white);
    white-space: nowrap;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav__link:hover,
.nav__link--active {
    color: var(--color-accent);
}

/* Dropdown item */
.nav__item--dropdown {
    position: relative;
}

/* Invisible bridge to fill gap between nav link and dropdown */
.nav__item--dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 25px;
    z-index: 99;
}

.nav__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 25px);
    left: 0;
    width: max-content;
    min-width: 263px;
    background: var(--color-white);
    padding: 25px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav__item--dropdown:hover .nav__dropdown,
.nav__item--dropdown:hover::after,
.nav__dropdown:hover {
    display: block;
}

.nav__dropdown-link {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-dark);
    line-height: 2;
    cursor: pointer;
    transition: color 0.3s ease;
    text-transform: capitalize;
}

.nav__dropdown-link:hover {
    color: var(--color-primary);
}

/* ---- Hero Banner ---- */
.hero {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px var(--page-margin) 80px;
}

.hero__title {
    font-family: var(--font-primary);
    font-size: 48px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: 16px;
    max-width: 1574px;
}

.hero__subtitle {
    font-size: 24px;
    font-weight: 300;
    color: var(--color-white);
    margin-bottom: 32px;
    max-width: 872px;
}

/* ================================================================
   LAYER 3 — Footer
   ================================================================ */
.footer {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 50px var(--page-margin) 0;
}

.footer__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0;
    row-gap: 36px;
}

.footer__column {
    flex: 0 0 auto;
    max-width: 100%;
    min-width: 0;
}

.footer__column-title {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-primary);
    color: var(--color-white);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.footer__column-links {
    list-style: none;
}

.footer__column-links li {
    font-size: 16px;
    font-weight: 400;
    color: var(--color-white);
    line-height: 2;
    cursor: pointer;
    transition: opacity 0.3s ease;
    text-transform: capitalize;
}

.footer__column-links li:hover {
    color: var(--color-accent-hover);
}

.footer__bottom {
    margin-top: 40px;
    border-top: 1px solid var(--color-white);
    padding: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer__brand-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.footer__brand-name {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 0.02px;
    color: var(--color-white);
}

.footer__copyright {
    font-size: 18px;
    font-weight: 500;
    color: var(--color-white);
}

/* ================================================================
   LAYER 4 — Shared Components
   ================================================================ */

/* ---- Language Switcher ---- */
.lang-switcher {
    position: relative;
    flex-shrink: 0;
}

.lang-switcher__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
    color: var(--color-white);
}

.lang-switcher__btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lang-switcher__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.lang-switcher__label {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-primary);
    letter-spacing: 0.5px;
    min-width: 22px;
    text-align: left;
}

.lang-switcher__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    list-style: none;
    padding: 8px 0;
    margin: 0;
    min-width: 130px;
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 200;
}

.lang-switcher__dropdown--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-switcher__option {
    display: block;
    width: 100%;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font-primary);
    color: var(--color-dark);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    border: none;
    background: none;
    text-align: left;
}

.lang-switcher__option:hover {
    background: rgba(6, 12, 186, 0.08);
    color: var(--color-primary);
}

.lang-switcher__option--active {
    color: var(--color-primary);
    font-weight: 700;
}

/* ---- Quote Button (nav area) ---- */
.btn-quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: var(--color-dark);
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 500;
    font-variant: all-small-caps;
    width: 185px;
    height: 45px;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-quote:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn-quote:active {
    transform: translateY(0);
}

/* ================================================================
   LAYER 5 — Responsive Design
   ================================================================ */

/* ---- Large Desktop (≤1440px) ---- */
@media (max-width: 1440px) {
    :root {
        --page-margin: 60px;
    }
}

/* ---- Tablet (≤1024px) ---- */
@media (max-width: 1024px) {
    :root {
        --page-margin: 30px;
    }

    /* Hero */
    .hero {
        padding: 40px var(--page-margin) 60px;
    }

    .hero__title {
        font-size: 36px;
    }

    .hero__subtitle {
        font-size: 18px;
    }

    /* Navigation */
    .nav__list {
        gap: 24px;
        overflow-x: auto;
    }

    .nav__link {
        font-size: 14px;
    }

    /* Section title */
    .section-title {
        font-size: 32px;
    }

    .breadcrumb {
        font-size: 18px;
    }

    /* Footer */
    .footer__grid {
        justify-content: flex-start;
        gap: 40px;
        row-gap: 30px;
    }

    .footer__column {
        flex: 0 0 auto;
    }
}

/* ---- Mobile (≤768px) ---- */
@media (max-width: 768px) {
    :root {
        --page-margin: 16px;
    }

    /* Header top bar */
    .header__top {
        height: auto;
        padding-top: 8px;
        padding-bottom: 8px;
        flex-wrap: wrap;
    }

    .header__brand-name {
        font-size: 18px;
    }

    .header__logo-icon {
        width: 30px;
        height: 30px;
    }

    .header__logo-cert {
        height: 30px;
    }

    .header__contact {
        display: none;
    }

    .header__menu-toggle {
        display: flex;
    }

    /* Mobile nav overlay */
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(6, 12, 186, 0.98);
        display: flex;
        align-items: center;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.4s ease;
        z-index: 150;
        padding: 0;
        border-bottom: none;
    }

    .nav.active {
        transform: translateX(0);
    }

    .nav__row {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .nav__list {
        flex-direction: column;
        align-items: center;
        gap: 24px;
        padding: 40px 20px;
    }

    .nav__link {
        font-size: 18px;
    }

    /* Mobile: dropdown as inline flow */
    .nav__dropdown {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        padding: 12px 0;
        margin-top: 12px;
        border-radius: 8px;
        text-align: center;
    }

    .nav__item--dropdown:hover .nav__dropdown,
    .nav__dropdown:hover {
        display: none;
    }

    .nav__dropdown-link {
        font-size: 16px;
        color: var(--color-white);
        line-height: 2.4;
        padding: 4px 20px;
    }

    .nav__dropdown-link:hover {
        color: var(--color-accent);
    }

    .nav__item--dropdown::after {
        display: none;
    }

    .nav__item--dropdown.dropdown--open .nav__dropdown {
        display: block;
    }

    .btn-quote {
        margin-bottom: 20px;
    }

    /* Hero */
    .hero {
        padding: 30px var(--page-margin) 50px;
    }

    .hero__title {
        font-size: 24px;
    }

    .hero__subtitle {
        font-size: 14px;
    }

    .btn-quote {
        font-size: 16px;
        width: auto;
        padding: 10px 30px;
        height: auto;
    }

    /* Section title */
    .section-title {
        font-size: 24px;
    }

    .breadcrumb {
        font-size: 16px;
    }

    /* Footer */
    .footer {
        padding-top: 40px;
    }

    .footer__grid {
        justify-content: flex-start;
        gap: 24px;
        row-gap: 24px;
    }

    .footer__column {
        flex: 0 0 calc(50% - 12px);
    }

    .footer__column-title {
        font-size: 16px;
    }

    .footer__column-links li {
        font-size: 14px;
        line-height: 1.8;
    }

    .footer__bottom {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .footer__brand-name {
        font-size: 22px;
    }

    .footer__copyright {
        font-size: 14px;
    }
}

/* ---- Small Mobile (≤480px) ---- */
@media (max-width: 480px) {
    .hero__title {
        font-size: 20px;
    }

    .section-title {
        font-size: 20px;
    }

    .footer__grid {
        justify-content: flex-start;
        gap: 16px;
        row-gap: 16px;
    }

    .footer__column {
        flex: 0 0 calc(50% - 8px);
    }
}

/* ================================================================
   LAYER 6 — Back to Top Button
   ================================================================ */

.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background-color: var(--color-primary, #32F08C);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(6, 12, 186, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.25s ease, box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.back-to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--color-primary-dark, #32F08C);
    box-shadow: 0 6px 24px rgba(6, 12, 186, 0.45);
    transform: translateY(-2px);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--color-accent, #32F08C);
    outline-offset: 3px;
}

.back-to-top:active {
    transform: scale(0.92);
    transition: transform 0.1s ease;
}

/* Arrow icon (pure CSS) */
.back-to-top__icon {
    display: block;
    width: 16px;
    height: 16px;
    border-left: 2.5px solid #fff;
    border-top: 2.5px solid #fff;
    transform: rotate(45deg) translate(2px, 2px);
    transition: transform 0.25s ease;
}

.back-to-top:hover .back-to-top__icon {
    transform: rotate(45deg) translate(0px, 0px);
}

/* Desktop large screens — slightly larger button */
@media (min-width: 1440px) {
    .back-to-top {
        bottom: 40px;
        right: 40px;
        width: 52px;
        height: 52px;
    }

    .back-to-top__icon {
        width: 18px;
        height: 18px;
        border-width: 3px;
    }
}

/* Tablet / Small screens — keep reasonable size and safe margins */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 16px;
        width: 44px;
        height: 44px;
        box-shadow: 0 3px 12px rgba(6, 12, 186, 0.25);
    }

    .back-to-top__icon {
        width: 14px;
        height: 14px;
    }

    .back-to-top:hover {
        transform: translateY(-1px);
    }
}

/* Ensure button doesn't overlap with any fixed bottom bars */
@media (max-width: 480px) {
    .back-to-top {
        bottom: 16px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .back-to-top__icon {
        width: 12px;
        height: 12px;
        border-width: 2px;
    }
}
