/* ================================================================
   ZeeMart – Mobile-First CSS (Fully Responsive + Smartphone Ready)
   ================================================================ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #f7f8fa;
  color: #1a1a2e;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; -webkit-tap-highlight-color: transparent; color: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ── Brand Colors ──────────────────────────────────────────── */
:root {
  --green-dark:   #0f3d22;
  --green:        #1a472a;
  --green-mid:    #2d6a4f;
  --green-light:  #40916c;
  --gold:         #f5d060;
  --gold-dark:    #d4a017;
  --white:        #ffffff;
  --gray-50:      #f8fafc;
  --gray-100:     #f1f5f9;
  --gray-200:     #e2e8f0;
  --gray-400:     #94a3b8;
  --gray-600:     #475569;
  --gray-800:     #1e293b;
  --red:          #dc2626;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:       0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.15);
  --shadow-xl:    0 24px 64px rgba(0,0,0,.20);
  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    20px;
  --radius-xl:    28px;
  --radius-full:  9999px;
}

/* ── Touch targets (min 44×44px WCAG) ─────────────────────── */
button, .btn-zm, a.btn, input[type="submit"], [role="button"] {
  min-height: 44px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card-zm {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
  border: 1px solid rgba(0,0,0,.04);
}
.card-zm:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-zm {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-full);
  padding: 13px 26px;
  font-weight: 700; font-size: 15px;
  border: none; cursor: pointer; line-height: 1;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
  min-height: 48px;
}
.btn-zm:active { transform: scale(.97); }

.btn-zm-primary {
  background: linear-gradient(135deg, var(--green), var(--green-mid));
  color: var(--white);
}
.btn-zm-primary:hover {
  box-shadow: 0 8px 24px rgba(26,71,42,.4);
  transform: translateY(-2px);
  color: var(--white);
}

.btn-zm-gold {
  background: var(--gold);
  color: #1a1a1a;
  font-weight: 800;
}
.btn-zm-gold:hover {
  background: var(--gold-dark);
  box-shadow: 0 8px 24px rgba(245,208,96,.5);
  transform: translateY(-2px);
  color: #1a1a1a;
}

.btn-zm-outline {
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green);
}
.btn-zm-outline:hover {
  background: var(--green);
  color: var(--white);
}

.btn-zm-ghost {
  background: rgba(26,71,42,.08);
  color: var(--green);
}
.btn-zm-ghost:hover { background: rgba(26,71,42,.15); }

.btn-zm-sm { padding: 9px 18px; font-size: 13px; min-height: 38px; }
.btn-zm-lg { padding: 16px 40px; font-size: 17px; min-height: 56px; }
.btn-zm-block { width: 100%; }

/* ── Form Controls ─────────────────────────────────────────── */
.input-zm {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-800);
  transition: border-color .2s ease, box-shadow .2s ease;
  min-height: 52px;
  -webkit-appearance: none;
  appearance: none;
}
.input-zm:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 4px rgba(45,106,79,.12);
}
.input-zm::placeholder { color: var(--gray-400); }
.input-zm-error { border-color: var(--red) !important; }

.label-zm {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 7px;
}

.form-group-zm { margin-bottom: 18px; }

/* Input icon wrapper */
.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); pointer-events: none; font-size: 15px;
}
.input-icon-wrap .input-zm { padding-left: 44px; }

/* ── Badges ────────────────────────────────────────────────── */
.badge-zm {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700; line-height: 1.4;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-gold   { background: #fef9c3; color: #a16207; }
.badge-red    { background: #fee2e2; color: var(--red); }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

/* ── Section Headings ──────────────────────────────────────── */
.section-head {
  text-align: center;
  margin-bottom: 40px;
}
.section-head h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900;
  color: var(--gray-800);
  line-height: 1.2;
}
.section-head p {
  color: var(--gray-600);
  font-size: 15px;
  margin-top: 8px;
}
.section-line {
  width: 48px; height: 4px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: var(--radius-full);
  margin: 10px auto 0;
}

/* ── Animal / Product Card ─────────────────────────────────── */
.animal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,.05);
}
.animal-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}
.animal-img-wrap {
  position: relative;
  overflow: hidden;
  height: 200px;
  background: var(--gray-100);
  flex-shrink: 0;
}
.animal-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.animal-card:hover .animal-img-wrap img { transform: scale(1.07); }
.animal-img-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.35) 100%);
  pointer-events: none;
}
.price-pill {
  position: absolute; bottom: 12px; right: 12px;
  background: linear-gradient(135deg, var(--green), var(--green-mid));
  color: var(--gold);
  font-size: 13px; font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.cat-pill-sm {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,.92);
  color: var(--gray-800);
  font-size: 11px; font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(6px);
}
.animal-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.animal-name {
  font-weight: 800; font-size: 15px;
  color: var(--gray-800); margin-bottom: 6px;
  line-height: 1.3;
}
.animal-desc {
  font-size: 12px; color: var(--gray-600);
  flex: 1; line-height: 1.6; margin-bottom: 14px;
}
.btn-details {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(135deg, var(--green), var(--green-mid));
  color: var(--white);
  border-radius: var(--radius);
  padding: 11px; font-size: 13px; font-weight: 700;
  transition: transform .15s;
}
.btn-details:hover { transform: translateY(-1px); color: var(--white); }

/* ── Category Card ─────────────────────────────────────────── */
.cat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 12px;
  text-align: center;
  display: block;
  border: 2px solid transparent;
  transition: all .2s ease;
  box-shadow: var(--shadow-sm);
}
.cat-card:hover {
  border-color: var(--green);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}
.cat-icon {
  width: 60px; height: 60px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin: 0 auto 12px;
  transition: all .2s;
}
.cat-card:hover .cat-icon {
  background: linear-gradient(135deg, var(--green), var(--green-mid));
  transform: scale(1.1) rotate(-5deg);
}
.cat-label {
  font-size: 13px; font-weight: 700;
  color: var(--gray-800);
  line-height: 1.3;
}
.cat-card:hover .cat-label { color: var(--green); }

/* ── Feature Card ──────────────────────────────────────────── */
.feature-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 30px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  height: 100%;
  border: 1px solid rgba(0,0,0,.04);
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.feature-icon-wrap {
  width: 68px; height: 68px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 18px;
}
.feature-card h5 { font-weight: 800; font-size: 15px; margin-bottom: 9px; }
.feature-card p  { color: var(--gray-600); font-size: 13px; margin: 0; line-height: 1.65; }

/* ── Toast / Alert ─────────────────────────────────────────── */
.toast-zm {
  position: fixed; bottom: calc(80px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b; color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: all .3s ease;
  z-index: 9999; white-space: nowrap;
  max-width: calc(100vw - 32px);
}
.toast-zm.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Sticky bottom CTA bar ─────────────────────────────────── */
.sticky-bottom-cta {
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom));
  left: 0; right: 0;
  padding: 10px 16px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
  z-index: 1030;
  display: none;
}
@media (max-width: 767px) { .sticky-bottom-cta { display: block; } }

/* ── Snap scroll row ───────────────────────────────────────── */
.snap-scroll {
  display: flex; gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px; padding-top: 4px;
  scrollbar-width: none;
}
.snap-scroll::-webkit-scrollbar { display: none; }
.snap-scroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* ── Skeleton loader ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Page fade-in ──────────────────────────────────────────── */
.page-enter { animation: pageEnter .4s ease; }
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Spinner ───────────────────────────────────────────────── */
.spinner-zm {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal overlay ─────────────────────────────────────────── */
.overlay-zm {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1050;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.overlay-zm.show { display: flex; }
.modal-sheet {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  width: 100%; max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Divider ────────────────────────────────────────────────── */
.divider-text {
  display: flex; align-items: center; gap: 12px;
  color: var(--gray-400); font-size: 13px; font-weight: 600;
  margin: 20px 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px;
  background: var(--gray-200);
}

/* ── Alert boxes ────────────────────────────────────────────── */
.alert-zm {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  display: none; margin-top: 14px;
  line-height: 1.5;
}
.alert-zm.show { display: block; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #dc2626; }
.alert-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1d4ed8; }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #b45309; }

/* ── OTP digit inputs ───────────────────────────────────────── */
.otp-inputs {
  display: flex; gap: 8px; justify-content: center;
  margin: 18px 0;
}
.otp-digit {
  width: 52px; height: 60px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 24px; font-weight: 700;
  text-align: center; color: var(--green);
  background: var(--white);
  transition: all .2s; -webkit-appearance: none;
}
.otp-digit:focus {
  outline: none;
  border-color: var(--gold);
  background: #fffbeb;
  box-shadow: 0 0 0 4px rgba(245,208,96,.2);
}
@media (max-width: 400px) {
  .otp-digit { width: 44px; height: 52px; font-size: 20px; }
  .otp-inputs { gap: 6px; }
}

/* ── Hero section ───────────────────────────────────────────── */
.hero-section {
  min-height: 88vh;
  background: linear-gradient(150deg, var(--green-dark) 0%, var(--green) 45%, var(--green-mid) 80%, var(--green-light) 100%);
  display: flex; align-items: center;
  position: relative; overflow: hidden;
  padding: 80px 0 60px;
}
.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 85% 20%, rgba(245,208,96,.14) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 90%, rgba(64,145,108,.3) 0%, transparent 45%);
}
.hero-emoji-bg {
  position: absolute; right: -30px; bottom: -30px;
  font-size: clamp(160px, 28vw, 260px);
  opacity: .055; line-height: 1;
  pointer-events: none; user-select: none;
  filter: blur(1px);
}
.hero-title {
  font-size: clamp(1.9rem, 6vw, 3.8rem);
  font-weight: 900; color: var(--white);
  line-height: 1.1; letter-spacing: -.5px;
}
.hero-title span { color: var(--gold); }
.hero-sub {
  color: #b7e4c7;
  font-size: clamp(14px, 2.2vw, 17px);
  max-width: 520px; margin: 0 auto;
  line-height: 1.6;
}
.hero-badge {
  display: inline-block;
  background: rgba(245,208,96,.18);
  color: var(--gold);
  border: 1px solid rgba(245,208,96,.3);
  border-radius: var(--radius-full);
  padding: 6px 18px; font-size: 13px; font-weight: 700;
}
.hero-search {
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255,255,255,.22);
  border-radius: var(--radius-full);
  padding: 7px 7px 7px 20px;
  display: flex; align-items: center;
  max-width: 500px; margin: 0 auto;
  transition: border-color .2s;
}
.hero-search:focus-within { border-color: rgba(245,208,96,.6); }
.hero-search input {
  background: none; border: none; outline: none;
  color: var(--white); font-size: 15px; flex: 1;
  font-family: inherit; min-height: 40px;
}
.hero-search input::placeholder { color: rgba(255,255,255,.55); }
.hero-search button {
  background: var(--gold); color: #1a1a1a;
  border: none; border-radius: var(--radius-full);
  padding: 11px 22px; font-weight: 800;
  font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
  min-height: 42px;
}
.hero-search button:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(245,208,96,.5);
}
.hero-stat {
  text-align: center; padding: 14px 18px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 85px;
  transition: background .2s;
}
.hero-stat:hover { background: rgba(255,255,255,.16); }
.hero-stat .num  { font-size: 22px; font-weight: 900; color: var(--gold); line-height: 1; }
.hero-stat .lbl  { font-size: 11px; color: #b7e4c7; margin-top: 3px; }

/* ── Offer banner ──────────────────────────────────────────── */
.offer-banner {
  background: linear-gradient(135deg, #7c2d12, #b45309, #92400e);
  padding: 52px 0; position: relative; overflow: hidden;
}
.offer-banner::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg, rgba(255,255,255,.04) 0px,
    rgba(255,255,255,.04) 10px, transparent 10px, transparent 22px
  );
}
.offer-badge {
  display: inline-block;
  background: var(--gold); color: #1a1a1a;
  font-size: clamp(20px, 4vw, 34px);
  font-weight: 900; padding: 10px 26px;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  animation: pulseBadge 2s ease-in-out infinite;
}
@keyframes pulseBadge {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.05); }
}

/* ── Responsive breakpoints ────────────────────────────────── */
@media (max-width: 767px) {
  /* Stack everything for mobile */
  .hero-section { min-height: 92vh; padding: 72px 0 48px; text-align: center; }
  .hero-stat    { min-width: 72px; padding: 10px 12px; }
  .hero-stat .num { font-size: 19px; }
  .animal-img-wrap { height: 180px; }
  .offer-banner { padding: 40px 0; }
  .section-head { margin-bottom: 28px; }

  /* Snap-scroll product row on mobile */
  .row-snap-mobile {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin-right: -16px;
  }
  .row-snap-mobile::-webkit-scrollbar { display: none; }
  .row-snap-mobile > [class^="col"] {
    flex: 0 0 72vw;
    max-width: 72vw;
    scroll-snap-align: start;
  }

  .feature-card { padding: 24px 16px; }
}

@media (max-width: 479px) {
  .hero-title   { font-size: 1.75rem; }
  .hero-badge   { font-size: 12px; padding: 5px 14px; }
  .hero-stat    { min-width: 60px; padding: 8px 10px; }
  .hero-stat .num { font-size: 16px; }
  .cat-card     { padding: 18px 8px; }
  .cat-icon     { width: 50px; height: 50px; font-size: 22px; }
}

/* ── PWA Install button ─────────────────────────────────────── */
#pwa-install-btn {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 16px; right: 16px;
  max-width: 420px; margin: 0 auto;
  background: var(--green);
  color: var(--white);
  border: none; border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: none;
  align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 1035; cursor: pointer;
  animation: slideUp .4s ease;
  font-family: inherit;
}
#pwa-install-btn.show { display: flex; }
.pwa-icon { font-size: 28px; flex-shrink: 0; }
.pwa-text { flex: 1; text-align: left; line-height: 1.3; }
.pwa-text strong { display: block; font-size: 14px; font-weight: 800; }
.pwa-text span   { font-size: 11px; opacity: .75; }
.pwa-close {
  font-size: 20px; opacity: .6; flex-shrink: 0;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,.15);
}
.pwa-close:hover { opacity: 1; background: rgba(255,255,255,.25); }
