/* Easy Buy — storefront styles. Mobile first; no external fonts or frameworks. */

:root {
  /* Palette, taken from the Easy Buy logo */
  --ink: #04144b;          /* logo navy: text, buttons */
  --ink-soft: #4a5578;     /* secondary text */
  --paper: #ffffff;
  --lagoon: #eff4fc;       /* light blue surface */
  --line: #d7e0ee;
  --brand-blue: #093bc3;   /* bag, deep */
  --brand-sky: #02b8f0;    /* bag, light */
  --brand-amber: #fa961e;  /* "Buy", light: highlights with navy text */
  --brand-orange: #f55c1b; /* "Buy", deep: decoration only */
  --flame: #c2410c;        /* burnt orange: sale prices and badges (readable on white) */
  --cane: #23744a;         /* green: in stock, WhatsApp */
  --turmeric: var(--brand-amber);

  --font: "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;

  /* Type scale, ratio 1.25 */
  --t-sm: 0.875rem;
  --t-base: 1rem;
  --t-md: 1.25rem;
  --t-lg: 1.5625rem;
  --t-xl: 1.953rem;
  --t-2xl: 2.441rem;

  --gap: 1rem;
  --wrap: 75rem;
  --radius: 10px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

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

a { color: inherit; text-underline-offset: 0.18em; }

h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.015em; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

/* Fixed page text waits for its translation (no flash of English for French
   visitors). Shown anyway after 1.5 s if the script is slow or fails. */
html:not(.i18n-ready) [data-i18n] { visibility: hidden; animation: i18n-reveal 0s 1.5s forwards; }
@keyframes i18n-reveal { to { visibility: visible; } }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  border-radius: 0 0 6px 6px;
}
.skip-link:focus { top: 0; }

/* ---------- Header ---------- */

.announcement {
  margin: 0;
  padding: 0.45rem var(--gap);
  background: var(--ink);
  color: var(--paper);
  font-size: var(--t-sm);
  text-align: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
}

.site-header__bar {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "logo basket" "search search";
  align-items: center;
  gap: 0.6rem 1rem;
  padding-block: 0.75rem 0.6rem;
}

.logo {
  grid-area: logo;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}
.logo__img { display: block; height: 2.25rem; width: auto; }

.search {
  grid-area: search;
  display: flex;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper);
}
.search:focus-within { box-shadow: 0 0 0 3px rgba(9, 59, 195, 0.25); }
.search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0.55rem 0.9rem;
  background: transparent;
  font-size: 1rem; /* 16px stops iOS zooming on focus */
}
.search__input:focus { outline: none; }
.search__input::-webkit-search-cancel-button { cursor: pointer; }
.search__button {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.search__button:focus-visible { outline-offset: -4px; outline-color: var(--brand-amber); }

.site-header__actions {
  grid-area: basket;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* EN | FR */
.lang-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.lang-switch__button {
  min-width: 2.25rem;
  padding: 0.2rem 0.45rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: var(--t-sm);
  font-weight: 700;
  cursor: pointer;
}
.lang-switch__button:hover { color: var(--ink); }
.lang-switch__button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.basket-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.basket-link:hover { background: var(--lagoon); }
.basket-link__count {
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--turmeric);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.category-nav { border-top: 1px solid var(--line); }
.category-nav__list {
  list-style: none;
  margin: 0 auto;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 0.4rem;
}
.category-nav__list::-webkit-scrollbar { display: none; }
.category-nav__list a {
  display: block;
  white-space: nowrap;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
}
.category-nav__list a:hover { color: var(--ink); background: var(--lagoon); }
.category-nav__list a[aria-current="page"] { color: var(--paper); background: var(--ink); }

/* Brand band under the header: the logo's blue fading into its orange */
.brand-band {
  height: 4px;
  background: linear-gradient(90deg, var(--brand-sky), var(--brand-blue) 45%, var(--brand-amber) 70%, var(--brand-orange));
}

@media (min-width: 760px) {
  .site-header__bar {
    grid-template-columns: auto minmax(0, 34rem) 1fr;
    grid-template-areas: "logo search basket";
    padding-block: 0.9rem;
  }
  .logo__img { height: 2.75rem; }
}

/* ---------- Buttons & messages ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.6rem 1.4rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--brand-blue); border-color: var(--brand-blue); }
.button:disabled { opacity: 0.6; cursor: progress; }
.button--block { width: 100%; }
.button--whatsapp { background: var(--cane); border-color: var(--cane); }
.button--whatsapp:hover { background: #1b5e3b; }
.button[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.button--quiet { background: transparent; color: var(--ink); }
.button--quiet:hover { background: var(--lagoon); }

.message {
  max-width: 34rem;
  margin: 3rem auto;
  text-align: center;
}
.message__title { font-size: var(--t-lg); font-weight: 800; margin: 0 0 0.5rem; letter-spacing: -0.015em; }
.message__text { color: var(--ink-soft); margin: 0 0 1.5rem; }

/* ---------- Home ---------- */

.hero {
  background: var(--lagoon);
  padding-block: 2rem 2.25rem;
}
.hero__title {
  font-size: clamp(var(--t-xl), 7vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  max-width: 14ch;
  text-wrap: balance;
}
.steps {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.steps__item { display: flex; gap: 0.8rem; align-items: flex-start; }
.steps__item p { margin: 0; color: var(--ink-soft); max-width: 32ch; }
.steps__item strong { display: block; color: var(--ink); }
.steps__n {
  flex: none;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--turmeric);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 760px) {
  .hero { padding-block: 3.5rem; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
}

.section { padding-block: 2.25rem; }
.section--tint { background: var(--lagoon); }
.section__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section__title { font-size: var(--t-lg); font-weight: 800; margin-bottom: 1rem; }
.section__head .section__title { margin-bottom: 0; }
.section__more { font-size: var(--t-sm); font-weight: 600; white-space: nowrap; }

.category-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.category-tile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: 100%;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--paper);
  border-left: 5px solid var(--ink);
  text-decoration: none;
}
.category-tiles li:nth-child(4n+1) .category-tile { border-left-color: var(--brand-sky); }
.category-tiles li:nth-child(4n+2) .category-tile { border-left-color: var(--brand-blue); }
.category-tiles li:nth-child(4n+3) .category-tile { border-left-color: var(--brand-amber); }
.category-tiles li:nth-child(4n+4) .category-tile { border-left-color: var(--brand-orange); }
.category-tile:hover .category-tile__name { text-decoration: underline; }
.category-tile__name { font-weight: 800; font-size: var(--t-md); letter-spacing: -0.015em; }
.category-tile__text { font-size: var(--t-sm); color: var(--ink-soft); }

@media (min-width: 760px) {
  .category-tiles { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
}

/* ---------- Product grid & cards ---------- */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 0.9rem;
}
@media (min-width: 760px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1.25rem; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card { display: flex; flex-direction: column; min-width: 0; }
.card__link { text-decoration: none; display: block; }
.card__media {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--lagoon);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__badge {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--flame);
  color: var(--paper);
  font-size: var(--t-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.card__name {
  margin-top: 0.6rem;
  font-size: var(--t-base);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__link:hover .card__name { text-decoration: underline; }

.price {
  margin: 0.3rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.5rem;
  font-variant-numeric: tabular-nums;
}
.price__now { font-size: var(--t-md); font-weight: 800; letter-spacing: -0.02em; }
.price__was { color: var(--ink-soft); font-size: var(--t-sm); }
.price:has(.price__was) .price__now { color: var(--flame); }
.price--large .price__now { font-size: var(--t-2xl); letter-spacing: -0.03em; }
.price--large .price__was { font-size: var(--t-md); }

.stock { margin: 0.2rem 0 0; font-size: var(--t-sm); font-weight: 600; }
.stock--in_stock { color: var(--cane); }
.stock--low_stock { color: #9a5b00; }
.stock--out_of_stock { color: var(--flame); }
.stock--preorder { color: var(--brand-blue); }

/* Loading placeholders: static, no shimmer */
.card--skeleton .card__media,
.skeleton-block,
.skeleton-line { background: var(--lagoon); border-radius: var(--radius); }
.skeleton-line { height: 1rem; margin-top: 0.7rem; width: 80%; border-radius: 4px; }
.skeleton-line--short { width: 40%; }

/* ---------- Listing page ---------- */

.listing { padding-block: 1.5rem 3rem; }
.listing__title { font-size: var(--t-xl); font-weight: 800; letter-spacing: -0.03em; }
.listing__intro { color: var(--ink-soft); margin: 0.4rem 0 0; max-width: 60ch; }
.listing__intro:empty { display: none; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.toolbar__summary { margin: 0; color: var(--ink-soft); font-size: var(--t-sm); }
.toolbar__sort { display: flex; align-items: center; gap: 0.5rem; font-size: var(--t-sm); }
.toolbar__sort select {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 1rem;
}
.load-more { display: grid; justify-items: center; gap: 0.5rem; margin-top: 2.5rem; }
.load-more__error { margin: 0; color: var(--flame); font-size: var(--t-sm); }

@media (min-width: 760px) { .listing__title { font-size: var(--t-2xl); } }

/* ---------- Product page ---------- */

.breadcrumb { padding-block: 1rem; font-size: var(--t-sm); color: var(--ink-soft); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 0.35rem; color: var(--line); }
.breadcrumb [aria-current] { color: var(--ink); }

.product { display: grid; gap: 1.5rem; padding-bottom: 3rem; }
.product--loading { padding-top: 3.2rem; }
.product--loading .gallery__main { aspect-ratio: 1; }

.gallery { min-width: 0; }
.gallery__main {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--lagoon);
  aspect-ratio: 1;
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
}
.gallery__thumb {
  width: 4.25rem;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: var(--lagoon);
  cursor: pointer;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb[aria-current="true"] { border-color: var(--ink); }

.product__name { font-size: var(--t-xl); font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.product__info .price { margin-top: 0.75rem; }
.product__saving { margin: 0.2rem 0 0; color: var(--flame); font-weight: 600; font-size: var(--t-sm); }
.product__info .stock { margin-top: 0.6rem; font-size: var(--t-base); }
.product__lead { font-size: var(--t-md); line-height: 1.45; margin: 1.25rem 0 0; max-width: 40ch; }
/* Quantity control */
.qty {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper);
  flex: none;
}
.qty__button {
  width: 2.75rem;
  border: 0;
  background: transparent;
  font-size: var(--t-md);
  font-weight: 700;
  cursor: pointer;
}
.qty__button:hover:not(:disabled) { background: var(--lagoon); }
.qty__button:disabled { color: var(--line); cursor: default; }
.qty__input {
  width: 2.75rem;
  border: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.qty__input::-webkit-inner-spin-button,
.qty__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Product page: add to basket */
.buy-box { display: grid; gap: 0.75rem; margin-top: 1.5rem; max-width: 28rem; }
.buy-box__row { display: flex; gap: 0.75rem; }
.buy-box__row .button { flex: 1; }
.buy-box__status { margin: 0; font-size: var(--t-sm); font-weight: 600; min-height: 1.5em; }
.buy-box__status:empty { display: none; }
.buy-box__hint { margin: 0; font-size: var(--t-sm); color: var(--ink-soft); }
.buy-box__ask { font-weight: 700; }
.product__description {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.product__description h2 { font-size: var(--t-md); font-weight: 800; margin-bottom: 0.5rem; }
.product__description p { margin: 0; white-space: pre-line; color: var(--ink-soft); max-width: 65ch; }

@media (min-width: 800px) {
  .product { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
  .product__info { position: sticky; top: 9rem; }
  .product__name { font-size: var(--t-2xl); }
}

/* ---------- Basket page ---------- */

.basket-page { padding-block: 1.5rem 3rem; }
.notices { display: grid; gap: 0.5rem; margin-top: 1rem; }
.notices:empty { display: none; }
.notice {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border-left: 4px solid var(--brand-blue);
  background: var(--lagoon);
  font-size: var(--t-sm);
}
.notice--warning { border-left-color: var(--brand-amber); background: #fff4e5; }
.notice--success { border-left-color: var(--cane); background: #e8f3ec; }

.basket { display: grid; gap: 2rem; margin-top: 1.25rem; }
.basket__lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.line {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  grid-template-areas: "media body" "media total";
  gap: 0.25rem 0.9rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
.line__media { grid-area: media; border-radius: 8px; overflow: hidden; background: var(--lagoon); aspect-ratio: 1; align-self: start; }
.line__media img { width: 100%; height: 100%; object-fit: cover; }
.line__body { grid-area: body; min-width: 0; }
.line__name { font-weight: 700; text-decoration: none; }
.line__name:hover { text-decoration: underline; }
.line__unit { margin: 0.15rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.line__actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.6rem; }
.line__remove {
  border: 0;
  background: none;
  padding: 0.4rem 0;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.line__remove:hover { color: var(--flame); }
.line__total { grid-area: total; margin: 0; font-weight: 800; font-size: var(--t-md); font-variant-numeric: tabular-nums; }
.line--unavailable .line__unit { color: var(--flame); font-weight: 600; }
.line--unavailable .line__media { opacity: 0.5; }

.summary {
  align-self: start;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--lagoon);
}
.summary__title { font-size: var(--t-md); font-weight: 800; }
.summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 1rem 0 0;
  font-size: var(--t-md);
}
.summary__total { font-size: var(--t-xl); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.summary__count { margin: 0; text-align: right; font-size: var(--t-sm); color: var(--ink-soft); }
.summary__note { margin: 0.9rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); }
.summary__fields { display: grid; gap: 0.8rem; margin: 1.25rem 0; }
.field { display: grid; gap: 0.3rem; }
.field label { font-size: var(--t-sm); font-weight: 600; }
.field__input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #b9cbc8;
  border-radius: 8px;
  background: var(--paper);
  font-size: 1rem;
  resize: vertical;
}
.summary__hint { margin: 0.6rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); text-align: center; }
.after-send {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.6rem;
  justify-items: start;
  font-size: var(--t-sm);
}
.after-send p { margin: 0; }

@media (min-width: 560px) {
  .line {
    grid-template-columns: 6rem minmax(0, 1fr) auto;
    grid-template-areas: "media body total";
  }
}
@media (min-width: 900px) {
  .basket { grid-template-columns: minmax(0, 1fr) 22rem; gap: 3rem; }
  .summary { position: sticky; top: 9rem; }
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 2rem;
  background: var(--ink);
  color: #d6e4e6;
  padding-block: 2rem;
  font-size: var(--t-sm);
}
.site-footer__inner { display: grid; gap: 0.5rem; }
.site-footer p { margin: 0; max-width: 55ch; }
.site-footer__name { color: var(--paper); font-weight: 800; font-size: var(--t-md); }
.footer-whatsapp { color: var(--paper); font-weight: 700; justify-self: start; }
.site-footer__legal { margin-top: 0.75rem !important; opacity: 0.75; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Very small phones: icon + count only (the link keeps its spoken label) */
@media (max-width: 359px) {
  .basket-link__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .logo__img { height: 2rem; }
}
