/* =========================================================
   SONHO DIVINO — CSS Principal
   Estética: Gelateria Italiana Tropical
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Nunito:wght@400;600;700;800&display=swap');

/* ── Variáveis ──────────────────────────────────────────── */
:root {
  --coral:    #FF6B6B;
  --peach:    #FFA07A;
  --cream:    #FFF8F0;
  --vanilla:  #FFF3E0;
  --mint:     #4ECDC4;
  --choco:    #5C3317;
  --pink:     #FFB3C6;
  --yellow:   #FFD166;
  --dark:     #2D2D2D;
  --text:     #444444;
  --muted:    #888888;
  --white:    #FFFFFF;
  --shadow:   0 8px 32px rgba(255,107,107,0.12);
  --shadow-lg:0 16px 48px rgba(255,107,107,0.18);
  --radius:   20px;
  --radius-sm:12px;
}

/* ── Reset & Base ───────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--cream);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

body::before {
  content: '🍦🍧🍨🍡🍦🍧🍨🍦🍡🍧';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  font-size: 2.5rem;
  line-height: 4rem;
  letter-spacing: 3rem;
  word-spacing: 3rem;
  opacity: 0.04;
  pointer-events: none;
  z-index: -1;
  white-space: pre-wrap;
  overflow: hidden;
  transform: rotate(-15deg) scale(1.3);
  user-select: none;
}

header, main, footer { position: relative; z-index: 1; }

/* ── Banner Topo ────────────────────────────────────────── */
.banner-topo {
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  border-bottom: 4px solid var(--coral);
  box-shadow: 0 4px 20px rgba(255,107,107,0.15);
  background: var(--vanilla);
  display: block;
}

.banner-topo img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  background: linear-gradient(135deg, var(--coral) 0%, var(--peach) 100%) !important;
  border-bottom: none !important;
  box-shadow: 0 4px 24px rgba(255,107,107,0.3);
  padding: 0.75rem 0;
}

.navbar-brand {
  font-family: 'Pacifico', cursive !important;
  font-size: 1.6rem !important;
  letter-spacing: 0.5px;
  text-shadow: 1px 2px 4px rgba(0,0,0,0.15);
}

.nav-link { font-size: 1rem !important; font-weight: 700; transition: opacity 0.2s; }
.nav-link:hover { opacity: 0.8; }

.navbar .form-control {
  border-radius: 50px !important;
  border: none !important;
  padding: 0.5rem 1.2rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.08);
}
.navbar .form-control:focus { box-shadow: 0 0 0 3px rgba(255,255,255,0.4) !important; }

.navbar .btn-warning {
  border-radius: 50px !important;
  background: var(--yellow) !important;
  border: none !important;
  font-weight: 800;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}
.navbar .btn-warning:hover { transform: scale(1.05); }

.navbar .btn-light {
  background: rgba(255,255,255,0.95) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.navbar .btn-light:hover { transform: scale(1.1); }

/* ── Hero section ─────────────────────────────────────── */
.hero-section { text-align: center; padding: 2rem 1rem 1rem; }

.hero-section h1 {
  font-family: 'Pacifico', cursive;
  font-size: 3rem;
  color: var(--coral);
  text-shadow: 2px 3px 0 rgba(255,107,107,0.15);
  margin-bottom: 0.5rem;
}

.hero-section p { font-size: 1.15rem; color: var(--muted); font-weight: 600; }
.wave-divider { width: 100%; line-height: 0; margin-bottom: -2px; }

/* ── Cards de Produtos ──────────────────────────────────── */
.product-card {
  background: var(--white);
  border: none !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.product-card:hover { transform: translateY(-8px) rotate(0.5deg); box-shadow: var(--shadow-lg); }

.product-card::before {
  content: '';
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--coral), var(--yellow), var(--mint));
  position: absolute;
  top: 0; left: 0; right: 0;
}

.product-card .card-img-top {
  height: 180px;
  object-fit: cover;
  transition: transform 0.4s ease;
  margin-top: 5px;
}

.product-card:hover .card-img-top { transform: scale(1.05); }
.product-card .card-body { padding: 1.2rem 1.2rem 1rem; }

.product-card .card-title {
  font-size: 1rem !important;
  font-weight: 800 !important;
  color: var(--dark) !important;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.product-card .price-tag {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--coral);
}

.product-card .card-text { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

.btn-add {
  background: linear-gradient(135deg, var(--coral) 0%, var(--peach) 100%);
  color: white !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 0.5rem 1rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(255,107,107,0.35);
  width: 100%;
}
.btn-add:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,107,107,0.5); color: white !important; }
.btn-add:active { transform: scale(0.97); }

/* ── Página vazia ──────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state .icon { font-size: 5rem; margin-bottom: 1rem; }
.empty-state h4 { font-family: 'Pacifico', cursive; color: var(--coral); }

/* ── Botões gerais ─────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--coral), var(--peach)) !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(255,107,107,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,107,107,0.45); }

.btn-success { background: linear-gradient(135deg, #06d6a0, #1b9aaa) !important; border: none !important; font-weight: 700; }

h2.page-title { font-family: 'Pacifico', cursive; color: var(--coral); }

.card { border-radius: var(--radius) !important; border: none !important; box-shadow: var(--shadow); }

/* ── Footer ────────────────────────────────────────────── */
footer {
  background: linear-gradient(135deg, #2D2D2D 0%, #1a1a1a 100%) !important;
  border-top: 5px solid var(--coral) !important;
  padding: 3rem 0 1.5rem;
  color: #ccc !important;
  margin-top: 4rem;
}

footer .brand-name { font-family: 'Pacifico', cursive; font-size: 1.8rem; color: var(--coral) !important; }
footer a.text-light:hover { color: var(--yellow) !important; }
footer .fab { transition: transform 0.3s, color 0.3s; color: #aaa; }
footer .fab:hover { transform: scale(1.3) rotate(-5deg); color: var(--coral) !important; }
footer hr { border-color: rgba(255,255,255,0.1) !important; }
footer .copyright { font-size: 0.9rem; color: #666; }

/* ── Login / Cadastro ──────────────────────────────────── */
body.login-page {
  background: linear-gradient(135deg, var(--vanilla) 0%, var(--pink) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-container { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }

.login-card {
  margin: 0 !important;
  width: 100%;
  max-width: 420px;
  border-radius: 28px !important;
  box-shadow: 0 20px 60px rgba(255,107,107,0.2) !important;
  overflow: hidden;
}

.login-card .card-header-custom {
  background: linear-gradient(135deg, var(--coral), var(--peach));
  padding: 2rem;
  text-align: center;
  color: white;
}

.login-card .card-header-custom h3 {
  font-family: 'Pacifico', cursive;
  font-size: 1.8rem;
  margin: 0;
  text-shadow: 1px 2px 4px rgba(0,0,0,0.15);
}

.form-control-lg {
  border-radius: var(--radius-sm) !important;
  border: 2px solid #eee !important;
  padding: 0.75rem 1rem !important;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  transition: border-color 0.2s;
}
.form-control-lg:focus { border-color: var(--coral) !important; box-shadow: 0 0 0 3px rgba(255,107,107,0.12) !important; }

.btn-login {
  background: linear-gradient(135deg, var(--coral), var(--peach)) !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 0.75rem !important;
  font-weight: 800 !important;
  font-size: 1.05rem;
  box-shadow: 0 6px 20px rgba(255,107,107,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,107,107,0.5); }

/* ── Tabelas ───────────────────────────────────────────── */
.table { font-family: 'Nunito', sans-serif; }
.table thead th { background: linear-gradient(135deg, var(--coral), var(--peach)); color: white; font-weight: 800; border: none; }

/* ── Badges de status ──────────────────────────────────── */
.badge-status { border-radius: 50px; padding: 0.4em 0.9em; font-weight: 700; font-size: 0.8rem; }
.status-pendente   { background: #FFF3CD; color: #856404; }
.status-preparando { background: #D1ECF1; color: #0C5460; }
.status-entregue   { background: #D4EDDA; color: #155724; }
.status-cancelado  { background: #F8D7DA; color: #721C24; }
.status-aguardando { background: #E2E3E5; color: #383D41; }

/* ── Animações ─────────────────────────────────────────── */
@keyframes floatUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-card { animation: floatUp 0.5s ease both; }
.col:nth-child(1) .product-card { animation-delay: 0.05s; }
.col:nth-child(2) .product-card { animation-delay: 0.10s; }
.col:nth-child(3) .product-card { animation-delay: 0.15s; }
.col:nth-child(4) .product-card { animation-delay: 0.20s; }
.col:nth-child(5) .product-card { animation-delay: 0.25s; }
.col:nth-child(6) .product-card { animation-delay: 0.30s; }
.col:nth-child(7) .product-card { animation-delay: 0.35s; }
.col:nth-child(8) .product-card { animation-delay: 0.40s; }

/* =========================================================
   HERO BANNER
   ========================================================= */

.hero-banner {
  position: relative;
  background: linear-gradient(135deg, #FFF0D6 0%, #FFE4E1 40%, #E8F4FD 100%);
  padding: 2.5rem 0 0;
  overflow: hidden;
}

.hero-banner__bg::before,
.hero-banner__bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  pointer-events: none;
}
.hero-banner__bg::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--coral), transparent);
  top: -150px; right: -100px;
}
.hero-banner__bg::after {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--mint), transparent);
  bottom: 0; left: -80px;
}

.hero-banner__content { position: relative; z-index: 2; padding-bottom: 2rem; }

.hero-badge {
  display: inline-block;
  background: rgba(255,107,107,0.12);
  color: var(--coral);
  border: 1.5px solid rgba(255,107,107,0.3);
  border-radius: 50px;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero-title { font-family: 'Pacifico', cursive; font-size: 3.2rem; color: var(--dark); line-height: 1.2; margin-bottom: 1rem; }
.hero-title span { color: var(--coral); position: relative; }
.hero-title span::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--coral), var(--yellow));
  border-radius: 2px;
}

.hero-subtitle { font-size: 1.05rem; color: #666; line-height: 1.7; max-width: 440px; font-weight: 600; }

.hero-btn-primary {
  background: linear-gradient(135deg, var(--coral), var(--peach)) !important;
  color: white !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 0.75rem 2rem !important;
  font-weight: 800 !important;
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(255,107,107,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(255,107,107,0.55); color: white !important; }

.hero-btn-secondary {
  background: white !important;
  color: var(--coral) !important;
  border: 2px solid var(--coral) !important;
  border-radius: 50px !important;
  padding: 0.75rem 2rem !important;
  font-weight: 800 !important;
  font-size: 1rem;
  transition: all 0.2s;
}
.hero-btn-secondary:hover { background: var(--coral) !important; color: white !important; transform: translateY(-3px); }

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: white;
  border-radius: 50px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.hero-logo-wrap { position: relative; display: inline-block; }

.hero-logo {
  max-width: 100%;
  width: 460px;
  max-height: 300px;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(255,107,107,0.2));
  animation: heroFloat 4s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

.hero-wave { line-height: 0; margin-bottom: -2px; }
.hero-wave svg { display: block; width: 100%; }

/* =========================================================
   CARDS DE CATEGORIA — SISTEMA cat-card
   ========================================================= */

.cat-card {
  border-radius: 20px;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.14);
}

/* Imagem via background-image — imune ao Bootstrap */
.cat-card__img {
  width: 100%;
  height: 190px;
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}

/* Área do emoji (sem imagem) */
.cat-card__emoji-area {
  padding: 1.8rem 1rem 1.4rem;
  text-align: center;
  border-radius: 20px 20px 0 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cat-card__emoji {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  display: block;
}

.cat-card__title {
  font-weight: 800;
  color: var(--dark);
  margin: 0.3rem 0 0.2rem;
  font-size: 1.1rem;
}

/* Rodapé completo (cards COM imagem) */
.cat-card__footer {
  background: white;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 0 0 20px 20px;
  flex-shrink: 0;
  border-top: 1px solid #f0f0f0;
}

.cat-card__footer-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.cat-card__footer-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

.cat-card__emoji-sm {
  font-size: 1.3rem;
  line-height: 1;
}

.cat-card__name {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--dark);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-card__desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-card__count {
  font-weight: 800;
  font-size: 0.8rem;
}

/* Rodapé simples (cards SEM imagem) */
.cat-card__footer-simple {
  background: white;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 0 0 20px 20px;
  flex-shrink: 0;
  border-top: 1px solid #f0f0f0;
}

.cat-card__badge {
  display: inline-block;
  border-radius: 50px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 800;
}

.cat-card__btn {
  display: inline-block;
  color: white;
  border-radius: 50px;
  padding: 0.38rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.2s;
}

.cat-card__btn:hover { opacity: 0.88; }

/* =========================================================
   RESPONSIVO MOBILE
   ========================================================= */

@media (max-width: 768px) {
  /* Hero banner compacto no mobile */
  .hero-banner { padding: 1.5rem 0 0; }
  .hero-banner__content { padding-bottom: 1rem; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-logo { width: 200px; max-height: 180px; }
  /* Esconde o logo no mobile para economizar espaço */
  .col-lg-6.text-center { display: none; }

  /* Banner topo */
  .banner-topo { border-radius: 0; }

  /* Hero section título */
  .hero-section { padding: 1.2rem 1rem 0.5rem; }
  .hero-section h1 { font-size: 1.8rem; }
  .hero-section p { font-size: 1rem; }

  /* Cards de categoria no mobile: layout horizontal */
  .cat-card {
    flex-direction: row;
    border-radius: 16px;
    align-items: stretch;
    height: auto;
  }

  /* Imagem lateral no mobile */
  .cat-card__img {
    width: 110px;
    min-width: 110px;
    height: auto;
    min-height: 110px;
    border-radius: 16px 0 0 16px;
    flex-shrink: 0;
  }

  /* Área do emoji lateral no mobile */
  .cat-card__emoji-area {
    width: 90px;
    min-width: 90px;
    padding: 1rem 0.5rem;
    border-radius: 16px 0 0 16px;
    flex-shrink: 0;
    flex-grow: 0;
  }

  .cat-card__emoji { font-size: 2.5rem; }
  .cat-card__title { font-size: 0.9rem; }

  /* Rodapé vira coluna direita no mobile */
  .cat-card__footer {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    border-radius: 0 16px 16px 0;
    border-top: none;
    border-left: 1px solid #f0f0f0;
    padding: 0.85rem 0.9rem;
    gap: 0.4rem;
  }

  .cat-card__footer-info { gap: 0.15rem; }
  .cat-card__footer-action { align-items: flex-start; flex-direction: row; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

  /* Rodapé simples também vira coluna direita */
  .cat-card__footer-simple {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    border-radius: 0 16px 16px 0;
    border-top: none;
    border-left: 1px solid #f0f0f0;
    padding: 0.85rem 0.9rem;
    gap: 0.5rem;
  }

  /* Produto cards no mobile: 2 colunas */
  .product-card:hover { transform: translateY(-4px); }
}

@media (max-width: 480px) {
  /* Muito pequeno: cards de categoria ficam menores */
  .cat-card__img { width: 95px; min-width: 95px; }
  .cat-card__emoji-area { width: 80px; min-width: 80px; }
  .cat-card__emoji { font-size: 2rem; }
  .hero-title { font-size: 1.7rem; }
  .trust-badge { font-size: 0.72rem; padding: 0.28rem 0.7rem; }
}

@media (max-width: 992px) {
  .hero-title { font-size: 2.4rem; }
}