/* ═══════════════════════════════════════
   ARRAIAL DA ESCOLA — style.css
   CSS compartilhado entre todas as páginas
═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Lilita+One&family=Nunito:wght@400;600;700;800&display=swap');

/* ── VARIÁVEIS ── */
:root {
    --primario: #1565C0;      /* azul escuro */
    --primario-hover: #0D47A1;
    --primario-sombra: #0a3270;
    --secundario: #FFD166;    /* amarelo festa */
    --secundario-sombra: #c9a000;
    --destaque: #E63946;      /* vermelho para badges */
    --verde: #2E7D32;
    --bg: #F0F7FF;            /* fundo azul bem suave */
    --bg-card: #FFFFFF;
    --texto: #0D1B2A;
    --texto-suave: #546E7A;
    --borda: #BBDEFB;
    --radius: 16px;
    --radius-lg: 24px;
    --sombra: 0 4px 14px rgba(21, 101, 192, 0.1);
    --sombra-hover: 0 14px 32px rgba(21, 101, 192, 0.18);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg);
    color: var(--texto);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ── BANDEIRINHAS ── */
.bandeirinhas-bar {
    width: 100%;
    height: 24px;
    background: repeating-linear-gradient(
        90deg,
        #E63946 0px,   #E63946 28px,
        #FFD166 28px,  #FFD166 56px,
        #1565C0 56px,  #1565C0 84px,
        #06D6A0 84px,  #06D6A0 112px,
        #7B2D8B 112px, #7B2D8B 140px
    );
    position: relative;
    flex-shrink: 0;
}

.bandeirinhas-bar::after {
    content: '';
    position: absolute;
    bottom: -13px; left: 0;
    width: 100%; height: 26px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 26'%3E%3Cpolygon points='0,0 14,0 7,26' fill='%23E63946'/%3E%3Cpolygon points='28,0 42,0 35,26' fill='%23FFD166'/%3E%3Cpolygon points='56,0 70,0 63,26' fill='%231565C0'/%3E%3Cpolygon points='84,0 98,0 91,26' fill='%2306D6A0'/%3E%3Cpolygon points='112,0 126,0 119,26' fill='%237B2D8B'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 140px 26px;
    pointer-events: none;
}

/* ── HEADER ── */
header {
    background: #fff;
    border-bottom: 3px dashed var(--borda);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 12px rgba(21,101,192,0.08);
    margin-top: 13px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    font-family: 'Lilita One', cursive;
    font-size: 1.5rem;
    color: var(--primario);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--texto);
    padding: 7px 14px;
    border-radius: 50px;
    transition: background 0.2s;
    white-space: nowrap;
}

.nav-links a:hover { background: var(--bg); }

.nav-links .btn-entrar {
    background: var(--primario);
    color: #fff !important;
    border-radius: 50px;
}

.nav-links .btn-entrar:hover { background: var(--primario-hover) !important; }

/* ── BOTÕES ── */
.btn-primary {
    background: var(--primario);
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    padding: 13px 26px;
    border-radius: 50px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 5px 0 var(--primario-sombra);
    display: inline-block;
    line-height: 1;
}

.btn-primary:hover  { transform: translateY(-3px); box-shadow: 0 8px 0 var(--primario-sombra); }
.btn-primary:active { transform: translateY(2px);  box-shadow: 0 2px 0 var(--primario-sombra); }

.btn-secondary {
    background: var(--secundario);
    color: var(--texto);
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    padding: 13px 26px;
    border-radius: 50px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 5px 0 var(--secundario-sombra);
    display: inline-block;
    line-height: 1;
}

.btn-secondary:hover  { transform: translateY(-3px); box-shadow: 0 8px 0 var(--secundario-sombra); }
.btn-secondary:active { transform: translateY(2px);  box-shadow: 0 2px 0 var(--secundario-sombra); }

/* ── HERO ── */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px 56px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-tag {
    display: inline-block;
    background: var(--secundario);
    color: var(--texto);
    font-weight: 800;
    font-size: 0.8rem;
    padding: 5px 16px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    animation: bounce-in 0.5s ease both;
}

.hero h1 {
    font-family: 'Lilita One', cursive;
    font-size: clamp(2.2rem, 4.5vw, 3.6rem);
    line-height: 1.1;
    margin-bottom: 16px;
    animation: slide-up 0.6s ease both 0.1s;
}

.hero h1 em {
    font-style: normal;
    color: var(--primario);
    position: relative;
}

.hero h1 em::after {
    content: '';
    position: absolute;
    bottom: 2px; left: 0;
    width: 100%; height: 7px;
    background: var(--secundario);
    border-radius: 4px;
    z-index: -1;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--texto-suave);
    line-height: 1.7;
    margin-bottom: 28px;
    animation: slide-up 0.6s ease both 0.2s;
}

.hero-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    animation: slide-up 0.6s ease both 0.3s;
}

.hero-visual {
    display: flex;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.hero-scene {
    width: 300px; height: 300px;
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    border-radius: 30% 70% 60% 40% / 50% 40% 60% 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    position: relative;
    box-shadow: 0 20px 50px rgba(21,101,192,0.15);
}

.hero-scene::before {
    content: '⭐';
    position: absolute;
    font-size: 2rem;
    top: 20px; right: 30px;
    animation: spin 5s linear infinite;
}

.hero-scene::after {
    content: '🎶';
    position: absolute;
    font-size: 1.8rem;
    bottom: 28px; left: 20px;
    animation: float 2s ease-in-out infinite reverse;
}

/* ── SEÇÕES ── */
.secao,
.categorias,
.banner-promo {
    max-width: 1200px;
    margin: 0 auto 56px;
    padding: 0 20px;
}

.secao-titulo {
    font-family: 'Lilita One', cursive;
    font-size: 1.7rem;
    margin-bottom: 20px;
    color: var(--texto);
}

.secao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.link-ver-mais {
    font-weight: 700;
    color: var(--primario);
    text-decoration: none;
    font-size: 0.9rem;
}

.link-ver-mais:hover { text-decoration: underline; }

/* ── CATEGORIAS ── */
.cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.cat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--texto);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--sombra);
    border: 2px solid var(--borda);
}

.cat-card:hover { transform: translateY(-5px); box-shadow: var(--sombra-hover); border-color: var(--primario); }

.cat-icon { font-size: 2.4rem; margin-bottom: 8px; display: block; }
.cat-nome { font-weight: 800; font-size: 0.9rem; }
.cat-qtd  { font-size: 0.75rem; color: var(--texto-suave); margin-top: 3px; }

/* ── GRADE DE PRODUTOS ── */
.produtos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.produto-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--sombra);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: var(--texto);
    display: block;
    border: 2px solid transparent;
}

.produto-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-hover);
    border-color: var(--primario);
}

.produto-img {
    width: 100%; aspect-ratio: 1;
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    display: flex; align-items: center; justify-content: center;
    font-size: 4rem;
    position: relative;
}

.produto-badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--destaque); color: #fff;
    font-size: 0.7rem; font-weight: 800;
    padding: 3px 10px; border-radius: 50px;
    text-transform: uppercase;
}

.produto-info { padding: 14px; }
.produto-nome { font-weight: 800; font-size: 0.95rem; margin-bottom: 3px; }
.produto-desc { font-size: 0.82rem; color: var(--texto-suave); margin-bottom: 12px; }

.produto-footer { display: flex; justify-content: space-between; align-items: center; }

.produto-preco {
    font-family: 'Lilita One', cursive;
    font-size: 1.3rem;
    color: var(--primario);
}

.btn-carrinho {
    background: var(--secundario);
    border: none; border-radius: 50%;
    width: 36px; height: 36px;
    font-size: 1rem; cursor: pointer;
    transition: transform 0.2s;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 0 var(--secundario-sombra);
    flex-shrink: 0;
}

.btn-carrinho:hover { transform: scale(1.2) rotate(-10deg); }

/* ── BANNER PROMO ── */
.banner-inner {
    background: linear-gradient(135deg, var(--primario) 0%, #1976D2 100%);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
    border: 3px dashed rgba(255,255,255,0.25);
}

.banner-inner::before {
    content: '🎪';
    position: absolute;
    font-size: 8rem; right: 32px; bottom: -8px; opacity: 0.12;
    pointer-events: none;
}

.banner-texto h2 { font-family: 'Lilita One', cursive; font-size: 1.8rem; color: #fff; margin-bottom: 6px; }
.banner-texto p  { color: rgba(255,255,255,0.85); font-size: 0.95rem; font-weight: 600; }

.banner-inner .btn-primary {
    background: var(--secundario);
    color: var(--texto);
    box-shadow: 0 5px 0 var(--secundario-sombra);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── FOOTER ── */
footer {
    background: var(--texto);
    color: #fff;
    padding: 36px 20px 24px;
    margin-top: 8px;
}

.footer-content {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 16px;
}

.toast-erro {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--destaque);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 14px 28px;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(230,57,70,0.35);
    z-index: 999;
    animation: slide-up 0.3s ease;
}

footer .logo { color: var(--secundario); }

.footer-links { display: flex; gap: 16px; list-style: none; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.55); text-decoration: none; font-size: 0.88rem; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
footer p { color: rgba(255,255,255,0.35); font-size: 0.82rem; }

/* ── ANIMAÇÕES ── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes bounce-in {
    0%   { opacity: 0; transform: scale(0.7); }
    70%  { transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════
   RESPONSIVO — MOBILE FIRST
══════════════════════════════════ */
@media (max-width: 768px) {

    /* Header */
    .nav-container { height: 58px; }
    .logo { font-size: 1.3rem; }
    .nav-links { gap: 2px; }
    .nav-links a { padding: 6px 10px; font-size: 0.82rem; }

    /* Hero */
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 32px 20px 40px;
        gap: 24px;
    }

    .hero-visual { order: -1; }

    .hero-scene { width: 200px; height: 200px; font-size: 5.5rem; }

    .hero h1 { font-size: 2rem; }
    .hero-sub { font-size: 0.95rem; }
    .hero-btns { justify-content: center; }

    .btn-primary,
    .btn-secondary { padding: 12px 22px; font-size: 0.95rem; }

    /* Categorias */
    .cats-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .cat-card { padding: 16px 8px; }
    .cat-icon { font-size: 2rem; }
    .cat-nome { font-size: 0.82rem; }

    /* Produtos */
    .produtos-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .produto-info { padding: 10px; }
    .produto-nome { font-size: 0.88rem; }

    /* Banner */
    .banner-inner { padding: 28px 20px; text-align: center; justify-content: center; }
    .banner-inner::before { display: none; }
    .banner-texto h2 { font-size: 1.4rem; }

    /* Footer */
    .footer-content { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}

@media (max-width: 380px) {
    .cats-grid { grid-template-columns: repeat(2, 1fr); }
    .produtos-grid { grid-template-columns: 1fr; }
}
