/* ============================================================
   MAGNUS ARMORY - magnus.css
   Tema único. Troque uma cor no :root e o site todo acompanha.
   ============================================================ */

:root {
    --ma-gold:       #D49C4B;
    --ma-gold-dark:  #b8823a;
    --ma-orange:     #e55a2b;
    --ma-bg:         #222222;
    --ma-bg-dark:    #111111;
    --ma-bg-card:    #333333;
    --ma-bg-card-2:  #2a2a2a;
    --ma-text:       #e0e0e0;
    --ma-text-dim:   #9a9a9a;
    --ma-white:      #ffffff;
    --ma-red:        #dc3545;
    --ma-border:     #555555;

    --ma-radius:     8px;
    --ma-radius-lg:  15px;
    --ma-header-h:   124px;     /* altura reservada p/ o header (estado cheio) */
    --ma-logo-h:     96px;      /* logo no topo da página (casa com as 2 linhas da direita) */
    --ma-logo-h-min: 44px;      /* logo com o header encolhido */
    --ma-maxw:       1200px;

    --ma-font:       'Roboto', 'Segoe UI', Arial, sans-serif;
}

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

body {
    font-family: var(--ma-font);
    line-height: 1.6;
    color: var(--ma-text);
    background-color: var(--ma-bg);
}

/* Reserva o espaço do header fixo (só nas páginas do site, não no admin) */
body.ma-body { padding-top: var(--ma-header-h); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container-custom {
    max-width: var(--ma-maxw);
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--ma-white);
    margin-bottom: 3rem;
}

/* Header -------------------------------------------------- */
.ma-header {
    background: linear-gradient(135deg, var(--ma-bg) 0%, var(--ma-bg-dark) 100%);
    color: var(--ma-white);
    padding: 0.7rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
}

.ma-header .container-custom {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.ma-logo img { height: var(--ma-logo-h); width: auto; transition: height 0.3s ease; }

/* Coluna direita: duas linhas empilhadas, alinhadas à direita */
.ma-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
}

.ma-user-actions { display: flex; gap: 0.55rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.ma-user-actions a {
    color: var(--ma-white);
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--ma-gold);
    border-radius: var(--ma-radius);
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 0.92rem;
}
.ma-user-actions a:hover { background-color: var(--ma-gold); transform: translateY(-2px); }

.ma-cart {
    position: relative;
    background-color: var(--ma-gold);
    color: var(--ma-white) !important;
    padding: 0.4rem 0.85rem;
    border-radius: var(--ma-radius);
    display: flex; align-items: center; gap: 0.5rem;
}
.ma-cart-count {
    position: absolute; top: -8px; right: -8px;
    background-color: var(--ma-red);
    color: var(--ma-white);
    border-radius: 50%;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
}

/* Navegação ----------------------------------------------- */
.ma-nav { width: auto; }
.ma-nav-menu {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    background: rgba(255,255,255,0.05);
    border-radius: var(--ma-radius);
    padding: 0.2rem 0.4rem;
}
.ma-nav-menu a {
    color: var(--ma-white);
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    border-radius: var(--ma-radius);
    transition: all 0.3s;
    display: inline-flex; align-items: center; gap: 0.4rem;
    white-space: nowrap;
}
.ma-nav-menu a:hover { background-color: var(--ma-gold); transform: translateY(-2px); }

/* Dropdown */
.ma-dropdown { position: relative; }
.ma-dropdown-menu {
    display: none;
    position: absolute; top: 100%; right: 0;
    background: var(--ma-bg-card);
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    min-width: 190px; padding: 0.5rem 0;
    list-style: none; z-index: 1100;
    margin-top: 0.4rem;
}
.ma-dropdown.show .ma-dropdown-menu { display: block; }
.ma-dropdown-menu a {
    display: block; padding: 0.6rem 1rem;
    color: var(--ma-text); border-radius: 0;
}
.ma-dropdown-menu a:hover { background-color: var(--ma-gold); color: var(--ma-white); }

/* Header compacto ao rolar: vira barra fina, duas linhas viram uma */
.ma-header.shrink { padding: 0.35rem 0; }
.ma-header.shrink .ma-logo img { height: var(--ma-logo-h-min); }
.ma-header.shrink .ma-header-right {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.9rem;
}

/* Conteúdo de páginas internas (login/cadastro/etc.) ------ */
.ma-page { padding: 3rem 0; }

/* Botões -------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    border: none; border-radius: var(--ma-radius);
    font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s;
    text-align: center;
}
.btn-primary { background-color: var(--ma-gold); color: var(--ma-white); }
.btn-primary:hover { background-color: var(--ma-gold-dark); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--ma-gold); border: 1px solid var(--ma-gold); }
.btn-outline:hover { background-color: var(--ma-gold); color: var(--ma-white); }
.btn-block { width: 100%; }

/* Cards --------------------------------------------------- */
.card {
    background: linear-gradient(135deg, var(--ma-bg) 0%, var(--ma-bg-card) 100%);
    border-radius: var(--ma-radius-lg);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 2px solid transparent;
    transition: all 0.3s;
}
.card:hover {
    transform: translateY(-8px);
    border-color: var(--ma-gold);
    box-shadow: 0 20px 40px rgba(212,156,75,0.2);
}

/* Formulários --------------------------------------------- */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; color: var(--ma-text); font-weight: 500; }
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--ma-bg-dark);
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius);
    color: var(--ma-white);
    font-size: 1rem;
    font-family: var(--ma-font);
}
.form-control:focus {
    outline: none;
    border-color: var(--ma-gold);
    box-shadow: 0 0 0 3px rgba(212,156,75,0.2);
}

/* Mensagens / alertas ------------------------------------- */
.alert { padding: 0.9rem 1.1rem; border-radius: var(--ma-radius); margin-bottom: 1rem; }
.alert-success { background: rgba(40,167,69,0.15); border: 1px solid #28a745; color: #9be3ab; }
.alert-error   { background: rgba(220,53,69,0.15); border: 1px solid var(--ma-red); color: #f3a0a8; }

/* Card de autenticação (login/cadastro) ------------------- */
.auth-wrap { max-width: 440px; margin: 0 auto; }
.auth-card {
    background: var(--ma-bg-card-2);
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius-lg);
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.auth-card h1 { color: var(--ma-white); font-size: 1.8rem; margin-bottom: 1.5rem; text-align: center; }
.auth-card .muted { color: var(--ma-text-dim); text-align: center; margin-top: 1.2rem; }
.auth-card .muted a { color: var(--ma-gold); }

/* Footer -------------------------------------------------- */
.ma-footer { background: var(--ma-bg-dark); color: var(--ma-text); padding: 3rem 0 1.5rem; }
.ma-footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.ma-footer h3 { color: var(--ma-gold); margin-bottom: 1rem; font-size: 1.2rem; }
.ma-footer ul { list-style: none; }
.ma-footer ul li { margin-bottom: 0.5rem; }
.ma-footer a:hover { color: var(--ma-gold); }
.ma-footer-bottom {
    text-align: center; margin-top: 2rem; padding-top: 1.5rem;
    border-top: 1px solid var(--ma-border); color: var(--ma-text-dim);
}

/* Texto corrido com Markdown (Sobre, Contato) ------------- */
.ma-prose { text-align: justify; text-justify: inter-word; hyphens: auto; }
.ma-prose p { margin-bottom: 1.1rem; }

/* Responsivo ---------------------------------------------- */
@media (max-width: 768px) {
    :root { --ma-header-h: 210px; --ma-logo-h: 56px; --ma-logo-h-min: 46px; }
    .ma-header .container-custom { flex-direction: column; gap: 0.6rem; }
    .ma-header-right { align-items: center; }
    .ma-user-actions { justify-content: center; }
    .ma-nav-menu { justify-content: center; }
    .ma-header.shrink .ma-header-right { flex-direction: column; gap: 0.5rem; }
    .section-title { font-size: 1.8rem; }
}
