/* ==========================================================================
   Primatech — Base compartilhada (site + aplicativos)
   Reset, tipografia, botões, navbar com submenus (sem JS) e rodapé.
   Carregado via includes/head.php, depois de variables.css.
   ========================================================================== */

/* ===================================
   RESET & BASE
   =================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: var(--navbar-height);
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-surface);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--color-text);
}

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

ul {
    list-style: none;
}

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

button {
    font-family: inherit;
    cursor: pointer;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
}

/* Skip link (acessibilidade) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ===================================
   BOTÕES
   =================================== */

.btn-primary,
.btn-secondary,
.btn-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 152, 0, 0.35);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-2px);
}

.btn-light {
    background: #fff;
    color: var(--color-primary);
}

.btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-light:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
}

/* ===================================
   NAVBAR (somente HTML/CSS)
   =================================== */

.navbar-main {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.navbar-logo a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-logo img {
    width: 40px;
    height: 40px;
}

.navbar-logo span {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-links > li > a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 999px;
    color: var(--color-text);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s ease, background 0.2s ease;
}

.navbar-links > li > a:hover,
.navbar-links > li > a:focus-visible,
.has-submenu:hover > a {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* Checkbox do menu mobile: invisível, mas acessível por teclado */
.nav-toggle-check {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
    cursor: pointer;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background: var(--color-text);
    border-radius: 2px;
    transition: 0.3s;
}

.nav-toggle-check:focus-visible ~ .navbar-toggle {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Submenus */
.has-submenu {
    position: relative;
    padding: 14px 0;
}

.submenu-trigger i {
    font-size: 11px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.has-submenu:hover .submenu-trigger i,
.has-submenu:focus-within .submenu-trigger i {
    transform: rotate(180deg);
}

.navbar-submenu {
    position: absolute;
    top: 100%;
    left: -16px;
    min-width: 300px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 999;
}

.has-submenu:hover .navbar-submenu,
.has-submenu:focus-within .navbar-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar-submenu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.navbar-submenu a:hover,
.navbar-submenu a:focus-visible {
    background: var(--color-primary-light);
}

.submenu-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.submenu-text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.submenu-text strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
}

.submenu-text small {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ===================================
   RODAPÉ
   =================================== */

.footer-main {
    background: var(--color-dark);
    color: #fff;
    padding: 60px 5% 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    max-width: var(--container);
    margin: 0 auto;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-brand .footer-logo img {
    width: 36px;
    height: 36px;
}

.footer-brand .footer-logo span {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
}

.footer-brand p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 20px;
    max-width: 340px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.footer-social a:hover {
    background: var(--color-primary);
}

.footer-col h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 20px;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    max-width: var(--container);
    margin: 0 auto;
    padding-top: 24px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* ===================================
   RESPONSIVO
   =================================== */

@media (max-width: 767px) {
    :root {
        --navbar-height: 60px;
    }

    .navbar-logo span {
        font-size: 20px;
    }

    .navbar-logo img {
        width: 34px;
        height: 34px;
    }

    .navbar-toggle {
        display: flex;
    }

    .navbar-links {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--navbar-height));
        overflow-y: auto;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 20px 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }

    .nav-toggle-check:checked ~ .navbar-links {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle-check:checked ~ .navbar-toggle span:nth-child(1) {
        transform: rotate(45deg) translateY(8px);
    }

    .nav-toggle-check:checked ~ .navbar-toggle span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle-check:checked ~ .navbar-toggle span:nth-child(3) {
        transform: rotate(-45deg) translateY(-8px);
    }

    .navbar-links > li {
        border-bottom: 1px solid var(--color-border);
    }

    .navbar-links > li:last-child {
        border-bottom: none;
    }

    .navbar-links > li > a {
        display: flex;
        padding: 14px 8px;
        border-radius: var(--radius-sm);
    }

    .submenu-trigger i {
        display: none;
    }

    .has-submenu {
        padding: 0;
    }

    .navbar-submenu {
        position: static;
        min-width: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 8px 8px;
    }

    .navbar-submenu a {
        padding: 8px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .navbar-links {
        gap: 2px;
    }

    .navbar-links > li > a {
        padding: 8px 10px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
