/* robot-home-commerce — iRobot-inspired independent storefront shell */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--rh-bg, #fff);
  color: var(--rh-text, #111);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

.rh-wrap {
  width: min(100% - 2.5rem, var(--rh-max, 1280px));
  margin-inline: auto;
}

/* —— Promo carousel (black) —— */
.rh-promo {
  background: var(--rh-promo-bg, #000);
  color: var(--rh-promo-text, #fff);
  position: relative;
  overflow: hidden;
  min-height: 42px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.rh-promo__track {
  width: min(920px, 100% - 4rem);
  position: relative;
  min-height: 1.4em;
}

.rh-promo__slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
  padding: 0.65rem 0;
}

.rh-promo__slide.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  position: relative;
}

.rh-promo a { text-decoration: underline; text-underline-offset: 3px; }

/* —— Header —— */
.rh-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

.rh-header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.95rem 0;
}

.rh-logo {
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
  line-height: 1;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.rh-logo span {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #777;
  margin-top: 0.2rem;
}

.rh-logo--img {
  display: inline-flex;
  align-items: center;
}

.rh-logo--img img {
  display: block;
  height: 36px;
  width: auto;
}

.rh-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 0.15rem 1.35rem;
  flex-wrap: wrap;
}

.rh-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.rh-nav a:hover {
  border-bottom-color: #111;
}

.rh-header__tools {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.rh-tool {
  font-size: 0.86rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.9;
}

.rh-tool:hover { opacity: 1; }

.rh-bag-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
}

/* —— Buttons —— */
.rh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1.5px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rh-btn--solid {
  background: #111;
  color: #fff;
  border-color: #111;
}

.rh-btn--solid:hover { background: #000; }

.rh-btn--outline {
  background: transparent;
  color: #111;
  border-color: #111;
}

.rh-btn--outline:hover { background: #111; color: #fff; }

.rh-btn--ghost-light {
  background: transparent;
  color: #fff;
  border-color: #fff;
}

.rh-btn--ghost-light:hover { background: #fff; color: #111; }

.rh-btn--solid-light {
  background: #fff;
  color: #111;
  border-color: #fff;
}

.rh-btn--solid-light:hover { background: #f2f2f2; }

/* —— Hero carousel —— */
.rh-hero {
  position: relative;
  background: #111;
  color: #fff;
  min-height: min(78vh, 760px);
  overflow: hidden;
}

.rh-hero__slides { position: absolute; inset: 0; }

.rh-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}

.rh-hero__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.rh-hero__media {
  position: absolute;
  inset: 0;
}

.rh-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
}

.rh-hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.35) 42%,
    rgba(0, 0, 0, 0.12) 100%
  );
}

.rh-hero__content {
  position: relative;
  z-index: 2;
  min-height: min(78vh, 760px);
  display: flex;
  align-items: flex-end;
  padding: 4.5rem 0 3.5rem;
}

.rh-hero__eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
  opacity: 0.92;
}

.rh-hero__brand {
  margin: 0 0 0.75rem;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 700;
  max-width: 11ch;
}

.rh-hero__sub {
  margin: 0 0 1.5rem;
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.rh-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.rh-hero__dots {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
}

.rh-hero__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.rh-hero__dot.is-active { background: #fff; }

/* —— Sections —— */
.rh-section {
  padding: 3.25rem 0;
}

.rh-section--soft { background: #f6f6f6; }

.rh-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.rh-section__title {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  letter-spacing: -0.03em;
  font-weight: 700;
}

.rh-section__link {
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 1px solid #111;
}

/* —— Product rail —— */
.rh-rail {
  position: relative;
}

.rh-rail__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.rh-rail__track {
  display: flex;
  gap: 1rem;
  padding-bottom: 0.35rem;
}

.rh-rail__btn {
  position: absolute;
  top: 38%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.rh-rail__btn--prev { left: -0.4rem; }
.rh-rail__btn--next { right: -0.4rem; }

@media (max-width: 900px) {
  .rh-rail__btn { display: none; }
}

/* —— Product tile (iRobot-like) —— */
.rh-tile {
  flex: 0 0 min(280px, 78vw);
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #ececec;
}

.rh-tile__media {
  aspect-ratio: 1;
  background: #f3f3f3;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.rh-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rh-tile__body {
  padding: 1rem 1rem 1.15rem;
  display: grid;
  gap: 0.45rem;
}

.rh-tile__badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c8102e;
}

.rh-tile__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  min-height: 2.6em;
}

.rh-tile__rating {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.8rem;
  color: #666;
}

.rh-tile__stars { letter-spacing: 0.05em; color: #111; }

.rh-tile__price {
  font-weight: 700;
  font-size: 1rem;
}

.rh-tile__compare {
  margin-left: 0.4rem;
  color: #888;
  font-weight: 500;
  text-decoration: line-through;
  font-size: 0.9rem;
}

.rh-tile__shop {
  font-size: 0.86rem;
  font-weight: 600;
  border-bottom: 1px solid #111;
  justify-self: start;
  margin-top: 0.2rem;
}

/* Shop grid variant */
.rh-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

.rh-grid .rh-tile {
  flex: none;
  width: auto;
}

/* —— Category shop tiles —— */
.rh-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.rh-cat {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  background: #1a1a1a;
  color: #fff;
  display: block;
}

.rh-cat img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transition: transform 0.55s ease, opacity 0.35s ease;
}

.rh-cat:hover img {
  transform: scale(1.04);
  opacity: 0.85;
}

.rh-cat__label {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem;
  background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.7));
}

.rh-cat__label h3 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.rh-cat__label p {
  margin: 0;
  opacity: 0.88;
  font-size: 0.92rem;
}

/* —— Accessory / marketing banner —— */
.rh-banner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 320px;
  background: #111;
  color: #fff;
  overflow: hidden;
}

.rh-banner__copy {
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.rh-banner__copy h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.035em;
  max-width: 14ch;
}

.rh-banner__copy p {
  margin: 0;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.84);
}

.rh-banner__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 320px;
}

/* —— Why buy —— */
.rh-why {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.rh-why__item {
  background: #fff;
  border: 1px solid #ececec;
  overflow: hidden;
}

.rh-why__item img {
  aspect-ratio: 3 / 2;
  width: 100%;
  object-fit: cover;
  background: #eee;
}

.rh-why__item h3 {
  margin: 0;
  padding: 1rem 1rem 0.25rem;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.rh-why__item p {
  margin: 0;
  padding: 0 1rem 1.15rem;
  color: #666;
  font-size: 0.88rem;
}

/* —— Newsletter —— */
.rh-news {
  background: #f0f0f0;
  padding: 2.75rem 0;
  text-align: center;
}

.rh-news h2 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.rh-news p {
  margin: 0 auto 1.25rem;
  max-width: 36rem;
  color: #555;
}

.rh-news__form {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.rh-news__form input {
  min-width: min(320px, 100%);
  border: 1px solid #ccc;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 999px;
}

/* —— Footer —— */
.rh-footer {
  background: #1a1a1a;
  color: #ddd;
  padding: 3rem 0 1.5rem;
  font-size: 0.9rem;
}

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

.rh-footer__grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.rh-footer h4 {
  margin: 0 0 0.9rem;
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.rh-footer__col {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.rh-footer__brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 0.5rem;
}

.rh-footer__legal {
  border-top: 1px solid #333;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: #888;
  font-size: 0.8rem;
}

/* —— Shop page —— */
.rh-shop-hero {
  padding: 2.25rem 0 0.5rem;
}

.rh-shop-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.035em;
}

.rh-shop-hero p { margin: 0; color: #666; }

.rh-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 1.75rem;
}

.rh-chip {
  border: 1px solid #ccc;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 560;
  background: #fff;
}

.rh-chip:hover,
.rh-chip.is-active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* —— PDP —— */
.rh-pdp {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  padding: 2.5rem 0 3.5rem;
  align-items: start;
}

.rh-pdp__media {
  background: #f3f3f3;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.rh-pdp__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rh-pdp__meta {
  color: #777;
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

.rh-pdp__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.rh-pdp__price {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.rh-pdp__desc {
  color: #555;
  margin: 0 0 1.5rem;
  max-width: 38rem;
}

.rh-option {
  margin-bottom: 1rem;
}

.rh-option label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.rh-option select {
  width: min(100%, 240px);
  border: 1px solid #ccc;
  padding: 0.65rem 0.75rem;
  border-radius: 4px;
  background: #fff;
}

.rh-pdp__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* —— Simple pages —— */
.rh-page {
  padding: 2.5rem 0 3.5rem;
  max-width: 42rem;
}

.rh-page h1 {
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}

.rh-page p { color: #555; }

.rh-checkout {
  max-width: 28rem;
  margin: 2.5rem auto 3.5rem;
  padding: 0 1.25rem;
}

.rh-checkout h1 { letter-spacing: -0.03em; }

.rh-notice {
  background: #fff8e8;
  border: 1px solid #f0e2b8;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.rh-field { margin-bottom: 0.85rem; }
.rh-field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.3rem; }
.rh-field input {
  width: 100%;
  border: 1px solid #ccc;
  padding: 0.7rem 0.8rem;
  border-radius: 4px;
}

/* —— Cart drawer —— */
.rh-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 80;
}

.rh-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.rh-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100%);
  height: 100%;
  background: #fff;
  z-index: 90;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e5e5e5;
}

.rh-drawer.is-open { transform: none; }

.rh-drawer__head,
.rh-drawer__foot {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rh-drawer__foot {
  border-bottom: 0;
  border-top: 1px solid #eee;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.rh-drawer__body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.15rem;
}

.cart-empty { color: #777; }

/* cart.js shared markup hooks */
.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.cart-line .thumb {
  width: 48px;
  height: 48px;
  background: #f0f0f0;
  flex: 0 0 auto;
}

.icon-btn {
  min-width: 28px;
  height: 28px;
  border: 1px solid #ccc;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
}

/* —— Motion —— */
@media (prefers-reduced-motion: no-preference) {
  .rh-hero__slide.is-active .rh-hero__media img {
    animation: rh-ken 12s ease-out forwards;
  }
  .rh-tile { transition: transform 0.25s ease, box-shadow 0.25s ease; }
  .rh-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  }
}

@keyframes rh-ken {
  from { transform: scale(1.02); }
  to { transform: scale(1.08); }
}

/* —— Responsive —— */
@media (max-width: 1100px) {
  .rh-grid { grid-template-columns: repeat(3, 1fr); }
  .rh-why { grid-template-columns: repeat(2, 1fr); }
  .rh-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .rh-nav { display: none; }
  .rh-cats { grid-template-columns: 1fr; }
  .rh-banner { grid-template-columns: 1fr; }
  .rh-pdp { grid-template-columns: 1fr; }
  .rh-hero__content { align-items: flex-end; padding-bottom: 3.5rem; }
}

@media (max-width: 700px) {
  .rh-grid { grid-template-columns: repeat(2, 1fr); }
  .rh-why { grid-template-columns: 1fr; }
  .rh-footer__grid { grid-template-columns: 1fr; }
  .rh-header__inner { padding: 0.75rem 0; }
}
