/* ===================================================================
   Bazar Mix da Jô — Loja Pública
   Visual: marketplace feminino, vermelho + branco, moderno e acolhedor
   =================================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --red:          #D7192D;
  --red-dark:     #A8101A;
  --red-deeper:   #7A0B13;
  --red-glow:     #FF4D5E;
  --soft-pink:    #FFF0F1;
  --blush:        #FFD6DA;
  --cream:        #FFFAFA;
  --text:         #2A1F22;
  --text-light:   #5C4F53;
  --muted:        #8A7E82;
  --border:       #F0D8DC;
  --bg:           #FFF7F8;
  --white:        #FFFFFF;
  --green-wa:     #25D366;
  --green-dark:   #1DA851;
  --shadow-sm:    0 2px 8px rgba(120, 20, 30, 0.06);
  --shadow-md:    0 8px 24px rgba(120, 20, 30, 0.10);
  --shadow-lg:    0 16px 40px rgba(120, 20, 30, 0.14);
  --shadow-red:   0 6px 20px rgba(215, 25, 45, 0.30);
  --radius:       12px;
  --radius-sm:    8px;
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --transition:   200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 60%, var(--red-deeper) 100%);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(120, 0, 15, 0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.brand span {
  opacity: 0.85;
  font-weight: 600;
}

.admin-link {
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background var(--transition), border-color var(--transition);
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.8);
}

/* ---------- Search / Filter Band ---------- */
.search-band {
  background: linear-gradient(180deg, var(--red-dark) 0%, var(--red-deeper) 100%);
  color: var(--white);
  padding: 32px 0 38px;
  position: relative;
  overflow: hidden;
}

/* Decorative circles */
.search-band::before,
.search-band::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
  pointer-events: none;
}

.search-band::before {
  width: 400px;
  height: 400px;
  background: var(--white);
  top: -200px;
  right: -80px;
}

.search-band::after {
  width: 250px;
  height: 250px;
  background: var(--white);
  bottom: -120px;
  left: -60px;
}

.search-band h1 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  position: relative;
}

.search-band h1 .emoji {
  display: inline-block;
  animation: wave 2.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-8deg); }
  45% { transform: rotate(14deg); }
  60% { transform: rotate(-4deg); }
  75% { transform: rotate(10deg); }
}

.filter-form {
  display: grid;
  grid-template-columns: 2.2fr 1.2fr 0.8fr 0.8fr auto auto;
  gap: 10px;
  position: relative;
}

.filter-form input,
.filter-form select {
  width: 100%;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 14px 14px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-form input:focus,
.filter-form select:focus {
  outline: none;
  border-color: var(--red-glow);
  box-shadow: 0 0 0 3px rgba(255, 77, 94, 0.2);
}

.filter-form input::placeholder {
  color: var(--muted);
}

.filter-form button,
.clear-filters {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 22px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.filter-form button {
  background: var(--white);
  color: var(--red-dark);
}

.filter-form button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.filter-form button:active {
  transform: translateY(0);
}

.clear-filters {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.clear-filters:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- Category Pills ---------- */
.category-pills {
  padding: 20px 0 8px;
}

.category-pills-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.pill:hover,
.pill.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
  box-shadow: var(--shadow-red);
  transform: translateY(-1px);
}

.pill.active {
  pointer-events: none;
}

/* ---------- Product Grid ---------- */
.product-section {
  padding: 28px 0 52px;
}

.results-count {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.results-count strong {
  color: var(--text);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

/* ---------- Product Card ---------- */
.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
  }
}

.product-card h2 {
  margin: 0;
  padding: 14px 16px 8px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  min-height: 52px;
  color: var(--text);
}

/* ---------- Gallery ---------- */
.gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--soft-pink);
  overflow: hidden;
}

.gallery img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 350ms ease;
  pointer-events: none;
}

.gallery img.active {
  opacity: 1;
  pointer-events: auto;
}

.no-image {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.no-image::before {
  content: '📷';
  display: block;
  font-size: 2.5rem;
  margin-bottom: 4px;
}

/* Gallery arrows */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 44px;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
  z-index: 2;
}

.product-card:hover .gallery-arrow,
.gallery-arrow:focus {
  opacity: 1;
}

/* Always show arrows on touch devices */
@media (hover: none) {
  .gallery-arrow { opacity: 0.85; }
}

.gallery-arrow:hover {
  background: rgba(215, 25, 45, 0.85);
}

.gallery-arrow.prev {
  left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.gallery-arrow.next {
  right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Gallery dots */
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 2px;
}

.gallery-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blush);
  transition: all var(--transition);
  cursor: pointer;
}

.gallery-dots span.active {
  background: var(--red);
  width: 20px;
}

/* ---------- Card Content ---------- */
.card-body {
  padding: 0 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-tag {
  display: inline-block;
  margin: 8px 0 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--soft-pink);
  color: var(--red-dark);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.description {
  margin: 0 0 12px;
  color: var(--text-light);
  font-size: 0.88rem;
  line-height: 1.45;
  flex: 1;
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Card Footer ---------- */
.card-footer {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price {
  font-family: var(--font-display);
  color: var(--red);
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}

.price-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

/* WhatsApp button */
.whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--green-wa) 0%, var(--green-dark) 100%);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.whatsapp-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.whatsapp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.whatsapp-btn:active {
  transform: translateY(0);
}

/* WhatsApp SVG icon */
.wa-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- Empty State ---------- */
.empty-state {
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 28px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.empty-state::before {
  content: '🛍️';
  display: block;
  font-size: 3rem;
  margin-bottom: 12px;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px 16px;
  background: linear-gradient(135deg, var(--red-dark) 0%, var(--red-deeper) 100%);
  color: var(--white);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.site-footer .footer-heart {
  color: var(--blush);
  display: inline-block;
  animation: heartbeat 1.8s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.2); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
}

/* ---------- Scroll to top button ---------- */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--red);
  color: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow-red);
  z-index: 50;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 300ms ease, transform 300ms ease;
  pointer-events: none;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  background: var(--red-dark);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .filter-form {
    grid-template-columns: 1fr 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .container {
    width: min(100% - 20px, 1200px);
  }

  .header-inner {
    min-height: 60px;
  }

  .brand {
    font-size: 1.25rem;
  }

  .search-band {
    padding: 24px 0 28px;
  }

  .search-band h1 {
    font-size: 1.3rem;
  }

  .filter-form {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card h2 {
    padding: 10px 12px 6px;
    font-size: 0.88rem;
    min-height: 42px;
  }

  .card-body { padding: 0 12px; }
  .card-footer { padding: 0 12px 12px; }

  .category-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
  }

  .description {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
  }

  .price {
    font-size: 1.35rem;
  }

  .whatsapp-btn {
    min-height: 42px;
    font-size: 0.85rem;
  }

  .gallery-arrow {
    width: 30px;
    height: 36px;
    font-size: 1rem;
  }

  .category-pills-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-pills-inner::-webkit-scrollbar {
    display: none;
  }

  .pill {
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 6px 14px;
  }
}

@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Fade-in animation for cards ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeInUp 400ms ease both;
}

.product-card:nth-child(2) { animation-delay: 50ms; }
.product-card:nth-child(3) { animation-delay: 100ms; }
.product-card:nth-child(4) { animation-delay: 150ms; }
.product-card:nth-child(5) { animation-delay: 200ms; }
.product-card:nth-child(6) { animation-delay: 250ms; }
.product-card:nth-child(7) { animation-delay: 300ms; }
.product-card:nth-child(8) { animation-delay: 350ms; }
