/* Custom styles for Ofertazo ML */

html {
  height: 100%;
  overflow: hidden;
}

body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("../images/fondo.png");
  background-repeat: no-repeat;
  background-position: center 48%;
  background-size: min(34vw, 200px);
  opacity: 0.14;
  mix-blend-mode: multiply;
  filter: invert(1);
}

.dark body::before {
  opacity: 0.22;
  mix-blend-mode: screen;
  filter: none;
}

.site-header {
  background: #ffe600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.dark .site-header {
  background: rgba(6, 16, 28, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  box-shadow: none;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  transition: transform 0.15s ease;
}

.social-btn:hover {
  transform: scale(1.05);
}

.social-wa { background: #25d366; }
.social-fb { background: #1877f2; }

.hero-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  background: #111;
  color: #fff;
  border-radius: 16px;
  padding: 12px 14px;
}

.dark .hero-banner {
  background: #ffe600;
  color: #111;
}

.hero-copy {
  min-width: 0;
}

.hero-kicker {
  display: inline-block;
  background: #ffe600;
  color: #111;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.2;
}

.dark .hero-kicker {
  background: #111;
  color: #ffe600;
}

.hero-banner h1 {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 6px 0 0;
}

@media (min-width: 768px) {
  .hero-banner h1 {
    font-size: 26px;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-btn-primary,
.hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.hero-btn-primary {
  background: #ffe600;
  color: #111;
}

.dark .hero-btn-primary {
  background: #111;
  color: #ffe600;
}

.hero-btn-secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.dark .hero-btn-secondary {
  color: #111;
  border-color: rgba(0, 0, 0, 0.2);
}

.coupons-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.live-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
}

.dark .live-inline {
  color: #4ade80;
}

.live-inline strong {
  font-size: 14px;
  font-weight: 800;
  color: inherit;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
  flex-shrink: 0;
}

.find-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 6px;
}

@media (min-width: 768px) {
  .find-block {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.filter-chip {
  border: 0;
  background: #fff;
  color: #111;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.filter-chip.active {
  background: #ffe600;
  color: #111;
}

.filter-refresh {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.filter-refresh:active,
.filter-chip:active {
  transform: scale(0.96);
}

.dark .filter-chip,
.dark .filter-refresh {
  background: #13233a;
  color: #e2e8f0;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dark .filter-chip.active {
  background: #ffe600;
  color: #111;
  border-color: #ffe600;
}

.available-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
}

.dark .available-pill {
  color: #9dffb0;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(157, 255, 176, 0.2);
}

.coupons-area {
  padding-bottom: 8px;
  flex: 0 0 auto;
}

.offers-section {
  display: block !important;
  flex-shrink: 0;
  margin-top: 8px;
  padding-bottom: 32px;
}

.coupons-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.pb-safe {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

main {
  -webkit-overflow-scrolling: touch;
}

.coupon-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.coupon-shell {
  display: block;
}

.coupon-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr) minmax(0, 0.9fr);
  align-items: stretch;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.coupon-side {
  padding: 16px 18px 14px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 128px;
}

.coupon-card-navy .coupon-side {
  background: linear-gradient(160deg, #2a2f8f 0%, #12164d 100%);
}

.coupon-card-magenta .coupon-side {
  background: linear-gradient(160deg, #ff4fbf 0%, #c2186a 100%);
}

.coupon-card-gray .coupon-side {
  background: linear-gradient(160deg, #94a3b8 0%, #64748b 100%);
}

.coupon-store-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  background: #ffe600;
  color: #111;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
}

.coupon-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1d4ed8;
  flex-shrink: 0;
}

.coupon-off {
  margin: 14px 0 12px;
  font-family: "Baloo 2", sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: #fff;
  text-transform: uppercase;
}

.coupon-status {
  margin: 0;
  display: inline-flex;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.coupon-status-vence-hoy {
  color: #ffe600;
}

.coupon-status-por-agotarse {
  color: #fecaca;
}

.coupon-status-agotado {
  color: #e5e7eb;
}

.coupon-mid {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.coupon-stat-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.coupon-stat strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: #1e1b4b;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.coupon-right {
  padding: 16px 16px 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.coupon-cta {
  width: 100%;
  max-width: 170px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
}

.coupon-card-navy .coupon-cta {
  background: #1e1b4b;
}

.coupon-card-magenta .coupon-cta {
  background: #e11d8a;
}

.coupon-card-gray .coupon-cta,
.coupon-cta.is-agotado {
  background: #94a3b8;
  cursor: default;
}

.coupon-code {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.coupon-card.is-agotado {
  filter: grayscale(0.25);
  opacity: 0.88;
}

.coupon-card-top {
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

.coupon-shell.is-top .coupon-off {
  font-size: 36px;
}

@media (max-width: 720px) {
  .coupon-card {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr) minmax(0, 0.9fr);
    border-radius: 18px;
  }

  .coupon-side {
    min-height: 0;
    padding: 10px 12px 10px;
  }

  .coupon-store-pill {
    font-size: 11px;
    gap: 5px;
    padding: 4px 9px 4px 6px;
  }

  .coupon-dot {
    width: 8px;
    height: 8px;
  }

  .coupon-off {
    font-size: 22px;
    margin: 8px 0 6px;
  }

  .coupon-status {
    font-size: 10px;
  }

  .coupon-mid {
    padding: 10px 8px;
    gap: 8px;
  }

  .coupon-stat-label {
    font-size: 11px;
  }

  .coupon-stat strong {
    font-size: 18px;
  }

  .coupon-right {
    padding: 10px 8px;
    gap: 7px;
  }

  .coupon-cta {
    max-width: none;
    border-radius: 14px;
    font-size: 12px;
    padding: 10px 8px;
    line-height: 1.2;
  }

  .coupon-code {
    font-size: 11px;
  }

  .coupon-shell.is-top .coupon-off {
    font-size: 24px;
  }
}

.bottom-dock {
  background: #111;
}

.nav-tab-active {
  background: #ffe600;
  color: #111;
  box-shadow: 0 6px 16px rgba(255, 230, 0, 0.25);
}

.nav-tab-idle {
  background: #2a2a2a;
  color: #f3f3f3;
}

.nav-count-active {
  background: rgba(0, 0, 0, 0.18);
  color: #111;
}

.nav-count-idle {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.dark .bottom-dock {
  background: #05070d;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a1a1aa;
}

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

@media (min-width: 768px) {
  .offers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .offers-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.offer-card {
  background: #f0d24a;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-shadow: 0 8px 20px rgba(160, 120, 0, 0.18);
}

.dark .offer-card {
  background: #f0d24a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.offer-image-wrap {
  position: relative;
  background: #fff;
  aspect-ratio: 1;
}

.offer-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.offer-badge-sold {
  position: absolute;
  left: 8px;
  top: 8px;
  background: #111;
  color: #ffe600;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
}

.offer-badge-off {
  position: absolute;
  right: 8px;
  top: 8px;
  background: #e11d2a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
  border-radius: 8px;
}

.offer-ship {
  position: absolute;
  left: 8px;
  bottom: 8px;
  color: #00a650;
  font-size: 11px;
  font-weight: 800;
}

.offer-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.offer-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #111;
}

.dark .offer-title {
  color: #e5eefc;
}

.offer-price {
  font-size: 22px;
  font-weight: 900;
  color: #111;
  line-height: 1;
}

.dark .offer-price {
  color: #fff;
}

.offer-old {
  font-size: 13px;
  color: #9ca3af;
  text-decoration: line-through;
  margin-left: 6px;
  font-weight: 600;
}

.offer-off-text {
  color: #00a650;
  font-size: 13px;
  font-weight: 800;
}

.offer-meta {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.35;
}

.offer-buy {
  margin-top: auto;
  display: block;
  text-align: center;
  background: #0b1b33;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
}

.offer-stars {
  color: #3483fa;
  letter-spacing: -1px;
}
