/* ==========================================================================
   Meesho Times — main stylesheet
   Design tokens live at the top as CSS variables so the whole look can be
   retuned from one place.
   ========================================================================== */

:root {
  /* Colors */
  --color-bg: #fffbf7;
  --color-bg-alt: #fdf1ea;
  --color-surface: #ffffff;
  --color-text: #241b2f;
  --color-text-soft: #6a6275;
  --color-border: #efe3db;

  --color-brand: #6b2145;
  --color-brand-dark: #4a1730;
  --color-brand-tint: #f6e9ee;

  --color-amazon: #cc6b1c;
  --color-amazon-tint: #fbeee0;
  --color-meesho: #c2185b;
  --color-meesho-tint: #fbe4ec;

  --color-success: #2e7d4f;
  --color-success-tint: #e5f3ea;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --max-width: 1200px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(36, 27, 47, 0.06), 0 8px 24px rgba(36, 27, 47, 0.06);
  --shadow-card-hover: 0 4px 10px rgba(36, 27, 47, 0.08), 0 16px 32px rgba(36, 27, 47, 0.1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, button { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; }
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 251, 247, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-brand-dark);
}
.brand-mark {
  color: var(--color-brand);
}
.brand-tagline {
  display: none;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-soft);
}
@media (min-width: 720px) {
  .brand-tagline { display: inline; }
}

.main-nav {
  display: none;
  gap: 28px;
}
.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--color-brand);
  border-color: var(--color-brand);
}
@media (min-width: 900px) {
  .main-nav { display: flex; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-search {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 220px;
}
.header-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  width: 100%;
  color: var(--color-text);
}
.header-search svg { flex-shrink: 0; color: var(--color-text-soft); }
@media (min-width: 900px) {
  .header-search { display: flex; }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}
.icon-btn:hover { border-color: var(--color-brand); color: var(--color-brand); }

.hamburger-btn { display: inline-flex; }
@media (min-width: 900px) {
  .hamburger-btn { display: none; }
}
.search-toggle-btn { display: inline-flex; }
@media (min-width: 900px) {
  .search-toggle-btn { display: none; }
}

/* Mobile panel */
.mobile-panel {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 14px 20px 18px;
  display: none;
}
.mobile-panel.is-open { display: block; }
.mobile-panel .header-search {
  display: flex;
  min-width: 0;
  margin-bottom: 14px;
}
.mobile-panel nav a {
  display: block;
  padding: 10px 4px;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}
.mobile-panel nav a:last-child { border-bottom: none; }
@media (min-width: 900px) {
  .mobile-panel { display: none !important; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 44px 0 36px;
  border-bottom: 1px solid var(--color-border);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--color-brand-tint) 0%, transparent 55%),
    var(--color-bg);
}
.hero-grid {
  display: grid;
  gap: 28px;
}
@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}
.hero-eyebrow {
  color: var(--color-brand);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 10px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.08;
  color: var(--color-brand-dark);
  max-width: 14ch;
}
.hero-sub {
  margin-top: 14px;
  font-size: 1.05rem;
  color: var(--color-text-soft);
  max-width: 46ch;
}
.hero-search {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  max-width: 520px;
}
.hero-search input {
  flex: 1;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 1rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 13px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--color-brand);
  color: #fff;
}
.btn-primary:hover { background: var(--color-brand-dark); }
.btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover { border-color: var(--color-brand); color: var(--color-brand); }

.hero-stats {
  display: flex;
  gap: 26px;
  margin-top: 28px;
}
.hero-stats div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-brand-dark);
}
.hero-stats div span {
  font-size: 0.82rem;
  color: var(--color-text-soft);
}

.hero-visual {
  position: relative;
  display: grid;
  gap: 14px;
}
.hero-tile {
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}
.hero-tile.amazon { border-left: 4px solid var(--color-amazon); }
.hero-tile.meesho { border-left: 4px solid var(--color-meesho); margin-left: 26px; }
.hero-tile-label { font-size: 0.78rem; color: var(--color-text-soft); margin-bottom: 6px; }
.hero-tile-price { font-family: var(--font-display); font-size: 1.4rem; color: var(--color-brand-dark); }

/* ---------- Section shell ---------- */
.section {
  padding: 44px 0;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--color-brand-dark);
}
.section-head p {
  color: var(--color-text-soft);
  margin-top: 6px;
  font-size: 0.95rem;
}

/* ---------- Categories ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .category-grid { grid-template-columns: repeat(5, 1fr); }
}
.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.category-card:hover { border-color: var(--color-brand); transform: translateY(-2px); }
.category-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--color-brand-tint);
  color: var(--color-brand);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.category-card span {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  align-items: center;
}
.filter-chip {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}
.filter-chip:hover { border-color: var(--color-brand); }
.filter-chip.is-active {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
}
.filter-bar select {
  margin-left: auto;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--color-surface);
  font-size: 0.85rem;
  color: var(--color-text);
}
.filter-clear {
  font-size: 0.85rem;
  color: var(--color-brand);
  font-weight: 600;
  background: none;
  border: none;
  padding: 9px 4px;
}

/* ---------- Product grid & cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.product-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-bg-alt);
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }

.store-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
}
.store-badge.amazon { background: var(--color-amazon); }
.store-badge.meesho { background: var(--color-meesho); }

.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--color-success);
  color: #fff;
}

.featured-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--color-brand);
  color: #fff;
}

.product-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.product-category {
  font-size: 0.72rem;
  color: var(--color-text-soft);
  font-weight: 600;
}
.product-name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}
.product-desc {
  font-size: 0.8rem;
  color: var(--color-text-soft);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}
.price-now {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-brand-dark);
}
.price-old {
  font-size: 0.82rem;
  color: var(--color-text-soft);
  text-decoration: line-through;
}

.deal-btn {
  margin-top: 10px;
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  color: #fff;
  text-align: center;
}
.deal-btn.amazon { background: var(--color-amazon); }
.deal-btn.amazon:hover { background: #a8560f; }
.deal-btn.meesho { background: var(--color-meesho); }
.deal-btn.meesho:hover { background: #9c1249; }

/* ---------- Empty state ---------- */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-soft);
}
.empty-state h3 {
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 6px;
}
.empty-state button {
  margin-top: 16px;
}

/* ---------- Skeleton loading ---------- */
.skeleton-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.skeleton-media, .skeleton-line {
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, #f3e6dc 37%, var(--color-bg-alt) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
.skeleton-media { aspect-ratio: 1 / 1; }
.skeleton-line { height: 12px; margin: 14px 14px 0; border-radius: 6px; }
.skeleton-line.short { width: 55%; margin-bottom: 14px; }
@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-media, .skeleton-line { animation: none; }
}

/* ---------- Info strip (disclosure / contact) ---------- */
.info-section {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.info-grid {
  display: grid;
  gap: 24px;
}
@media (min-width: 760px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
}
.info-card h3 {
  font-size: 1.1rem;
  color: var(--color-brand-dark);
  margin-bottom: 8px;
}
.info-card p {
  color: var(--color-text-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}
.contact-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.contact-form input,
.contact-form textarea {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.9rem;
  width: 100%;
}
.contact-form textarea { resize: vertical; min-height: 90px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0 26px;
}
.footer-grid {
  display: grid;
  gap: 28px;
}
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p {
  color: var(--color-text-soft);
  font-size: 0.88rem;
  max-width: 40ch;
  line-height: 1.6;
}
.footer-col h4 {
  font-size: 0.85rem;
  margin-bottom: 12px;
  color: var(--color-text-soft);
}
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { font-size: 0.9rem; }
.footer-col a:hover { color: var(--color-brand); }
.footer-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-text-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: var(--color-brand-dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   MOBILE COMFORT — tuned for phones (touch targets, no iOS zoom-on-focus,
   breathing room, scrollable filter row instead of cramped wrapping)
   ========================================================================== */
@media (max-width: 640px) {
  /* Prevent iOS Safari from auto-zooming when a field is focused. */
  input, select, textarea, button {
    font-size: 16px;
  }

  .container { padding: 0 16px; }

  .header-row { padding: 12px 0; }
  .brand { font-size: 1.25rem; }

  .hero { padding: 32px 0 26px; }
  .hero-sub { font-size: 0.96rem; }
  .hero-stats { gap: 18px; flex-wrap: wrap; row-gap: 10px; }
  .hero-visual { display: none; } /* decorative on mobile — keeps the fold focused on the search */

  .hero-search {
    max-width: none;
  }
  @media (max-width: 400px) {
    .hero-search { flex-direction: column; }
    .hero-search .btn { width: 100%; }
  }

  .section { padding: 32px 0; }
  .section-head { margin-bottom: 16px; }

  .category-grid { gap: 10px; }
  .category-card { padding: 16px 12px; }

  /* Filter chips scroll horizontally instead of wrapping messily;
     sort + clear drop to their own full-width row underneath. */
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    margin-bottom: 16px;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar .filter-chip { flex-shrink: 0; }
  .filter-bar select,
  .filter-bar .filter-clear {
    flex-shrink: 0;
  }
  .filter-bar select { margin-left: 0; }

  .product-grid { gap: 12px; }
  .product-body { padding: 12px; gap: 5px; }
  .product-name { font-size: 0.88rem; }
  .product-desc { font-size: 0.78rem; }
  .price-now { font-size: 1.05rem; }
  .deal-btn { padding: 12px 14px; font-size: 0.86rem; } /* comfortably tappable */

  .info-section .section { padding: 32px 0; }
  .info-grid { gap: 20px; }

  .site-footer { padding: 32px 0 22px; }
  .footer-grid { gap: 22px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}

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