/* MedsNMore — e-commerce storefront (no build) */

:root {
  --navy: #12363d;
  --navy-deep: #0c262c;
  --ink: #1a2e32;
  --muted: #5d7176;
  --line: #e3ecee;
  --bg: #f5f8f8;
  --white: #ffffff;
  --brand: #0f7a62;
  --brand-deep: #0b5e4b;
  --rx: #2f6f8f;
  --sale: #c2410c;
  --gold: #c9a227;
  --danger: #b42318;
  --shadow: 0 8px 24px rgba(18, 54, 61, 0.07);
  --font: "Figtree", "Segoe UI", sans-serif;
  --font-display: "Figtree", "Segoe UI", sans-serif;
  --header-h: 76px;
  --catbar-h: 44px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--brand-deep); text-decoration: none; }
a:hover { color: var(--brand); }
button, input { font: inherit; }

.wrap {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
}

/* Shared auth / dashboard */
.brand {
  font-family: var(--font);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ico { display: block; flex-shrink: 0; }

.brand span { color: var(--brand); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--navy);
  color: #fff;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover { background: var(--navy-deep); color: #fff; }

.btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.secondary:hover { background: #f7fbfb; color: var(--ink); }

.btn.rx { background: var(--rx); }
.btn.rx:hover { background: #245a75; color: #fff; }

.btn.ghost-navy {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
}

.btn.ghost-navy:hover { background: #f4f8f8; color: var(--navy); }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.auth-card { width: min(420px, calc(100% - 2rem)); margin: 3rem auto; }

label { display: block; font-size: 0.9rem; margin-bottom: 0.35rem; font-weight: 600; }

input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 1rem;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}

.error { color: var(--danger); font-size: 0.9rem; margin: -0.5rem 0 1rem; }
.meta { color: var(--muted); font-size: 0.95rem; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

body:not(.is-home) {
  background: linear-gradient(180deg, #f7fbfb 0%, var(--bg) 100%);
}

/* ========== STORE HEADER ========== */
.topbar-brand {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar-brand .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.42rem 0;
}

.topbar-brand span { display: inline-flex; align-items: center; gap: 0.35rem; }
.topbar-brand .ico { width: 13px; height: 13px; }

.store-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(18, 54, 61, 0.04);
}

.header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  min-height: var(--header-h);
  padding: 0.7rem 0;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 46px;
  border: 1.5px solid #d5e0e3;
  border-radius: 999px;
  padding: 0 0.35rem 0 1rem;
  background: #fafcfc;
}

.header-search:focus-within {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 138, 106, 0.12);
}

.header-search .ico { flex-shrink: 0; color: var(--muted); }

.header-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  min-width: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.header-search input::placeholder { color: #8a9aa0; }

.header-search button {
  height: 36px;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.tool-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-width: 72px;
  color: var(--navy);
  font-weight: 650;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
}

.tool-link:hover { background: #f3f7f8; color: var(--brand-deep); }

.tool-link .ico { width: 20px; height: 20px; color: var(--navy); }

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--navy);
  position: relative;
}

.icon-btn:hover { background: #f3f7f8; color: var(--brand-deep); }

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--sale);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 11px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}

/* Category chip bar */
.catbar {
  border-top: 1px solid #eef3f4;
  background: #fff;
}

.catbar-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: var(--catbar-h);
}

.cat-scroll {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  flex: 1;
  padding: 0.35rem 0;
}

.cat-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem 0.22rem 0.28rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
  line-height: 1.2;
}

.cat-chip:hover,
.cat-chip.is-active {
  border-color: var(--navy);
  color: var(--navy);
  background: #f3f8f9;
}

.cat-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #e8f3ef;
  color: var(--brand-deep);
}

.cat-ico .ico { width: 13px; height: 13px; }

.cat-chip.is-active .cat-ico,
.cat-chip:hover .cat-ico {
  background: var(--brand);
  color: #fff;
}

.rail-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--navy);
  display: grid;
  place-items: center;
  padding: 0;
}

.rail-btn .ico { width: 13px; height: 13px; }
.rail-btn.prev .ico { transform: rotate(180deg); }

.rail-btn:hover { background: #f3f7f8; }

/* ========== STORE LAYOUT ========== */
.store-main { padding: 1.15rem 0 3.5rem; }

.store-grid {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 980px) {
  .store-grid {
    grid-template-columns: 250px 1fr;
    align-items: start;
  }
}

.cat-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cat-panel h2 {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--navy);
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
}

.cat-list { list-style: none; margin: 0; padding: 0.25rem 0; }

.cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.72rem 1rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 1px solid #f1f5f6;
}

.cat-list li:last-child a { border-bottom: 0; }

.cat-list a:hover { background: #f6fbfa; color: var(--navy); }

.cat-list .left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cat-list .cat-ico {
  width: 26px;
  height: 26px;
}

.cat-list .cat-ico .ico { width: 14px; height: 14px; }

.chev { color: #9aadb3; }
.chev .ico { width: 14px; height: 14px; }

/* Promo carousel */
.promo {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 340px;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.promo-track { display: grid; }

.promo-slide {
  grid-area: 1 / 1;
  min-height: 340px;
  display: grid;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
  background-size: cover;
  background-position: center;
}

.promo-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.promo-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 30, 38, 0.88) 0%, rgba(7, 30, 38, 0.45) 48%, rgba(7, 30, 38, 0.15) 100%);
}

.promo-copy {
  position: relative;
  z-index: 1;
  padding: 2rem 2.1rem;
  color: #fff;
  max-width: 34rem;
  align-self: center;
}

.promo-kicker {
  display: inline-block;
  background: rgba(15, 122, 98, 0.95);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.85rem;
}

.promo-copy h1,
.promo-copy h2 {
  font-family: var(--font);
  font-size: clamp(1.45rem, 2.8vw, 2.15rem);
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin: 0 0 0.55rem;
  color: #fff;
  font-weight: 700;
}

.promo-copy p {
  margin: 0 0 1.15rem;
  color: rgba(255, 255, 255, 0.86);
  max-width: 28rem;
}

.promo-dots {
  position: absolute;
  left: 2.1rem;
  bottom: 1.1rem;
  display: flex;
  gap: 0.4rem;
  z-index: 2;
}

.promo-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
}

.promo-dots button.is-active { background: #fff; width: 22px; border-radius: 999px; }

.promo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.promo-nav .ico { width: 16px; height: 16px; }
.promo-nav.prev .ico { transform: rotate(180deg); }

.promo-nav.prev { left: 12px; }
.promo-nav.next { right: 12px; }

/* Quick action tiles */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
  color: var(--ink);
}

.section-title a {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--brand-deep);
}

.action-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 800px) {
  .action-grid { grid-template-columns: repeat(4, 1fr); }
}

.action-card {
  min-height: 0;
  border-radius: 12px;
  padding: 1rem 1.05rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: none;
}

.action-card:hover {
  color: var(--navy);
  border-color: #c5d6d4;
  box-shadow: var(--shadow);
  transform: none;
}

.action-card small {
  display: block;
  font-weight: 500;
  opacity: 1;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.12rem;
}

.a-wa, .a-rx, .a-hc, .a-call { background: #fff; }

.action-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e8f3ef;
  color: var(--brand-deep);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.a-rx .action-ico { background: #e7f1f6; color: var(--rx); }
.a-hc .action-ico { background: #eef2f3; color: var(--navy); }
.a-call .action-ico { background: #f6eee8; color: #8f3d32; }
.a-wa .action-ico { background: #e7f5ee; color: #1b7a4a; }

.action-ico .ico { width: 18px; height: 18px; }

/* Product rails */
.product-rail {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 700px) {
  .product-rail { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1100px) {
  .product-rail { grid-template-columns: repeat(5, 1fr); }
}

.sku {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.sku:hover {
  box-shadow: var(--shadow);
  border-color: #c9d8d6;
  transform: none;
}

.sku-media {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f6f6;
  margin-bottom: 0.7rem;
  position: relative;
}

.sku-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #fff;
  color: var(--sale);
  border: 1px solid #f0d4c4;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.16rem 0.4rem;
  border-radius: 4px;
}

.badge.off {
  background: #fff;
  color: var(--brand-deep);
  border-color: #cfe4dc;
}

.sku-name {
  margin: 0 0 0.15rem;
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.sku-pack {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.sku-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
}

.sku-rating .ico { width: 12px; height: 12px; }
.sku-rating em {
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
}

.sku-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.sku-price b { font-size: 1rem; font-weight: 800; color: var(--navy); }
.sku-price s { color: #8ea0a5; font-size: 0.78rem; font-weight: 500; }
.sku-price .off { color: var(--brand-deep); font-size: 0.75rem; font-weight: 700; }

.sku .btn {
  width: 100%;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  margin-top: auto;
  background: #fff;
  color: var(--brand-deep);
  border: 1px solid #b7d4cb;
}

.sku .btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: none;
}

/* Category mosaic tiles */
.dept-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 700px) {
  .dept-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1100px) {
  .dept-grid { grid-template-columns: repeat(6, 1fr); }
}

.dept {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  color: var(--ink);
}

.dept:hover { color: var(--navy); box-shadow: var(--shadow); }

.dept img { width: 100%; height: 96px; object-fit: cover; }

.dept span {
  display: block;
  padding: 0.65rem 0.7rem 0.75rem;
  font-weight: 700;
  font-size: 0.84rem;
}

/* Trust strip */
.trust-strip {
  margin-top: 2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
}

@media (min-width: 800px) {
  .trust-strip { grid-template-columns: repeat(4, 1fr); }
}

.trust-item {
  padding: 1.05rem 1rem;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trust-item .ico {
  width: 20px;
  height: 20px;
  margin: 0.15rem 0 0;
  color: var(--brand);
  flex-shrink: 0;
}

.trust-copy { display: grid; gap: 0.1rem; }
.trust-item strong { display: block; color: var(--navy); font-size: 0.88rem; font-weight: 750; }
.trust-item span { color: var(--muted); font-size: 0.76rem; }

/* Footer */
.site-footer {
  background: #0e2428;
  color: rgba(255, 255, 255, 0.68);
  padding: 2.75rem 0 0;
}

.footer-grid {
  display: grid;
  gap: 1.75rem 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr 1.1fr; }
}

.site-footer .brand { color: #fff; margin-bottom: 0.7rem; }
.site-footer .brand span { color: #7ecfb6; }
.site-footer .brand-mark { background: var(--brand); }

.footer-about { margin: 0 0 0.9rem; max-width: 22rem; line-height: 1.6; font-size: 0.86rem; }

.footer-contact {
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
}

.footer-contact a {
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-contact .ico { width: 14px; height: 14px; }

.footer-col h4 {
  margin: 0 0 0.85rem;
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.footer-col a {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  margin-bottom: 0.42rem;
  font-weight: 500;
  font-size: 0.86rem;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.95rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.footer-bottom a { color: rgba(255, 255, 255, 0.5); }

.footer-legal {
  display: flex;
  gap: 1rem;
}

.fab-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: grid;
  gap: 0.55rem;
}

.fab {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.fab:hover { color: #fff; }
.fab .ico { width: 22px; height: 22px; }
.fab-ai { background: var(--navy); }
.fab-chat { background: #1b7a4a; }

.mobile-cats {
  display: none;
}

@media (max-width: 979px) {
  .header-main {
    grid-template-columns: auto 1fr auto;
  }

  .tool-link { min-width: 44px; padding: 0.4rem; }
  .tool-link span { display: none; }

  .cat-panel { display: none; }

  .nav-toggle { display: inline-flex; }

  .mobile-cats {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(7, 30, 38, 0.45);
  }

  body.nav-open .mobile-cats { display: block; }

  .mobile-cats-inner {
    width: min(320px, 86vw);
    height: 100%;
    background: #fff;
    overflow: auto;
  }
}

@media (max-width: 720px) {
  .header-search button { display: none; }
  .header-tools .btn { padding: 0.55rem 0.8rem; }
  .promo { min-height: 280px; }
  .promo-slide { min-height: 280px; }
  .promo-copy { padding: 1.4rem; }
  .topbar-brand .wrap span:last-child { display: none; }
}
