/* ============================================
   Viafarma - Theme Colors & Elements
   Conteúdo:
     - Utilitários de cor e gradientes
     - Botões e elementos interativos
     - Barra lateral de políticas e componentes legais
     - Experiência de cookies/consentimento
     - Área administrativa (cores)
     - Acessibilidade & impressão (cores)
   ============================================ */

/* Color utilities */
.section--light {
    background-color: #fff;
}

.theme-gradient-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
}

.theme-gradient-soft {
    background: linear-gradient(135deg, rgba(180, 106, 54, 0.12) 0%, rgba(157, 147, 88, 0.08) 100%);
}

.theme-border {
    border-color: rgba(46, 61, 53, 0.1);
}

.theme-text-muted {
    color: rgba(47, 42, 36, 0.72);
}

.section-soft {
    background: linear-gradient(180deg, rgba(244, 240, 234, 0.85) 0%, rgba(249, 248, 246, 1) 100%);
}

.theme-divider {
    width: 5rem;
    height: 0.25rem;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-radius: 9999px;
    margin-left: auto;
    margin-right: auto;
}

.theme-divider--left {
    margin-left: 0;
}

.text-secondary {
    color: var(--color-secondary);
}

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

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

/* Layout-specific accents */
.hero {
    color: #fff;
    background-color: #8C6A3D;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0));
    pointer-events: none;
}

/* Internal page hero/header sections: same subtle grid texture used on home hero */
section.bg-gradient-to-br.from-primary.to-accent {
    position: relative;
    overflow: hidden;
}

section.bg-gradient-to-br.from-primary.to-accent::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

section.bg-gradient-to-br.from-primary.to-accent > * {
    position: relative;
    z-index: 1;
}

section.theme-gradient-primary:not(.hero) {
    position: relative;
    overflow: hidden;
}

section.theme-gradient-primary:not(.hero)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

section.theme-gradient-primary:not(.hero) > * {
    position: relative;
    z-index: 1;
}

.cta-banner--grid-light {
    position: relative;
    overflow: hidden;
}

.cta-banner--grid-light::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(to right, rgba(109, 66, 34, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(109, 66, 34, 0.12) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.cta-banner--grid-light > * {
    position: relative;
    z-index: 1;
}

.hero__description {
    color: rgba(255, 255, 255, 0.85);
}

.panel--accent {
    background: linear-gradient(135deg, rgba(180, 106, 54, 0.95), rgba(140, 106, 61, 0.85));
    border: none;
    box-shadow: 0 28px 60px rgba(140, 106, 61, 0.25);
    color: #fff;
}

.panel--accent .panel__heading {
    color: #fff;
}

.panel--accent .panel__description {
    color: rgba(255, 255, 255, 0.85);
}

.panel--accent .link-highlight {
    color: #fff;
}

.panel--accent .link-highlight:hover {
    color: rgba(255, 255, 255, 0.85);
}

.panel--accent .form-field label {
    color: rgba(255, 255, 255, 0.85);
}

.panel--accent .form-field input,
.panel--accent .form-field select,
.panel--accent .form-field textarea {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
}

.panel--accent .form-field input:focus,
.panel--accent .form-field select:focus,
.panel--accent .form-field textarea:focus {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.panel--accent .form-checkbox {
    accent-color: #fff;
}

.panel--accent ::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

/* 5. BUTTONS & INTERACTIVE ELEMENTS */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 2.5rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: #fff !important;
    font-weight: 600;
    border-radius: 0.875rem;
    box-shadow: 0 12px 30px rgba(180, 106, 54, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(157, 147, 88, 0.32);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 2.5rem;
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: #fff;
    border-radius: 0.875rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-primary);
}

.btn--full {
    width: 100%;
    justify-content: center;
}

.btn--fit {
    width: fit-content;
}

.btn-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 2.5rem;
    background: #ffffff;
    color: var(--color-primary) !important;
    border-radius: 0.875rem;
    font-weight: 600;
    box-shadow: 0 12px 26px rgba(255, 255, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-light:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 30px rgba(255, 255, 255, 0.4);
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 2.2rem;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
    color: #fff !important;
    font-weight: 600;
    border-radius: 0.875rem;
    box-shadow: 0 10px 28px rgba(157, 147, 88, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(157, 147, 88, 0.35);
}

.circle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.circle-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(46, 61, 53, 0.18);
}

.info-card {
    position: relative;
    border-radius: 1.25rem;
    border: 1px solid rgba(46, 61, 53, 0.08);
    background: #fff;
    box-shadow: 0 20px 45px rgba(46, 61, 53, 0.08);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(46, 61, 53, 0.1);
}

.info-card--muted {
    background: rgba(255, 255, 255, 0.9);
}

.info-card--center {
    text-align: center;
}

.info-card__title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(180, 106, 54, 0.15) 0%, rgba(157, 147, 88, 0.2) 100%);
    color: var(--color-primary);
    font-size: 1.5rem;
}

.info-icon--center {
    margin: 0 auto;
}

.info-icon-sm {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    background: rgba(180, 106, 54, 0.12);
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.3rem;
    border-radius: 9999px;
    background: rgba(180, 106, 54, 0.15);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.8rem;
}

.card-shadow {
    box-shadow: 0 15px 35px rgba(46, 61, 53, 0.12);
}

.map-frame {
    border: none;
    width: 100%;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px rgba(46, 61, 53, 0.15);
}

.cookie-banner {
    display: none;
    background: #2e3d35;
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.18);
}

.cookie-banner button {
    border-radius: 0.75rem;
    font-weight: 600;
    border: none;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.5rem, 5vw, 3rem);
}

.grid-three {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(1.5rem, 5vw, 2.5rem);
}

.grid-four {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(1.5rem, 5vw, 2.5rem);
}

/* Custom Scrollbar (Webkit browsers) */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f9fafb;
}

::-webkit-scrollbar-thumb {
    background: #B46A36;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8B4A2A;
}

/* Dark Mode Scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #D3B189;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #B46A36;
}

/* Cookie consent components */
/* 7. COOKIE & CONSENT EXPERIENCE */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    background: #1f2937;
    color: #fff;
    font-size: 0.95rem;
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .cookie-consent {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.cookie-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    background: #F9F8F6;
    color: #2E3D35;
    font-size: 0.95rem;
    padding: 2rem 2.5rem;
    box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.12);
    border-top: 1px solid #D3B189;
    transition: all 0.3s ease;
}

.cookie-btn {
    font-weight: 600;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.cookie-btn.secondary {
    background: #D3B189;
    color: #2E3D35;
}

.cookie-btn.accent {
    background: #9D9358;
    color: #fff;
}

.cookie-btn.secondary:hover {
    background: #B46A36;
    color: #fff;
}

body.no-mobile .nav-desktop {
    display: flex !important;
}

body.no-mobile #mobile-menu-btn,
body.no-mobile #mobile-menu {
    display: none !important;
}

/* Admin area basics */
/* 8. ADMIN AREA */
.admin-page {
    padding: 20px;
    font-family: Arial, sans-serif;
    background: #f9fafb;
}

.admin-page table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.admin-page th,
.admin-page td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    font-size: 0.95rem;
}

.admin-page th {
    background: #f3f4f6;
    font-weight: 600;
    text-align: left;
}

.admin-page tr.unread td {
    background: #fff8e6;
}

.admin-text-muted {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 1rem;
}

.admin-inline-form {
    display: inline-block;
    margin-left: 0.5rem;
}

.admin-button {
    padding: 0.35rem 0.9rem;
    border-radius: 0.375rem;
    border: none;
    background: #B46A36;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.admin-button:hover {
    background: #8C4F28;
}

.admin-input {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.95rem;
    background: #fff;
}

.admin-input--narrow {
    width: 80px;
}

.admin-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.admin-link:hover {
    text-decoration: underline;
}

.admin-message-body {
    white-space: pre-wrap;
    background: #f9f9f9;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    font-size: 0.95rem;
    color: #111827;
}

.admin-logout-link {
    margin-top: 1rem;
}

.admin-login-box {
    max-width: 420px;
    margin: 60px auto;
    padding: 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.admin-alert-error {
    color: #b91c1c;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.status-unread {
    background-color: #fef3c7;
}

.status-read {
    background-color: #f3f4f6;
}

/* 6. POLICY SIDEBAR & LEGAL NAVIGATION */
.policy-sidebar .sidebar-link {
    border: 1px solid transparent;
}

.sidebar-link:not(.active) {
    color: var(--color-text, #2c3e50);
    background-color: transparent;
}

.sidebar-link:not(.active):hover {
    background-color: rgba(180, 106, 54, 0.05);
    border-color: rgba(180, 106, 54, 0.1);
}

.sidebar-link.active {
    background: linear-gradient(135deg, #B46A36 0%, #9D9358 100%);
    color: #fff;
    border-color: #B46A36;
    box-shadow: 0 4px 12px rgba(180, 106, 54, 0.25);
}

.sidebar-link.active i {
    color: #fff;
}

.dark .sidebar-link:not(.active) {
    color: #e5e7eb;
}

.dark .sidebar-link:not(.active):hover {
    background-color: rgba(180, 106, 54, 0.15);
}

@media (max-width: 1024px) {
    .policy-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .policy-sidebar {
        padding: 1rem;
        overflow-x: auto;
        position: sticky;
        top: 5rem;
        z-index: 30;
        margin-bottom: 1.5rem;
    }

    .policy-sidebar nav {
        display: flex;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .sidebar-link {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.75rem 1rem;
    }

    .sidebar-link span {
        font-size: 0.75rem;
    }

    .sidebar-link i {
        margin-right: 0.5rem;
        font-size: 0.875rem;
    }

    .policy-sidebar > div:first-child,
    .policy-sidebar > div:last-child {
        display: none;
    }
}

/* 9. ACCESSIBILITY & PRINT HELPERS */
/* Accessibility: Skip to main content */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
}

.skip-to-main:focus {
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    background: #B46A36;
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 9. ACCESSIBILITY & PRINT HELPERS - Print Styles */
@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}
