:root {
    --brand: #d6001c;
    --brand-dark: #a80016;
    --brand-soft: #fdecee;
    --ink: #1f2329;
    --ink-soft: #5b6470;
    --line: #e7e9ee;
    --surface: #ffffff;
    --bg: #f3f4f7;
    --green: #1aa34a;
    --green-dark: #15833c;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(17, 24, 39, 0.10);
    --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Archivo', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--ink);
    background: linear-gradient(180deg, #fafafa 0%, var(--bg) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Layout principal ---------- */
.fundo-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 24px 16px 40px;
}

.fundo-box {
    background-color: var(--surface);
    color: var(--ink);
    padding: 24px 22px 28px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 430px;
    border: 1px solid var(--line);
}

.imagemLogo {
    max-width: 170px;
    width: 55%;
    height: auto;
    margin: 4px 0 8px;
}

.resultado {
    width: 100%;
}

.alinhar-esquerda {
    text-align: left;
}

.alinhar-centro {
    text-align: center;
}

/* ---------- Imagem da máquina ---------- */
.maquina {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    margin: 12px 0 4px;
}

/* ---------- Bloco de informações do produto ---------- */
.alinhar-esquerda p {
    margin: 0;
    padding: 12px 2px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    line-height: 1.45;
    color: var(--ink);
}

.alinhar-esquerda p strong {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    letter-spacing: .06em;
    color: var(--brand);
    text-transform: uppercase;
}

#opcionaisList {
    list-style: none;
    padding-left: 0;
}

#opcionaisList li {
    font-size: 14px;
    color: var(--ink-soft);
    padding: 3px 0 3px 18px;
    position: relative;
}

#opcionaisList li::before {
    content: "•";
    color: var(--brand);
    position: absolute;
    left: 4px;
}

/* ---------- Botões de ação ---------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--brand);
    color: #fff;
    border: 1.5px solid var(--brand);
    padding: 14px 18px;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
    margin: 6px 0;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: .02em;
    text-transform: uppercase;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, color .12s ease;
}

.button:hover {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

/* Hierarquia visual: ações secundárias ficam em contorno */
#comprarPecasBtn,
#catalogoButton {
    background-color: #fff;
    color: var(--brand);
}

#comprarPecasBtn:hover,
#catalogoButton:hover {
    background-color: var(--brand-soft);
    color: var(--brand-dark);
}

.button:disabled {
    background-color: #f1f2f4;
    border-color: var(--line);
    color: #aab0ba;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ---------- Modais ---------- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: var(--surface);
    padding: 26px 22px 22px;
    border: 1px solid var(--line);
    width: 90%;
    max-width: 420px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 20px;
    box-shadow: var(--shadow);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-content p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
}

.modal-content .imagemLogo {
    max-width: 130px;
}

.confirmar-modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--green);
    color: #fff;
    border: 1.5px solid var(--green);
    padding: 13px 18px;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
    margin: 6px 0;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    text-transform: uppercase;
    transition: background-color .12s ease, transform .12s ease;
}

.confirmar-modal:hover {
    background-color: var(--green-dark);
    transform: translateY(-1px);
}

.alert-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--ink);
    color: #fff;
    padding: 14px 18px;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
    margin: 8px 0 0;
    border: 1.5px solid var(--ink);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    transition: background-color .12s ease, transform .12s ease;
}

.alert-button:hover {
    background-color: #000;
    transform: translateY(-1px);
}

.modal-content input[type="text"],
.modal-content input[type="email"],
#notaFiscalInput,
#telefoneContatoInput {
    width: 100%;
    padding: 12px 14px;
    margin: 8px 0;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    background: #fafbfc;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="email"]:focus,
#notaFiscalInput:focus,
#telefoneContatoInput:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
    background: #fff;
}

.modal-content label {
    display: block;
    font-size: 13px;
    color: var(--ink-soft);
    margin: 6px 0;
}

.modal-content input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: middle;
    accent-color: var(--brand);
}

.modal-content .terms-link {
    color: var(--brand);
    text-decoration: underline;
    cursor: pointer;
}

.modal-content .terms-link:hover {
    color: var(--brand-dark);
}

.close {
    color: #aab0ba;
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color .12s ease;
}

.close:hover,
.close:focus {
    color: var(--ink);
}

#erroNotaFiscal {
    color: var(--brand);
    font-size: 13px;
    display: none;
    margin-top: 8px;
}

/* ---------- Ícone de status nos alertas ---------- */
.fa-check-circle,
.icon-verde {
    color: var(--green);
}

.fa-rotate-by {
    transform: rotate(45deg);
}

/* ---------- Redes sociais ---------- */
.social-icons-container {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.social-icons-teste {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s ease;
}

.social-icons-teste:hover {
    transform: translateY(-2px) scale(1.08);
}

.social-icons-teste img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ---------- Loading ---------- */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 40px 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 4px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Select (catálogos) ---------- */
select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    box-sizing: border-box;
    margin-bottom: 10px;
    font-family: inherit;
    background: #fff;
}

option {
    font-size: 15px;
}

/* ---------- Responsivo ---------- */
@media screen and (max-width: 480px) {
    .fundo-container {
        padding: 14px 12px 28px;
    }

    .fundo-box {
        padding: 20px 16px 24px;
        border-radius: 20px;
    }

    .button,
    .confirmar-modal,
    .alert-button {
        font-size: 13.5px;
        padding: 14px 14px;
    }
}
