/* =========================================================
   LAYOUT GLOBAL

   01. Variáveis
   02. Reset e estrutura da página
   03. Utilitários
   04. Hero compartilhado
   05. Tipografia
   06. Responsividade
   07. Acessibilidade
   ========================================================= */

/* =========================================================
   01. VARIÁVEIS
   ========================================================= */

:root {
    /* Marca */
    --alliance-yellow: #ffd21e;
    --alliance-yellow-hover: #f5c400;
    --alliance-yellow-dark: #9a7100;
    --alliance-yellow-soft: #fff8d8;
    --alliance-yellow-tint: #fffbea;
    --alliance-graphite: #292a2d;
    --alliance-black: #151515;

    /* Texto */
    --text-primary: #202124;
    --text-secondary: #64666a;
    --text-light: #8a8d91;
    --text-on-dark: #c5c5c5;

    /* Fundos */
    --white: #ffffff;
    --background: #ffffff;
    --background-soft: #f6f7f7;
    --background-gray: #ecedee;

    /* Bordas */
    --border: #e1e2e3;
    --border-light: #eeeeee;
    --border-dark: #c9cacb;
    --border-hover: #999a9c;

    /* Estados */
    --success: #17803d;
    --danger: #c62828;
    --disabled-bg: #d3d3d3;
    --disabled-text: #898989;

    /* Raios */
    --radius-small: 7px;
    --radius-medium: 10px;
    --radius: 12px;
    --radius-large: 18px;

    /* Sombras */
    --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.13);
    --shadow-button: 0 8px 18px rgba(0, 0, 0, 0.15);
    --shadow-dropdown: 0 16px 40px rgba(0, 0, 0, 0.15);
    --shadow-modal: 0 30px 90px rgba(0, 0, 0, 0.4);
    --focus-ring: 0 0 0 4px rgba(255, 210, 30, 0.2);

    /* Layout e camadas */
    --container-width: 1200px;
    --z-dropdown: 500;
    --z-header: 1000;
    --z-modal: 2000;
    --transition: 0.22s ease;
}

/* =========================================================
   02. RESET E ESTRUTURA
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text-primary);
    background: var(--background);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1 0 auto;
    min-width: 0;
}

img,
svg {
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

/*
   Não escondemos body.loading: se layout.js ou o carregamento
   dos componentes falhar, o conteúdo principal continua visível.
   Pode ocorrer uma breve mudança de idioma durante a inicialização,
   mas não uma tela permanentemente em branco.
*/

body.modal-open {
    overflow: hidden;
}

/* =========================================================
   03. UTILITÁRIOS
   ========================================================= */

.container {
    width: min(calc(100% - 48px), var(--container-width));
    margin-inline: auto;
}

.hidden {
    display: none !important;
}

/* Fundo decorativo compartilhado por catálogo, Sobre e Contato. */
.technical-background {
    --technical-background-opacity: 0.5;
    --technical-background-size: 1920px 900px;

    position: relative;
    isolation: isolate;
    background-color: var(--background);
}

.technical-background::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: url("../images/bg.svg");
    background-position: top center;
    background-repeat: repeat-y;
    background-size: var(--technical-background-size);
    opacity: var(--technical-background-opacity);
    pointer-events: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(var(--fade-distance, 4px));
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   04. HERO COMPARTILHADO
   ========================================================= */

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        118deg,
        #f1f2f2 0%,
        #fafafa 48%,
        #ffffff 100%
    );
    border-bottom: 1px solid var(--border);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.hero::before {
    top: -380px;
    right: -300px;
    width: 600px;
    height: 600px;
    background: var(--alliance-yellow);
    transform: rotate(29deg);
}

.hero::after {
    right: 85px;
    bottom: -470px;
    width: 300px;
    height: 520px;
    background: var(--alliance-graphite);
    opacity: 0.08;
    transform: rotate(29deg);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-height: 220px;
    padding-block: 30px;
}

.hero-text,
.hero h1 {
    max-width: 1200px;
}

.hero .eyebrow {
    position: relative;
    padding-left: 38px;
    color: var(--alliance-graphite);
}

.hero .eyebrow::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 28px;
    height: 4px;
    background: var(--alliance-yellow);
    transform: translateY(-50%);
}

.hero h1 {
    margin-bottom: 22px;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -2px;
    overflow-wrap: anywhere;
}

.hero p {
    max-width: 1000px;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1.65;
}

/* =========================================================
   05. TIPOGRAFIA COMPARTILHADA
   ========================================================= */

.hero h1,
.section-heading h2,
.search-content-header h3,
.results-header h2,
.image-modal-header h2,
.part-details h3 {
    color: var(--alliance-graphite);
    font-weight: 800;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 13px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.2px;
}

/* =========================================================
   06. RESPONSIVIDADE GLOBAL
   ========================================================= */

@media (max-width: 700px) {
    html {
        scroll-padding-top: 82px;
    }

    .container {
        width: min(calc(100% - 30px), var(--container-width));
    }

    .hero-content {
        min-height: 250px;
        padding-block: 38px;
    }

    .hero::before {
        top: -245px;
        right: -185px;
        width: 350px;
        height: 350px;
    }

    .hero::after {
        right: 0;
        bottom: -370px;
    }

    .hero h1 {
        font-size: clamp(30px, 8vw, 40px);
        letter-spacing: -1px;
    }

    .hero p {
        font-size: 16px;
    }

    .technical-background {
        --technical-background-size: 1100px auto;
    }
}

/* =========================================================
   07. ACESSIBILIDADE
   ========================================================= */

:focus-visible {
    outline: 3px solid var(--alliance-yellow-hover);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}