:root {
  --azure-deep: #0a3d62;
  --azure: #0c6b9e;
  --azure-bright: #1aa6d6;
  --azure-mist: #e8f6fc;
  --gold: #d4a017;
  --gold-bright: #f0c14b;
  --gold-deep: #a67c00;
  --sand: #f3e6d0;
  --sand-deep: #e2c79a;
  --navy: #06253a;
  --sale: #c0392b;
  --sale-soft: #e74c3c;
  --white: #ffffff;
  --text: #0f2433;
  --muted: #6b7c88;
  --card: #ffffff;
  --radius: 12px;
  --dl-h: 68px;
  --font: "Cairo", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(120% 60% at 50% -10%, #1a8fc2 0%, transparent 55%),
    linear-gradient(180deg, #0b5f8a 0%, #0a3d62 28%, #8b1e1e 72%, #6b1212 100%);
  min-height: 100vh;
  padding-bottom: calc(var(--dl-h) + 16px);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: none; }

/* —— Hero —— */
.hero {
  position: relative;
  min-height: 62vh;
  min-height: 62dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 18px 0;
  overflow: hidden;
  color: var(--white);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 35%, rgba(120, 220, 255, 0.45) 0%, transparent 60%),
    linear-gradient(180deg, #7ec8e8 0%, #1a8fc2 38%, #0c5f8a 70%, transparent 100%);
  z-index: 0;
}
.skyline {
  position: absolute;
  left: 0; right: 0; bottom: 18%;
  height: 28%;
  opacity: 0.28;
  background:
    linear-gradient(90deg, transparent 4%, #06253a 5% 7%, transparent 8%),
    linear-gradient(90deg, transparent 12%, #06253a 13% 18%, transparent 19%),
    linear-gradient(90deg, transparent 22%, #0a3d62 23% 26%, transparent 27%),
    linear-gradient(90deg, transparent 35%, #06253a 36% 42%, transparent 43%),
    linear-gradient(90deg, transparent 48%, #0a3d62 49% 55%, transparent 56%),
    linear-gradient(90deg, transparent 62%, #06253a 63% 66%, transparent 67%),
    linear-gradient(90deg, transparent 72%, #0a3d62 73% 80%, transparent 81%),
    linear-gradient(90deg, transparent 86%, #06253a 87% 92%, transparent 93%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: bottom;
  mask-image: linear-gradient(180deg, transparent, #000 40%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%);
}
.wave {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 90px;
  border-radius: 45%;
  background: rgba(255, 255, 255, 0.12);
  animation: waveMove 8s ease-in-out infinite;
}
.wave-1 { bottom: 8%; animation-duration: 7s; }
.wave-2 { bottom: 2%; opacity: 0.7; animation-duration: 10s; animation-direction: reverse; }
@keyframes waveMove {
  0%, 100% { transform: translateX(0) rotate(-1deg); }
  50% { transform: translateX(4%) rotate(1deg); }
}
.ripple {
  position: absolute;
  left: 50%; top: 42%;
  width: min(78vw, 340px); height: min(78vw, 340px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.55) 0%, rgba(120,220,255,0.35) 28%, rgba(26,143,194,0.15) 52%, transparent 70%);
  animation: ripplePulse 4.5s ease-in-out infinite;
}
@keyframes ripplePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.85; }
}

.floaters { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.floater {
  position: absolute;
  width: 44px; height: 88px;
  border-radius: 22px 22px 14px 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(200,240,255,0.7) 40%, var(--azure-bright) 100%);
  box-shadow: inset -6px 0 12px rgba(255,255,255,0.4), 0 8px 18px rgba(6, 37, 58, 0.25);
  animation: floatY 5s ease-in-out infinite;
}
.floater::before {
  content: "";
  position: absolute;
  top: 10%; left: 22%;
  width: 30%; height: 50%;
  border-radius: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), transparent);
}
.floater::after {
  content: "";
  position: absolute;
  top: -8px; left: 50%;
  width: 18px; height: 14px;
  transform: translateX(-50%);
  border-radius: 4px 4px 2px 2px;
  background: var(--gold);
}
.f1 { left: 8%; top: 28%; animation-delay: 0s; transform: rotate(-12deg); }
.f2 { right: 10%; top: 22%; width: 36px; height: 72px; animation-delay: 0.8s; transform: rotate(14deg); }
.f3 { left: 22%; top: 48%; width: 30px; height: 60px; animation-delay: 1.4s; transform: rotate(-8deg); opacity: 0.85; }
.f4 { right: 24%; top: 46%; width: 34px; height: 68px; animation-delay: 0.4s; transform: rotate(10deg); }
.f5 { left: 48%; top: 58%; width: 28px; height: 56px; animation-delay: 1.1s; transform: rotate(-18deg); opacity: 0.75; }
@keyframes floatY {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -18px; }
}

.drop {
  position: absolute;
  width: 12px; height: 16px;
  background: rgba(255,255,255,0.75);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  animation: dropFall 3.8s linear infinite;
}
.d1 { left: 30%; top: 18%; animation-delay: 0.2s; }
.d2 { left: 62%; top: 12%; animation-delay: 1.2s; }
.d3 { left: 78%; top: 30%; animation-delay: 2s; }
@keyframes dropFall {
  0% { opacity: 0; transform: rotate(-45deg) translateY(-20px); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: rotate(-45deg) translateY(140px); }
}
.ice {
  position: absolute;
  width: 22px; height: 22px;
  background: linear-gradient(135deg, #fff, #b8e8ff);
  border-radius: 4px;
  opacity: 0.75;
  animation: iceSpin 7s linear infinite;
}
.i1 { left: 16%; top: 62%; animation-delay: 0.5s; }
.i2 { right: 18%; top: 58%; width: 16px; height: 16px; animation-delay: 1.8s; }
@keyframes iceSpin {
  0% { transform: rotate(0) translateY(0); }
  50% { transform: rotate(180deg) translateY(-12px); }
  100% { transform: rotate(360deg) translateY(0); }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-top: 8px;
  padding-bottom: 8px;
  margin-top: 2vh;
  animation: heroIn 0.9s ease-out both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.brand {
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-shadow:
    0 2px 0 var(--gold-deep),
    0 8px 24px rgba(6, 37, 58, 0.35);
  margin-bottom: 6px;
  line-height: 1.1;
}
.headline {
  font-size: clamp(1.55rem, 6.5vw, 2.15rem);
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 3px 12px rgba(6, 37, 58, 0.35);
  margin-bottom: 12px;
}
.event-pill {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sale), #a93226);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.4);
}
.offer-line {
  font-size: clamp(1.05rem, 4.5vw, 1.35rem);
  font-weight: 800;
  color: var(--gold-bright);
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.ribbon-wrap {
  position: relative;
  z-index: 2;
  margin-top: auto;
  margin-inline: -18px;
}
.ribbon {
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright) 45%, var(--gold) 100%);
  color: var(--navy);
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  padding: 12px 16px 16px;
  clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 88%);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  animation: ribbonWave 3.5s ease-in-out infinite;
}
@keyframes ribbonWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* —— Urgency —— */
.urgency {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 14px 16px 8px;
  background: linear-gradient(180deg, rgba(139, 30, 30, 0.15), transparent);
}
.urgency p {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.95;
  margin-bottom: 8px;
}
.countdown {
  display: inline-flex;
  gap: 8px;
}
.countdown span {
  min-width: 52px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(240, 193, 75, 0.35);
  border-radius: 10px;
  padding: 6px 8px;
  display: grid;
  gap: 2px;
}
.countdown b {
  font-size: 18px;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}
.countdown small { font-size: 10px; opacity: 0.85; }

/* —— Products —— */
.products-section {
  position: relative;
  z-index: 2;
  padding: 8px 10px 24px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 12px;
  color: #fff;
}
.section-title h2 {
  font-size: 18px;
  font-weight: 800;
}
.shuffle-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  background: var(--gold-bright);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 8px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  animation: cardIn 0.55s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:active { transform: scale(0.98); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.card-top {
  height: 6px;
  background: linear-gradient(90deg, var(--sale), var(--sale-soft));
  position: relative;
}
.card-body {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 6px;
  padding: 10px 8px 6px;
}
.card-pic {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f8fb;
}
.card-pic img {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.card:hover .card-pic img { transform: scale(1.05); }
.card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}
.card-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}
.card-daily {
  font-size: 10px;
  color: var(--muted);
  text-decoration: line-through;
}
.card-sale {
  width: auto;
  margin: 0 8px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 3px 8px rgba(192, 57, 43, 0.3);
  box-sizing: border-box;
}
.card-sale b {
  display: block;
  font-size: 15px;
  color: var(--gold-bright);
  line-height: 1.15;
}
.sold-bar {
  margin: 6px 8px 0;
  height: 4px;
  border-radius: 2px;
  background: #eee;
  overflow: hidden;
}
.sold-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--azure-bright), var(--gold));
  border-radius: 2px;
  width: 40%;
}
.sold-text {
  font-size: 9px;
  color: var(--muted);
  padding: 4px 8px 8px;
}

/* —— Toast (动销) —— */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dl-h) + 14px);
  transform: translateX(-50%) translateY(20px);
  z-index: 45;
  max-width: min(92vw, 360px);
  background: rgba(6, 37, 58, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  border: 1px solid rgba(240, 193, 75, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast em {
  color: var(--gold-bright);
  font-style: normal;
}

/* —— Download bar —— */
.dl-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  min-height: var(--dl-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #fffef8, #fff);
  border-top: 1px solid rgba(212, 160, 23, 0.35);
  box-shadow: 0 -6px 24px rgba(6, 37, 58, 0.12);
}
.dl-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.dl-text strong {
  font-size: 14px;
  color: var(--navy);
}
.dl-text span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-download {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 18px;
  border-radius: 22px;
  font-weight: 800;
  font-size: 14px;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 4px 14px rgba(212, 160, 23, 0.45);
  animation: ctaPulse 2.4s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.btn-block {
  width: 100%;
  margin-top: 12px;
  height: 46px;
  animation: none;
}

/* —— Modal —— */
.mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 37, 58, 0.62);
  backdrop-filter: blur(3px);
}
.mask.show { display: block; }
.app-modal {
  display: none;
  position: fixed;
  left: 16px; right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  background: linear-gradient(180deg, #fffef8, #fff);
  border-radius: 16px;
  padding: 18px 16px 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  border: 1px solid rgba(212, 160, 23, 0.35);
  max-height: min(86vh, 640px);
  overflow: auto;
}
.app-modal.show { display: block; animation: modalIn 0.3s ease; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-46%); }
  to { opacity: 1; transform: translateY(-50%); }
}
.modal-close {
  position: absolute;
  top: 8px;
  inset-inline-start: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #333;
  font-size: 22px;
  line-height: 1;
}
.app-modal h3 {
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
  padding: 0 28px;
}
.app-video {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 9 / 16;
  max-height: 52vh;
  margin: 0 auto;
}
.app-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.app-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

@media (min-width: 720px) {
  body { max-width: 480px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.25); }
  .dl-bar {
    max-width: 480px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
  }
  .app-modal {
    max-width: 420px;
    left: 50%;
    right: auto;
    width: calc(100% - 32px);
    transform: translate(-50%, -50%);
  }
  .app-modal.show { transform: translate(-50%, -50%); }
  @keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
  }
}
