/* =========================================
   1. HERO — FULLSCREEN OVERLAY
   ========================================= */
.hero {
  position: relative;
  height: 280px;
  overflow: hidden;
  border-bottom: 1px solid #1a1a1a;
}
@media (min-width: 600px)  { .hero { height: 360px; } }
@media (min-width: 1024px) { .hero { height: 480px; } }

/* Imagem de fundo */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Gradiente escuro sobre a imagem */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.10) 0%,
    rgba(0,0,0,0.20) 35%,
    rgba(0,0,0,0.75) 72%,
    rgba(13,13,13,1)  100%
  );
}

/* Texto sobreposto */
.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 0 18px 22px;
}
.hero h1 {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 5px;
}
.hero h1 span { color: #e91e63; }
.hero p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 12px;
}
@media (min-width: 600px) {
  .hero h1 { font-size: 2.4rem; }
  .hero p   { font-size: 0.95rem; }
}
@media (min-width: 1024px) {
  .hero-content { padding: 0 48px 36px; max-width: 640px; }
  .hero h1 { font-size: 3rem; }
}

/* ── CONTADOR DE VISITANTES ── */
.visitor-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}
.visitor-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(233,30,99,0.12);
  border: 1px solid rgba(233,30,99,0.25);
  border-radius: 20px;
  padding: 4px 11px;
}
.visitor-stat-icon  { font-size: 0.75rem; }
.visitor-stat-value { font-size: 0.78rem; font-weight: 800; color: #ff5fa2; }
.visitor-stat-label { font-size: 0.68rem; color: rgba(255,255,255,0.35); }
.visitor-sep        { color: #333; font-size: 1rem; }

@keyframes count-up {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.visitor-stat-value.animated { animation: count-up 0.5s ease forwards; }

/* =========================================
   2. SEÇÕES & CABEÇALHOS
   ========================================= */
.packs-section { padding: 25px 10px; }
.hidden { display: none; }

.section-header,
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 15px;
  padding: 0 5px;
}
.packs-section h2 {
  font-size: 1.2rem;
  color: #fff;
  margin: 0;
  border-left: 4px solid #e91e63;
  padding-left: 10px;
}
.view-all-label { font-size: 0.8rem; color: #666; font-style: italic; }
.home-filters { display: flex; align-items: center; }
.nsfw-toggle { font-size: 0.8rem; color: #888; cursor: pointer; display: flex; align-items: center; gap: 6px; }

/* =========================================
   3. SCROLL HORIZONTAL (Destaques & Recentes)
   Mobile/tablet: flex + scroll
   Desktop: flex + scroll com cards de tamanho fixo
   ========================================= */
.horizontal-scroll-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.horizontal-scroll-grid::-webkit-scrollbar { height: 3px; }
.horizontal-scroll-grid::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

/* Mobile: 2 cards por vez */
.horizontal-scroll-grid .pack-card {
  min-width: calc(50% - 8px);
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* Tablet: 3 cards */
@media (min-width: 600px) {
  .horizontal-scroll-grid .pack-card { min-width: calc(33.333% - 10px); }
}

/* Desktop: scroll mantido, cards de largura fixa (180px = ~5-6 visíveis) */
@media (min-width: 1024px) {
  .horizontal-scroll-grid { gap: 14px; }
  .horizontal-scroll-grid .pack-card { min-width: 180px; }
}
@media (min-width: 1400px) {
  .horizontal-scroll-grid .pack-card { min-width: 200px; }
}

/* =========================================
   4. GRID PRINCIPAL
   ========================================= */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px)  { .packs-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px)  { .packs-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
@media (min-width: 1100px) { .packs-grid { grid-template-columns: repeat(6, 1fr); gap: 16px; } }

/* =========================================
   5. CARD
   PERF: sem !important, will-change, contain, hover só em pointer real
   ========================================= */
.pack-card {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  cursor: pointer;
  will-change: transform;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) {
  .pack-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 24px rgba(255, 95, 162, 0.18);
  }
  .pack-card:hover .pack-image-wrapper img { transform: scale(1.05); }
}
.pack-card:active { transform: scale(0.97); }

.pack-image-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
  contain: strict;
}
.pack-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  will-change: transform;
  transition: transform 0.35s ease;
}

.pack-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 52px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 70%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  box-sizing: border-box;
  z-index: 2;
}
.pack-title {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* PERF: sem backdrop-filter no fav-btn — rgba opaco tem custo zero */
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.15s ease;
}
.fav-btn:hover  { transform: scale(1.2); }
.fav-btn.active { color: #ff4444; background: rgba(255,255,255,0.9); }

/* =========================================
   6. OVERLAY NSFW
   ========================================= */
.nsfw-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  color: #ff5fa2;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  z-index: 3;
}

/* =========================================
   7. MODAL — Opção 1: sidebar info + grade de imagens
   ========================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  contain: layout style;
}
.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  backdrop-filter: blur(10px);
}
.modal-content {
  background: #0f0f0f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  width: 95%;
  max-width: 1060px;
  height: 88vh;
  display: flex;
  overflow: hidden;
  will-change: transform;
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal.active .modal-content { transform: scale(1); }

/* ── SIDEBAR ESQUERDA ── */
.modal-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1a1a1a;
  background: #111;
  overflow: hidden;
}

.modal-cover {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
  /* Ajusta à proporção natural da imagem, máximo 260px */
  max-height: 260px;
}
.modal-cover img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.modal-cover-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, #111 100%);
  z-index: 1;
}
.modal-cover-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.modal-cover-badge.badge-sfw  { background: #16a34a; color: #fff; }
.modal-cover-badge.badge-soft { background: #ea580c; color: #fff; }
.modal-cover-badge.badge-nsfw { background: #be185d; color: #fff; }

.modal-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #222 transparent;
}
.modal-sidebar-body::-webkit-scrollbar { width: 2px; }
.modal-sidebar-body::-webkit-scrollbar-thumb { background: #333; }

.modal-pack-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 3px;
  line-height: 1.3;
}
.modal-pack-sub { font-size: 0.7rem; color: #555; margin: 0; }

.modal-divider { height: 1px; background: #1e1e1e; flex-shrink: 0; }

.modal-section-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}
.modal-description {
  font-size: 0.75rem;
  color: #777;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.modal-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.modal-tag {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: #1a1a1a;
  border: 1px solid #252525;
  color: #666;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.modal-tag:hover { border-color: #e91e63; color: #ff5fa2; }

.modal-sidebar-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}
.modal-fav-action {
  background: transparent;
  border: 1px solid #e91e63;
  color: #e91e63;
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s, color 0.2s;
}
.modal-fav-action.active { background: #e91e63; color: #fff; }
.like-modal-btn {
  background: transparent;
  border: 1px solid #222;
  color: #555;
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.like-modal-btn:hover { border-color: #ff6b6b; color: #ff6b6b; }
.like-modal-btn.liked { background: rgba(255,107,107,0.1); border-color: #ff6b6b; color: #ff6b6b; }

/* ── ÁREA DIREITA ── */
.modal-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.modal-right-header {
  padding: 12px 16px;
  background: #141414;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.img-counter { font-size: 0.72rem; color: #444; font-family: monospace; }
.close-modal-btn {
  background: transparent;
  border: none;
  color: #555;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}
.close-modal-btn:hover { color: #ff4444; }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #0d0d0d;
  overscroll-behavior: contain;
}
.modal-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  align-items: start;
}
.modal-images img {
  width: 100%;
  height: auto;           /* altura natural da imagem */
  display: block;
  border-radius: 6px;
  cursor: zoom-in;
  transition: opacity 0.2s, transform 0.2s;
}
.modal-images img:hover { opacity: 0.85; transform: scale(1.015); }

.modal-right-footer {
  padding: 10px 16px;
  background: #141414;
  border-top: 1px solid #1a1a1a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.modal-nav-btn {
  background: #1a1a1a;
  border: 1px solid #222;
  color: #777;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  transition: border-color 0.15s, color 0.15s;
}
.modal-nav-btn:hover:not(:disabled) { border-color: #e91e63; color: #fff; }
.modal-nav-btn:disabled { opacity: 0.2; pointer-events: none; }

.modal-warning {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: #666;
  gap: 8px;
  padding: 40px;
}
.modal-warning.hidden { display: none; }
.modal-warning p { margin: 0; }
.modal-warning .nsfw-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 9px 22px;
  background: #e91e63;
  color: #fff;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Mobile: sidebar vira header compacto — imagens não mudam */
/* ── Desktop: sidebar lateral estreita (70px) ── */
@media (min-width: 641px) {
  .modal-content { flex-direction: row; }
  .modal-sidebar {
    width: 70px;
    flex-direction: column;
    border-right: 1px solid #1a1a1a;
    border-bottom: none;
    height: 100%;
  }
  .modal-cover {
    width: 100%;
    height: 130px;
    flex-shrink: 0;
    max-height: none;
  }
  .modal-cover img { width: 100%; height: 100%; object-fit: cover; }
  .modal-cover-gradient { background: linear-gradient(to bottom, transparent 40%, #111 100%); }
  .modal-sidebar-body {
    padding: 6px;
    gap: 6px;
    overflow-y: auto;
    max-height: none;
    flex: 1;
  }
  .modal-pack-title { font-size: 0.7rem; }
  .modal-pack-sub   { display: none; }
  .modal-sidebar-actions { flex-direction: column; gap: 4px; }
  .modal-fav-action, .like-modal-btn { padding: 5px 3px; font-size: 0.68rem; }
  .modal-divider { display: block; }
  .modal-description {
    -webkit-line-clamp: 6;
    font-size: 0.68rem;
  }
  .modal-section-label { font-size: 0.55rem; }
  .modal-tag { font-size: 0.55rem; padding: 1px 5px; }
}

@media (max-width: 640px) {
  .modal-content { flex-direction: column; height: 92vh; border-radius: 12px 12px 0 0; align-self: flex-end; }
  .modal-sidebar { width: 100%; height: auto; flex-direction: row; border-right: none; border-bottom: 1px solid #1a1a1a; }
  .modal-cover {
    width: 80px;
    max-height: none;
    height: 110px;
    flex-shrink: 0;
  }
  .modal-cover img { width: 100%; height: 100%; object-fit: cover; }
  .modal-cover-gradient { background: linear-gradient(to right, transparent 40%, #111 100%); }
  .modal-sidebar-body { padding: 10px; gap: 6px; overflow-y: auto; max-height: 160px; }
  .modal-sidebar-actions { flex-direction: row; margin-top: 0; }
  .modal-divider { display: none; }
  .modal-description {
    -webkit-line-clamp: 3;
    font-size: 0.7rem;
  }
}


/* =========================================
   8. VIEWER (Lightbox)
   PERF: contain isola pintura do resto da página
   ========================================= */
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
  contain: layout style;
}
.image-viewer.active { opacity: 1; visibility: visible; pointer-events: all; }

.viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.93);
  backdrop-filter: blur(10px);
  z-index: -1;
}
.viewer-content { position: relative; z-index: 2001; text-align: center; width: 100%; }
.viewer-content img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 0 40px rgba(0,0,0,0.7);
  will-change: opacity;
  transition: opacity 0.15s ease;
}
.viewer-counter {
  color: #fff;
  margin-top: 12px;
  font-family: monospace;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.1);
  padding: 4px 14px;
  border-radius: 20px;
  display: inline-block;
}
.viewer-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2010;
  background: rgba(0,0,0,0.3);
  border: none;
  color: #fff;
  font-size: 3rem;
  padding: 18px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  transition: background 0.2s, transform 0.2s;
  user-select: none;
}
.viewer-arrow:hover { background: rgba(233,30,99,0.6); transform: translateY(-50%) scale(1.1); }
.viewer-arrow.left  { left: 15px; }
.viewer-arrow.right { right: 15px; }
.viewer-close {
  position: absolute;
  top: 20px; right: 20px;
  z-index: 2010;
  background: rgba(0,0,0,0.3);
  border: none; color: #fff;
  font-size: 2.2rem;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer; line-height: 1;
  transition: background 0.2s, transform 0.2s;
}
.viewer-close:hover { background: #ff4444; transform: rotate(90deg); }

@media (max-width: 600px) {
  .viewer-arrow { font-size: 2rem; padding: 10px; }
  .viewer-close { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 1.8rem; }
}

/* =========================================
   9. ESTADOS VAZIOS
   ========================================= */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #555;
  font-size: 0.9rem;
}
.empty-state span { display: block; font-size: 2rem; margin-bottom: 8px; }

/* =========================================
   10. SKELETON
   PERF: will-change na animação do shimmer
   ========================================= */
.skeleton-card {
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  will-change: background-position;
  flex-shrink: 0;
}

/* Skeletons no scroll horizontal acompanham o tamanho dos cards */
.horizontal-scroll-grid .skeleton-card { min-width: calc(50% - 8px); }
@media (min-width: 600px)  { .horizontal-scroll-grid .skeleton-card { min-width: calc(33.333% - 10px); } }
@media (min-width: 1024px) { .horizontal-scroll-grid .skeleton-card { min-width: 180px; } }
@media (min-width: 1400px) { .horizontal-scroll-grid .skeleton-card { min-width: 200px; } }

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
