:root {
  --green: #075840;
  --green-mid: #158752;
  --ink: #141815;
  --muted: #5a625e;
  --paper: #f7f8f7;
  --surface: #ffffff;
  font: 16px/1.5 Arial, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; padding: 0; background: none; }
button, h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--green-mid); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header: transparent over hero, sticky white on scroll */
.header {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 8%; gap: 2vw;
  background: linear-gradient(#ffffffd6, #ffffff6e 75%, transparent);
  transition: background-color .28s ease, box-shadow .28s ease, padding .28s ease;
}
.header.scrolled {
  background: #fffffff5;
  box-shadow: 0 4px 20px #07584014;
  padding: 12px 8%;
}
.brand { flex: 0 0 13.5%; }
.header nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1.4vw;
  font-size: clamp(12px, .92vw, 16px); white-space: nowrap;
}
.header nav a, .header nav button { transition: color .22s ease, background-color .22s ease, transform .22s ease; }
.header nav a:hover, .header nav button:hover, .header nav a.active { color: var(--green); font-weight: 700; }
.nav-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border-radius: 50px; background: #ffffffcc; padding: .35em 1.25em; border: 1px solid #0758401a;
}
.nav-pill:hover { background: #ffffff; transform: translateY(-1px); box-shadow: 0 4px 12px #07584018; }
.icon { display: grid; place-items: center; width: 36px; height: 36px; font-size: 1.1rem; }
.menu { display: none; }

/* Full-Bleed Hero Banner */
.page-ban {
  position: relative; width: 100%; height: clamp(300px, 36vw, 520px); overflow: hidden;
  background: #dce8e1;
}
.page-ban::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, #ffffff26 0%, transparent 45%, #06221838 100%);
}
.page-ban img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }

/* Overlapping Category Card + Filter Card (84% container like Sealy Studio) */
.cp-wrapper { width: 84%; max-width: 1560px; margin: 0 auto; position: relative; z-index: 2; }

.cp-top {
  display: flex; align-items: center; background: var(--surface);
  margin-top: -46px; min-height: 82px; padding: 0 2.6%;
  border-radius: 6px; box-shadow: 0 8px 30px #07584014;
}
.cp-brand { flex: 0 0 15.5%; padding-right: 2%; border-right: 1px solid #e9eeeb; }
.cp-brand img { max-height: 38px; width: auto; }
.cp-tabs {
  flex: 1; display: flex; align-items: stretch; justify-content: space-around;
  gap: .5vw; padding-left: 1.5%; overflow-x: auto; scrollbar-width: none;
}
.cp-tabs::-webkit-scrollbar { display: none; }
.cp-tab {
  position: relative; padding: 26px 12px; font-size: clamp(13px, .95vw, 16px);
  color: #4f5753; white-space: nowrap; transition: color .2s ease;
}
.cp-tab:hover { color: var(--green); }
.cp-tab.active { color: var(--green); font-weight: 700; }
.cp-tab.active::after {
  content: ''; position: absolute; left: 20%; right: 20%; bottom: 0;
  height: 3px; background: var(--green); border-radius: 2px;
}

/* Collapsible 5-Row Filter Card */
.cp-filter-wrap { position: relative; margin-top: 12px; }
.cp-filter {
  background: var(--surface); border-radius: 6px; box-shadow: 0 8px 28px #07584010;
  padding: 20px 3% 32px; overflow: hidden;
  transition: max-height .35s ease, padding .35s ease, opacity .25s ease;
  max-height: 520px;
}
.cp-filter.collapsed { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; pointer-events: none; }
.filter-row {
  display: grid; grid-template-columns: 108px 1fr; align-items: baseline;
  gap: 14px; padding: 11px 0; border-bottom: 1px dashed #ebf0ed;
  font-size: clamp(13px, .92vw, 15px);
}
.filter-row:last-child { border-bottom: 0; }
.filter-label {
  display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink);
}
.filter-label::before {
  content: ''; width: 6px; height: 6px; background: var(--green); flex: none;
}
.filter-options { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.filter-opt {
  padding: 4px 2px; color: #565f5a; border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.filter-opt:hover { color: var(--green); }
.filter-opt.active { color: var(--green); font-weight: 700; border-bottom-color: var(--green); }

.filter-expand {
  position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  left: 50%; transform: translate(-50%, -50%);
  background: var(--green); color: white; font-size: 12px; font-weight: 700;
  padding: 7px 24px; border-radius: 50px; box-shadow: 0 4px 14px #07584038;
  transition: background-color .22s ease, transform .22s ease;
}
.filter-expand:hover { background: var(--green-mid); }
.filter-expand i { font-size: 11px; transition: transform .25s ease; }
.filter-expand[aria-expanded="false"] i { transform: rotate(180deg); }

/* Result Count */
.cp-list-total {
  margin: 4px 0 26px; font-size: 15px; color: var(--muted); letter-spacing: .01em;
}
.cp-list-total strong { color: var(--green); }

/* 3-Column Product Showcase Grid */
.cp-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 26px;
}
.cp-card {
  background: var(--surface); border-radius: 10px; padding: 20px 20px 28px;
  text-align: center; display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 4px 18px #0758400a; border: 1px solid #eef2ef;
  transition: transform .28s ease, box-shadow .28s ease;
}
.cp-card:hover { transform: translateY(-5px); box-shadow: 0 14px 30px #0758401a; }
.cp-thumb {
  width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: #f3f6f4;
}
.cp-thumb img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease;
}
.cp-card:hover .cp-thumb img { transform: scale(1.05); }
.cp-card h3 {
  margin-top: 20px; font-size: clamp(15px, 1.08vw, 18px); font-weight: 700; color: var(--ink);
  line-height: 1.35;
}
.cp-sub { margin-top: 6px; font-size: 13px; color: #67706b; }
.cp-more-btn {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 24px; border-radius: 50px; background: #c5cdc9; color: white;
  font-size: 12.5px; font-weight: 700; letter-spacing: .03em; transition: background-color .24s ease, transform .24s ease;
}
.cp-card:hover .cp-more-btn, .cp-more-btn:hover { background: var(--green); }
.cp-card:hover .cp-more-btn i { transform: translateX(3px); }
.cp-more-btn i { transition: transform .24s ease; }

.cp-empty {
  grid-column: 1 / -1; text-align: center; padding: 56px 20px;
  background: var(--surface); border-radius: 10px; color: var(--muted);
}

/* MORE Pagination Pill */
.cp-more-wrap { text-align: center; margin: 54px 0 76px; }
.more-pill {
  min-width: 196px; padding: 12px 40px; border-radius: 50px;
  border: 1px solid var(--green); color: var(--green); background: var(--surface);
  font-size: 13px; font-weight: 700; letter-spacing: .16em;
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
}
.more-pill:hover { background: var(--green); color: white; transform: translateY(-2px); }

/* Full-Bleed Mattress Selector CTA Banner */
.cp-zl {
  position: relative; min-height: clamp(320px, 29vw, 440px);
  display: grid; place-items: center; text-align: center; color: white; padding: 54px 6%;
  background:
    linear-gradient(120deg, #04281ae0, #075840b8),
    url('../images/home-service.jpg') center / cover no-repeat;
}
.cp-zl-inner { max-width: 640px; display: flex; flex-direction: column; align-items: center; }
.cp-zl h2 { font-size: clamp(26px, 2.25vw, 40px); font-weight: 700; letter-spacing: -.01em; }
.cp-zl-line { width: 34px; height: 2px; background: #ffffffcc; margin: 18px 0; }
.cp-zl p { font-size: clamp(14px, 1vw, 17px); max-width: 540px; color: #e2eee7; line-height: 1.65; }
.cp-zl-btn {
  margin-top: 28px; padding: 12px 34px; border-radius: 50px;
  border: 1px solid #ffffffcc; color: white; font-size: 14px; font-weight: 700;
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
}
.cp-zl-btn:hover { background: white; color: var(--green); transform: translateY(-2px); }

/* Footer (consistent with RIPPLE homepage) */
footer { background: #042f1c; color: white; padding: 2.6vw 5.7% 4.2vw; font-size: clamp(13px,.9vw,18px); }
.footer-top, .footer-contact, .footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1.5em; }
.footer-top { padding-bottom: 1.6vw; border-bottom: 1px solid #ffffff3b; }
.footer-brand { position: relative; padding-left: 4.4em; line-height: 1; }
.footer-brand::before { content: ''; background: url('../images/logo.png') center / contain no-repeat; position: absolute; left: 0; top: 0; width: 3.9em; height: 3em; }
.footer-brand strong { font-size: 2.3em; letter-spacing: .09em; display: block; }
.footer-brand sup { font-size: .35em; }
.footer-brand small { display: block; letter-spacing: .29em; margin-top: .5em; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .7em;
  border: 1px solid currentColor; border-radius: 100px; padding: .45em 1.15em;
  font-size: clamp(13px,.9vw,18px); font-weight: 700; color: var(--green);
  background: white; width: fit-content; transition: transform .22s ease, box-shadow .22s ease;
}
.pill span { display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; color: white; background: var(--green); line-height: 1; }
.pill:hover { transform: translateY(-2px); box-shadow: 0 6px 16px #00000028; }
.footer-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 1rem; margin-top: 2vw; }
.footer-grid h3 { font-size: 1em; margin-bottom: 1em; }
.footer-grid a, .footer-grid button { display: block; margin: .65em 0; color: #d8e4dc; text-align: left; }
footer a:hover, footer button:hover { text-decoration: underline; }
.footer-contact { justify-content: start; margin: 2.5vw 0 2.1vw; gap: 6vw; }
.footer-contact small { display: block; }
.phone { display: block; margin-top: .45em; font-size: 1.55em; font-weight: bold; }
.social { display: flex; gap: .85em; margin-top: .9em; }
.social button { border: 1px solid #ffffff45; width: 2.3em; aspect-ratio: 1; border-radius: 50%; transition: background-color .22s ease, color .22s ease; }
.social button:hover { background: white; color: #042f1c; text-decoration: none; }
.chat { margin-left: auto; }
.footer-bottom { padding-top: 1.8vw; border-top: 1px solid #ffffff3b; }
.footer-bottom div { display: flex; gap: 1em; flex-wrap: wrap; }

/* Fixed Floating Quick-Action Toolbar */
.tools {
  position: fixed; right: 16px; bottom: 90px; z-index: 15;
  display: flex; flex-direction: column; gap: 2px;
}
.tools button {
  width: 56px; height: 56px; background: var(--green); color: white;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 10px; border-radius: 4px; box-shadow: 0 4px 12px #07584030;
  transition: background-color .22s ease, transform .22s ease;
}
.tools button:hover { background: var(--green-mid); transform: translateX(-2px); }
.tools button i { font-size: 16px; }

/* Dialogs */
dialog { width: min(560px, calc(100% - 32px)); max-height: 85dvh; border: 0; border-radius: 18px; padding: 2.2rem 1.6rem 1.6rem; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #062c20a0; }
dialog .close { position: absolute; top: .4rem; right: .6rem; font-size: 1.75rem; }
dialog img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin-bottom: 1em; }
dialog img[hidden] { display: none; }
dialog p { margin: .8em 0; }
.pd-meta { font-size: 12px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .06em; }
.pd-specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0 18px; font-size: 13px; }
.pd-specs div { background: white; padding: 8px 12px; border-radius: 8px; }
.pd-specs span { display: block; font-size: 11px; color: var(--muted); }
dialog input { width: 100%; font: inherit; padding: .65em; border: 1px solid #a3bcb0; border-radius: 8px; margin: 1em 0; }
.search-results button, .search-results a { display: block; padding: .45em 0; text-align: left; color: var(--green); }

@media (max-width: 1100px) {
  .menu { display: grid; }
  .header { padding: 14px 5%; background: #fffffff5; }
  .brand { flex-basis: clamp(145px,22vw,215px); }
  .header nav { display: none; position: absolute; top: 100%; right: 5%; width: min(325px,90vw); padding: 1em; border-radius: 14px; background: #f7fff9; box-shadow: 0 5px 18px #0002; font-size: 15px; }
  .header nav.open { display: grid; gap: .5em; }
  .header nav > * { justify-content: start; padding: .45em .75em; }
  .cp-wrapper { width: 92%; }
}

@media (max-width: 700px) {
  body { padding-bottom: 58px; }
  .page-ban { height: 220px; margin-top: 56px; }
  .cp-top { margin-top: -28px; min-height: 58px; padding: 0 12px; }
  .cp-brand { display: none; }
  .cp-tabs { padding-left: 0; justify-content: flex-start; gap: 14px; }
  .cp-tab { padding: 16px 4px; font-size: 13px; }
  .filter-row { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; }
  .filter-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 8px; }
  .cp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .cp-card { padding: 12px 10px 16px; }
  .cp-more-btn { padding: 6px 14px; font-size: 11px; }
  footer { padding: 26px 5%; }
  .footer-top { padding-bottom: 18px; }
  .footer-brand strong { font-size: 1.7em; }
  .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 24px; }
  .footer-contact { flex-wrap: wrap; align-items: start; gap: 20px; margin: 20px 0; }
  .chat { margin-left: 0; }
  .footer-bottom { flex-wrap: wrap; gap: 12px; padding-top: 18px; }
  .tools {
    right: 0; left: 0; bottom: 0; flex-direction: row; gap: 0;
    background: var(--green); border-top: 1px solid #ffffff30;
  }
  .tools button { flex: 1; width: auto; height: 54px; border-radius: 0; border-right: 1px solid #ffffff26; flex-direction: row; gap: 6px; font-size: 12px; }
  .tools .back-top { display: none !important; }
}
[hidden] { display: none !important; }
