/* ==========================================================================
   Joy’s Cloud — Storefront
   Mobile-first; breakpoints at 600px, 900px and 1200px.
   ========================================================================== */

:root {
  --color-cream: #f7f1e8;
  --color-navy: #384259;
  --color-ink: #2d1b2e;
  --color-border: #d8c7b7;
  --color-white: #ffffff;
  --color-accent: #fbd37b;
  --color-accent-border: #7482a5;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Typography — H1 and H2 grow at 600px */
  --text-h1: 32px;
  --text-h2: 24px;
  --text-h3: 20px;
  --text-h4: 16px;
  --text-body: 16px;
  --text-small: 14px;
  --text-label: 14px;
  --text-tag: 12px;

  --weight-regular: 400;
  --weight-bold: 700;
  --weight-extrabold: 800;

  --leading-tight: 1.2;
  --leading-small: 1.4;
  --leading-body: 1.5;

  --gutter: 16px;
  --max-width: 1504px;
}

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

body,
h1,
h2,
h3,
p,
ul,
address {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

address {
  font-style: normal;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

body {
  background: var(--color-cream);
  color: var(--color-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  font-size: var(--text-body);
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--color-navy);
  border-radius: 14px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    transform 0.1s ease;
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.btn--primary {
  background: var(--color-navy);
  color: var(--color-white);
}

.btn--accent {
  background: var(--color-accent);
  border-color: var(--color-accent-border);
  color: var(--color-ink);
  min-height: 48px;
}

.btn--block {
  flex: 1 1 0;
  width: 100%;
}

.icon-button {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.icon-button img {
  transition: transform 0.15s ease;
}

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

/* Button states ----------------------------------------------------------
   Hover:    filled buttons fade slightly; outline buttons and links
             get the accent yellow
   Pressed:  the button moves down 1px
   Disabled: faded and not clickable
   ------------------------------------------------------------------------ */

/* Hover — filled buttons (Buy now, Shop now, Sign up) fade slightly */
.btn:hover {
  opacity: 0.88;
}

/* Hover — outline buttons (+ add to cart, hero arrows) fill with yellow */
.btn-add:hover,
.hero__arrow:hover {
  background: var(--color-accent);
}

/* Hover — text links get a yellow highlight */
.section-heading__action:hover {
  background: var(--color-accent);
}

.category-card__link:hover {
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 3px;
}

/* Hover — favorite heart grows slightly */
.icon-button:hover img {
  transform: scale(1.15);
}

/* Pressed */
.btn:active,
.btn-add:active,
.hero__arrow:active,
.section-heading__action:active,
.utility-action:active,
.primary-nav a:active {
  transform: translateY(1px);
}

.icon-button:active img {
  transform: scale(0.95);
}

/* Disabled */
.btn:disabled,
.btn-add:disabled,
.hero__arrow:disabled,
.icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Promo bar -------------------------------------------------------------- */
.promo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px var(--gutter);
  background: var(--color-navy);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-white);
  text-align: center;
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

/* Header ----------------------------------------------------------------- */
.site-header {
  position: relative;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: var(--max-width);
  min-height: 72px;
  margin: 0 auto;
  padding: 12px var(--gutter);
}

.logo {
  order: 1;
  flex-shrink: 0;
}

.logo img {
  width: 150px;
  height: auto;
}

.commerce-actions {
  order: 2;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.utility-action {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 10px;
  border-radius: 22px;
  text-decoration: none;
  white-space: nowrap;
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.utility-action__label {
  display: none;
}

/* Mobile nav toggle (CSS-only) */
.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle__button {
  order: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 11px;
  cursor: pointer;
}

.nav-toggle__button span {
  display: block;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.nav-toggle:focus-visible + .nav-toggle__button {
  outline: 2px solid var(--color-navy);
}

.nav-toggle:checked + .nav-toggle__button span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle:checked + .nav-toggle__button span:nth-child(2) {
  opacity: 0;
}

.nav-toggle:checked + .nav-toggle__button span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.primary-nav {
  order: 4;
  display: none;
  width: 100%;
}

.nav-toggle:checked ~ .primary-nav {
  display: block;
}

.primary-nav ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
}

.primary-nav a {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  text-decoration: none;
  white-space: nowrap;
  font-size: var(--text-body);
}

.primary-nav a:hover,
.utility-action:hover {
  background: rgba(56, 66, 89, 0.06);
}

/* Main ------------------------------------------------------------------- */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px var(--gutter) 56px;
}

/* Hero carousel ---------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  min-height: 240px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__controls {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hero__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--color-cream);
  border: 1px solid var(--color-navy);
  border-radius: 50%;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

.hero__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.hero__title {
  color: #000;
  font-size: var(--text-h1);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
}

.hero__cta {
  min-width: 121px;
  min-height: 42px;
  padding: 0 24px;
  border-radius: 24px;
}

.hero__dots {
  position: absolute;
  bottom: 19px;
  left: 50%;
  width: 40px;
  height: 8px;
  transform: translateX(-50%);
}

/* Section heading -------------------------------------------------------- */
.section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
}

.section-heading__copy {
  display: flex;
  flex: 1 1 280px;
  flex-direction: column;
  gap: 6px;
}

.section-heading__title {
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.section-heading__text {
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
}

.section-heading__action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

/* Product grid ----------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: 20px;
}

.product-card__media {
  position: relative;
  aspect-ratio: 304 / 314;
  border-radius: 16px;
  overflow: hidden;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: var(--text-tag);
  line-height: var(--leading-tight);
  text-transform: uppercase;
  font-weight: var(--weight-bold);
}

.product-card__info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.product-card__category {
  font-family: var(--font-mono);
  font-size: var(--text-tag);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.product-card__name-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-card__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.product-card__fav-price {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.product-card__price {
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.product-card__rating {
  font-size: var(--text-small);
  font-weight: var(--weight-regular);
  line-height: var(--leading-small);
}

.product-card__desc {
  font-size: var(--text-small);
  font-weight: var(--weight-regular);
  line-height: var(--leading-small);
}

.product-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--color-cream);
  border: 1px solid var(--color-navy);
  border-radius: 14px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

/* Category list ---------------------------------------------------------- */
.category-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 112px;
  padding: 20px;
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: 20px;
}

.category-card > img {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}

.category-card__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.category-card__name {
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.category-card__count {
  font-family: var(--font-mono);
  font-size: var(--text-tag);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.category-card__link {
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

/* Services strip --------------------------------------------------------- */
.services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 24px;
  padding: 20px;
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: 20px;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
}

.service-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
}

.service-item__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.service-item__title {
  color: #000;
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.service-item__text {
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
}

/* Footer ----------------------------------------------------------------- */
.site-footer {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 48px var(--gutter) 32px;
  background: var(--color-navy);
  color: var(--color-white);
}

.site-footer > * {
  width: 100%;
  max-width: calc(var(--max-width) - 2 * 64px);
  margin: 0 auto;
}

.site-footer__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-logo {
  position: relative;
  display: block;
  width: 171px;
  height: 34px;
}

.footer-logo__mark,
.footer-logo__text {
  position: absolute;
}

/* Positions from the Figma layer (160×29 at 11,5) */
.footer-logo__mark {
  top: 5px;
  left: 11px;
  width: 55.86px;
  height: 29px;
}

.footer-logo__text {
  top: 10.94px;
  left: 71.51px;
  width: 99.49px;
  height: 21.55px;
}

.footer-brand__text {
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
}

.footer-brand__text a {
  text-decoration: none;
}

.footer-brand__text a:hover {
  text-decoration: underline;
}

.footer-social {
  align-self: flex-start;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 24px;
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
}

.footer-links__title {
  margin-bottom: 10px;
  color: var(--color-white);
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.newsletter {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.newsletter__title {
  color: var(--color-cream);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.newsletter__text {
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
}

.newsletter__label {
  margin-bottom: -6px;
  color: var(--color-cream);
  font-size: var(--text-label);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.newsletter__input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--color-cream);
  border: 1px solid var(--color-navy);
  border-radius: 14px;
  color: var(--color-ink);
  font-size: var(--text-body);
}

.newsletter__input::placeholder {
  color: var(--color-ink);
}

.site-footer__divider {
  height: 1px;
  object-fit: fill;
}

.legal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--color-white);
  font-size: var(--text-small);
  font-weight: var(--weight-regular);
  line-height: var(--leading-small);
}

.legal__links a {
  text-decoration: none;
}

.legal__links a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   ≥ 600px — small tablets
   ========================================================================== */
@media (min-width: 600px) {
  :root {
    --gutter: 32px;
    --text-h1: 46px;
    --text-h2: 28px;
  }

  .logo img {
    width: 200px;
  }

  .utility-action__label {
    display: inline;
  }

  .utility-action {
    padding: 0 14px;
  }

  .hero {
    min-height: 280px;
    padding: 24px;
  }

  .product-grid,
  .category-list,
  .services {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-links {
    grid-template-columns: repeat(3, 1fr);
  }

  .legal {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
}

/* ==========================================================================
   ≥ 900px — tablets / small laptops
   ========================================================================== */
@media (min-width: 900px) {
  .main-content {
    gap: 64px;
    padding-top: 36px;
    padding-bottom: 80px;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .site-footer__content {
    grid-template-columns: 220px 1fr;
    gap: 48px 56px;
  }

  .newsletter {
    grid-column: 1 / -1;
    max-width: 480px;
  }
}

/* ==========================================================================
   ≥ 1200px — desktop (matches the 1504px Figma frame)
   ========================================================================== */
@media (min-width: 1200px) {
  :root {
    --gutter: 64px;
  }

  .site-header__inner {
    flex-wrap: nowrap;
    min-height: 113px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .logo {
    width: 269px;
  }

  .logo img {
    width: 240px;
  }

  .nav-toggle__button {
    display: none;
  }

  .primary-nav {
    order: 2;
    display: block;
    width: auto;
  }

  .primary-nav ul {
    flex-direction: row;
    padding: 0;
  }

  .commerce-actions {
    order: 3;
    justify-content: flex-end;
    width: 299px;
    margin-left: 0;
  }

  .hero {
    min-height: 308px;
  }

  .product-grid,
  .category-list,
  .services {
    grid-template-columns: repeat(4, 1fr);
  }

  .category-card {
    height: 144px;
  }

  .services {
    padding: 24px 28px;
  }

  .service-item {
    min-height: 72px;
  }

  .site-footer {
    gap: 36px;
    padding: 56px var(--gutter) 36px;
  }

  .site-footer__content {
    grid-template-columns: 220px 1fr 350px;
  }

  .newsletter {
    grid-column: auto;
    max-width: none;
  }

  .footer-links {
    gap: 44px;
  }
}
