/* Design system - PetRações */
:root {
  --background: 0 0% 98%;
  --foreground: 150 10% 15%;
  --card: 0 0% 100%;
  --card-foreground: 150 10% 15%;
  --popover: 0 0% 100%;
  --popover-foreground: 150 10% 15%;
  --primary: 199 100% 44%;
  --primary-foreground: 0 0% 100%;
  --secondary: 199 80% 50%;
  --secondary-foreground: 0 0% 100%;
  --muted: 200 20% 93%;
  --muted-foreground: 200 10% 45%;
  --accent: 199 100% 44%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 200 15% 88%;
  --input: 200 15% 88%;
  --ring: 199 100% 44%;
  --radius: 0.75rem;
  --radius-app: 1rem;
  --radius-card: 1rem;
  --radius-card-lg: 1.25rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --success: 199 100% 44%;
  --warning: 45 100% 51%;
  --badge-sale: 199 100% 40%;
  --badge-sale-foreground: 0 0% 100%;
  --trust: 199 80% 35%;
}

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

* { border-color: hsl(var(--border)); }
* {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body {
  font-family: 'Roboto', sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
}
@media (min-width: 640px) {
  body {
    background-color: hsl(200 15% 94%);
  }
}
.app-body {
  padding-bottom: var(--safe-bottom);
}
.app-container {
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  background: hsl(var(--background));
}
@media (min-width: 640px) {
  .app-container {
    max-width: 26rem;
    min-height: 90vh;
    margin: 2rem auto;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px hsl(var(--foreground) / 0.15), 0 0 0 1px hsl(var(--border));
  }
}
.app-header {
  padding-top: var(--safe-top);
}
.app-header-inner {
  padding-left: max(1rem, var(--safe-left));
  padding-right: max(1rem, var(--safe-right));
}
.app-main {
  padding-bottom: calc(1.5rem + var(--safe-bottom));
  padding-left: max(1rem, var(--safe-left));
  padding-right: max(1rem, var(--safe-right));
}
@media (max-width: 639px) {
  .app-main {
    padding-bottom: calc(4rem + var(--safe-bottom));
  }
}
.app-fab {
  bottom: calc(1rem + var(--safe-bottom));
  right: max(1rem, var(--safe-right));
}
.app-footer {
  padding-bottom: calc(1.5rem + var(--safe-bottom));
}

.animate-bounce-slow { animation: bounce 2s infinite; }
.animate-pulse-badge { animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer-bg {
  background: linear-gradient(90deg, hsl(199 100% 44% / 0.1) 25%, hsl(199 100% 44% / 0.2) 50%, hsl(199 100% 44% / 0.1) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes slide-in-from-top {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: slide-in-from-top 0.2s ease-out; }

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Advantages section */
.home-section {
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.home-section-content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem max(1rem, var(--safe-left)) 1.5rem max(1rem, var(--safe-right));
}
.partners {
  padding-left: max(1rem, var(--safe-left));
  padding-right: max(1rem, var(--safe-right));
}
.advantages-title {
  margin-bottom: 1rem;
}
.advantages .section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  text-align: center;
}
.advantages-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .advantages-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}
.card-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card-feature:hover,
.card-feature:active {
  border-color: hsl(var(--primary));
  box-shadow: 0 2px 8px hsl(var(--primary) / 0.15);
}
.card-feature:active {
  transform: scale(0.98);
}
.card-feature-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}
.card-feature-icon .ptz-icon {
  width: 1.25rem;
  height: 1.25rem;
}
.card-feature-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  margin: 0 0 0.25rem 0;
}
.card-feature-subtitle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.75rem;
  color: hsl(var(--primary));
  font-weight: 600;
}
.card-feature-subtitle .ptz-icon-arrow {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

/* Partners section */
.partners {
  border-top: 1px solid hsl(var(--border));
}
.partners .section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  text-align: center;
  margin-bottom: 1.5rem;
}
.partners-container {
  overflow: hidden;
}
.partners-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: max-content;
  animation: partners-marquee 50s linear infinite;
}
@keyframes partners-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.partners-container:hover .partners-track {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .partners-track { animation: none; }
  .partners-container { overflow-x: auto; }
}
.partners-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  transition: transform 0.2s, box-shadow 0.2s;
}
.partners-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px hsl(var(--foreground) / 0.08);
}
.partners-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* App-style: cart drawer full screen mobile */
.cart-drawer {
  padding-bottom: var(--safe-bottom);
}
@media (max-width: 639px) {
  .cart-drawer {
    max-width: 100%;
    border-radius: 0;
  }
}

/* Checkout modal full screen mobile */
.checkout-modal {
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}
@media (min-width: 640px) {
  .checkout-modal {
    inset: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px hsl(var(--foreground) / 0.25);
  }
}

/* Rules modal */
.rules-modal {
  inset: 1rem;
  margin: auto;
}
@media (min-width: 640px) {
  .rules-modal {
    inset: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 28rem;
  }
}

/* Grid de produtos - estilo Petz */
.products-grid-petz {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 640px) {
  .products-grid-petz { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
@media (min-width: 1024px) {
  .products-grid-petz { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
}
@media (min-width: 1280px) {
  .products-grid-petz { grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
}

/* Card de produto - estilo Petz */
.product-card-petz {
  display: flex;
  flex-direction: column;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.product-card-petz:hover {
  box-shadow: 0 4px 12px hsl(var(--foreground) / 0.08);
  border-color: hsl(var(--border));
}
.product-card-petz__link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.product-card-petz__img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: hsl(var(--muted));
  overflow: hidden;
}
.product-card-petz__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.product-card-petz__badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}
.product-card-petz__badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  align-self: flex-start;
}
.product-card-petz__badge--sale {
  background: hsl(var(--badge-sale));
  color: hsl(var(--badge-sale-foreground));
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.product-card-petz__badge--tag {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.product-card-petz__badge--stock {
  background: #fef2f2;
  color: #b91c1c;
}
/* Plaquinha de peso (kg/g) */
.product-card-petz__weight-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0f172a;
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 50%, #fef08a 100%);
  border: 2px solid #eab308;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
  text-transform: uppercase;
  z-index: 2;
}
.product-card-petz__body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.product-card-petz__brand {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--primary));
  margin: 0 0 4px 0;
}
.product-card-petz__name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: hsl(var(--foreground));
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-petz__weight {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  margin: 0 0 8px 0;
}
.product-card-petz__price {
  margin-top: auto;
  margin-bottom: 8px;
}
.product-card-petz__price-old {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  text-decoration: line-through;
  display: block;
}
.product-card-petz__price-current {
  font-size: 18px;
  font-weight: 700;
  color: hsl(var(--primary));
}
.product-card-petz__badges-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.product-card-petz__badge-sm {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
}
.product-card-petz__badge-sm--delivery {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.2);
}
.product-card-petz__badge-sm--entrega {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.product-card-petz__btn {
  margin: 0 12px 12px 12px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
}
.product-card-petz__btn:hover {
  filter: brightness(1.05);
}
.product-card-petz__btn:active {
  transform: scale(0.98);
}

/* Fallback para product-card antigo (cart, etc) */
.product-card img,
.product-card .aspect-square img,
[class*="product"] img[alt] {
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
  display: block;
}

/* Notificações de compras recentes - prova social */
.purchase-notification {
  animation: purchase-notif-slide-up 0.4s ease-out;
}
.purchase-notif-enter {
  animation: purchase-notif-slide-up 0.35s ease-out;
}
@keyframes purchase-notif-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#purchase-notif-bar {
  transform-origin: left;
}
/* Thumb da notificação: só a imagem do produto, sem duplicação */
.purchase-notif-thumb {
  position: relative;
}
.purchase-notif-thumb img,
.purchase-notif-thumb [id="purchase-notif-placeholder"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.purchase-notif-thumb img {
  object-fit: cover;
  object-position: center;
}

/* Slider de preço no painel de filtros */
#price-min,
#price-max {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: hsl(var(--muted));
  border-radius: 3px;
  outline: none;
}
#price-min::-webkit-slider-thumb,
#price-max::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: hsl(var(--primary));
  cursor: pointer;
  box-shadow: 0 1px 3px hsl(var(--foreground) / 0.2);
}
#price-min::-moz-range-thumb,
#price-max::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: hsl(var(--primary));
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 3px hsl(var(--foreground) / 0.2);
}
