/* Mega Sale theme (Home / Categories / category listing) — scoped with .ms- so custom.css is untouched */
body.ms-theme,
body.ms-theme * {
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.ms-theme { background: #f3f3f3; color: #1a2024; -webkit-font-smoothing: antialiased; }
body.ms-theme #container { background: #fff; min-height: 100vh; box-shadow: 0 0 28px rgba(0, 0, 0, 0.08); }
body.ms-theme ::selection { background: #9f2089; color: #fff; }
.ms-theme a { text-decoration: none; color: inherit; }
.ms-theme button { cursor: pointer; }
.ms-page { padding-bottom: 84px; }
.ms-empty { padding: 40px 16px; text-align: center; color: #616173; font-size: 14px; margin: 0; }

/* Header */
.ms-header { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid #eaeaf2; animation: ms-header-in .5s cubic-bezier(.22, 1, .36, 1); }
@keyframes ms-header-in { from { transform: translateY(-64px); opacity: 0; } to { transform: none; opacity: 1; } }
.ms-header-row { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 56px; }
.ms-icon-btn { background: none; border: 0; padding: 8px; display: inline-flex; align-items: center; position: relative; color: #333; transition: transform .15s; }
.ms-icon-btn:active { transform: scale(0.9); }
.ms-brand { display: flex; align-items: center; gap: 6px; }
.ms-brand-name { font-family: "Fraunces", serif !important; font-style: italic; font-weight: 700; font-size: 22px; color: #570d48; letter-spacing: -0.5px; line-height: 1; }
.ms-header-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.ms-cart-count {
  position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #9f2089; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.ms-cart-count.d-none { display: none; }

/* Sale strip + hero */
.ms-sale-strip {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 16px;
  background: linear-gradient(90deg, #60014a, #9f2089, #60014a);
}
.ms-sale-live { color: #fff; font-weight: 800; font-style: italic; letter-spacing: 0.5px; font-size: 15px; display: inline-flex; gap: 5px; overflow: hidden; }
.ms-sale-live span { display: inline-block; animation: ms-reveal .7s cubic-bezier(.22, 1, .36, 1) both; }
.ms-sale-live span:nth-child(2) { animation-delay: .12s; }
.ms-sale-live span:nth-child(3) { animation-delay: .24s; }
@keyframes ms-reveal { from { transform: translateY(115%); } to { transform: none; } }
.ms-shop-now { background: #ff9d00; color: #570d48; font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 999px; animation: ms-pop .4s .55s both; }
@keyframes ms-pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
.ms-hero { position: relative; overflow: hidden; }
.ms-hero-slide { display: none; }
.ms-hero-slide.active { display: block; animation: ms-slide-in .6s ease-out; }
@keyframes ms-slide-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.ms-hero-slide img { width: 100%; aspect-ratio: 16/7; object-fit: cover; display: block; }
.ms-hero-slide-css { aspect-ratio: 16/7; background: linear-gradient(135deg, #ffb300, #ff9d00, #f57c00); }
.ms-hero-css-inner { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ms-hero-css-l1, .ms-hero-css-l2 { color: #fff; font-weight: 800; font-size: 26px; line-height: 1.1; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); letter-spacing: 1px; }
.ms-hero-css-off { margin-top: 6px; background: #fff; color: #570d48; font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 999px; }
.ms-hero-dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.ms-hero-dot { width: 6px; height: 6px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, 0.6); padding: 0; transition: width .3s, background-color .3s; }
.ms-hero-dot.active { width: 16px; background: #fff; }

/* Marquee */
.ms-promo-marquee { background: #60014a; color: #fff; overflow: hidden; padding: 6px 0; }
.ms-marquee-track { display: flex; width: max-content; animation: ms-marquee-x 26s linear infinite; }
.ms-marquee-copy { display: flex; white-space: nowrap; }
.ms-marquee-copy span { font-size: 12px; font-weight: 600; padding: 0 24px; color: #fff; }
@keyframes ms-marquee-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Trust badges */
.ms-trust-badges { width: 100%; margin-bottom: 8px; }
.ms-trust-badges img { display: block; width: 100%; height: auto; }

/* Category chip strip */
.ms-cat-strip { background: #fff; border-bottom: 1px solid #f3f3f7; }
.ms-cat-strip-row { display: flex; gap: 16px; overflow-x: auto; padding: 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
.ms-cat-strip-row::-webkit-scrollbar { display: none; }
.ms-chip { flex: 0 0 68px; width: 68px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: inherit; transition: transform .15s; }
.ms-chip:active { transform: scale(0.95); }
.ms-chip-disc { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #f6f6f9; display: flex; align-items: center; justify-content: center; }
.ms-chip-all { background: #fce9f3; }
.ms-chip-label { width: 100%; font-size: 13px; line-height: 1.2; color: #616173; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-chip.active .ms-chip-disc { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #9f2089; }
.ms-chip.active .ms-chip-label { color: #9f2089; font-weight: 700; }

/* Deals header */
.ms-deals-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #eaeaf2; }
.ms-deals-title { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: #333; }
.ms-timer-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #ffe8d6; color: #8a2a0b; font-size: 11px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px; font-variant-numeric: tabular-nums;
}

/* Product grid (homepage feed) */
.ms-section-title { padding: 16px 12px 8px; font-size: 15px; font-weight: 700; color: #1a2024; margin: 0; }
.ms-pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 8px 16px; }
.ms-pcard { background: #fff; border: 1px solid #eaeaf2; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; animation: ms-card-in .45s ease-out both; }
@keyframes ms-card-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.ms-pcard:nth-child(even) { animation-delay: .07s; }
.ms-pimg { position: relative; display: block; }
.ms-pimg img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fafafa; display: block; }
.ms-pbadge { position: absolute; top: 8px; left: 8px; color: #fff; font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 3px; line-height: 1.5; }
.ms-badge-best { background: #570d48; }
.ms-badge-hot { background: #9f2089; }
.ms-pbody { display: flex; flex-direction: column; flex: 1; padding: 8px; }
.ms-ptitle { font-size: 12px; line-height: 1.35; color: #616173; min-height: 32px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ms-price-row { margin-top: 4px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ms-price-row b { font-size: 15px; font-weight: 800; color: #000; }
.ms-price-row s { font-size: 11px; color: #adadc4; }
.ms-price-row i { font-size: 11px; font-weight: 700; color: #038d63; font-style: normal; }
.ms-pcard .ms-timer-pill { margin-top: 6px; align-self: stretch; }
.ms-buynow {
  margin-top: 8px; width: 100%; border: 0; border-radius: 6px;
  background: #9f2089; color: #fff; font-size: 13px; font-weight: 700; padding: 8px 0;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  transition: background-color .2s, transform .15s;
}
.ms-buynow:hover { background: #570d48; }
.ms-buynow:active { transform: scale(0.97); }
.ms-rate-row { margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.ms-rate-pill { display: inline-flex; align-items: center; gap: 2px; background: #038d63; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px; line-height: 1.4; }
.ms-rate-count { font-size: 10px; color: #adadc4; }
.ms-trusted { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; border: 1px solid #9f2089; border-radius: 999px; padding: 2px 6px 2px 2px; }
.ms-trusted b { font-size: 9px; color: #9f2089; }
.ms-feed-loader { display: flex; justify-content: center; padding: 24px 0; }
.ms-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #eaeaf2; border-top-color: #9f2089; animation: ms-spin .9s linear infinite; }
@keyframes ms-spin { to { transform: rotate(360deg); } }

/* Collection (category listing) card */
.ms-ccard { background: #fff; border: 1px solid #eaeaf2; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; color: inherit; transition: transform .15s; animation: ms-card-in .45s ease-out both; }
.ms-ccard:nth-child(even) { animation-delay: .07s; }
.ms-ccard:active { transform: scale(0.985); }
.ms-cimg { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fafafa; display: block; }
/* Listing card rows: sizes/weights/colours/gaps measured on the reference listing at 390px
   (title 10/600 one line, price 15/600 + 11/500 mrp + 11/500 off, offer 10/600 + 12px icon,
   Free Delivery 11/600, rating pill 13/600 + 10px star, count 11/500, Trusted at the right). */
.ms-ccard .ms-pbody { padding: 16px 5px 4px; }
.ms-ccard .ms-ptitle, .ms-ccard .ms-price-row b, .ms-ccard .ms-offer-mini, .ms-ccard .ms-offer-mini span, .ms-ccard .ms-free-mini, .ms-ccard .ms-rate-pill, .ms-ccard .ms-trusted b { font-family: "Mier demi", "Archivo", sans-serif; }
.ms-ccard .ms-price-row s, .ms-ccard .ms-price-row i, .ms-ccard .ms-rate-count { font-family: "Mier book", "Archivo", sans-serif; }
.ms-ccard .ms-ptitle { display: block; min-height: 0; font-size: 10px; font-weight: 600; line-height: 12px; color: #8b8ba3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-ccard .ms-price-row { margin: 5px 0; padding: 4px 0; gap: 4px; }
.ms-ccard .ms-price-row b { font-size: 15px; font-weight: 600; line-height: 20px; color: #353543; }
.ms-ccard .ms-price-row s { font-size: 11px; font-weight: 500; line-height: 16px; color: #8b8ba3; }
.ms-ccard .ms-price-row i { font-size: 11px; font-weight: 500; line-height: 16px; color: #353543; }
.ms-offer-mini { align-self: flex-start; max-width: 100%; display: inline-flex; align-items: center; gap: 4px; color: #038d63; font-size: 10px; font-weight: 600; line-height: 12px; padding: 2px 6px; border-radius: 48px; white-space: nowrap; overflow: hidden; }
.ms-offer-mini svg { flex: none; }
.ms-offer-mini span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ms-free-mini { margin-top: 10px; font-size: 11px; font-weight: 600; line-height: 12px; color: #616173; }
.ms-ccard .ms-rate-row { margin-top: 10px; gap: 0; }
.ms-ccard .ms-rate-pill { font-size: 13px; font-weight: 600; line-height: 16px; padding: 3px 6px; gap: 4px; border-radius: 16px; }
.ms-ccard .ms-rate-pill svg { width: 10px; height: 10px; }
.ms-ccard .ms-rate-count { font-size: 11px; font-weight: 500; line-height: 16px; color: #8b8ba3; padding: 0 4px; }
.ms-ccard .ms-trusted { height: 20px; padding: 0 6px 0 1px; gap: 3px; }
.ms-ccard .ms-trusted svg { width: 16px; height: 16px; }
.ms-ccard .ms-trusted b { font-size: 10px; }

/* Categories page */
.ms-page-title { padding: 16px 12px 12px; font-size: 16px; font-weight: 700; margin: 0; color: #1a2024; }
.ms-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 12px; }
.ms-cat-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .15s; animation: ms-card-in .35s ease-out both; }
.ms-cat-tile:nth-child(2) { animation-delay: .05s; } .ms-cat-tile:nth-child(3) { animation-delay: .1s; }
.ms-cat-tile:nth-child(4) { animation-delay: .15s; } .ms-cat-tile:nth-child(5) { animation-delay: .2s; }
.ms-cat-tile:nth-child(6) { animation-delay: .25s; } .ms-cat-tile:nth-child(7) { animation-delay: .3s; }
.ms-cat-tile:nth-child(8) { animation-delay: .35s; } .ms-cat-tile:nth-child(n+9) { animation-delay: .4s; }
.ms-cat-tile:active { transform: scale(0.94); }
.ms-cat-img { width: 80px; height: 80px; border-radius: 999px; overflow: hidden; border: 2px solid #eaeaf2; display: block; }
.ms-cat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-cat-name { font-size: 11px; font-weight: 600; color: #333; text-align: center; line-height: 1.3; }

/* Toast */
.ms-toast {
  position: fixed; top: 16px; left: 50%; transform: translate(-50%, -80px);
  background: #1a2024; color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 8px; z-index: 9999999; transition: transform .3s;
  max-width: 90%; text-align: center; pointer-events: none;
}
.ms-toast.show { transform: translate(-50%, 0); }
