/* public/global.css
   Plain CSS, no Tailwind runtime required
*/

/* -----------------------------
   Design tokens / globals
------------------------------ */
:root {
  --aside-width: 400px;
  --grid-item-width: 355px;
  --header-height: 64px;
  --color-dark: #000;
  --color-light: #fff;

  --text-body: #0f172a;        /* ~slate-900 */
  --text-muted: #475569;       /* ~slate-600 */
  --bg-body: #ffffff;
  --bg-hover: #f1f5f9;         /* ~slate-100 */
  --ring: rgba(0,0,0,0.2);
  --border: #e5e7eb;           /* ~gray-200 */
}

/* Base */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-body);
  background: var(--bg-body);
  margin: 0;
}
img { border-radius: 4px; max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* Link helper for non-anchor elements */
.link:hover { text-decoration: underline; cursor: pointer; }

/* -----------------------------
   Overlay (shared)
------------------------------ */
@media (max-width: 45em) {
  html:has(.overlay.expanded) { overflow: hidden; }
}
.overlay {
  background: rgba(0,0,0,0.2);
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 400ms ease-in-out;
  z-index: 50;
}
.overlay .close-outside {
  background: transparent; border: none; color: transparent;
  position: absolute; inset: 0 auto 0 0; /* left side */
  width: calc(100% - var(--aside-width));
}
.overlay .light { background: rgba(255,255,255,0.5); }
.overlay .cancel { cursor: default; position: absolute; inset: 0; }
.overlay.expanded { opacity: 1; pointer-events: auto; visibility: visible; }

/* -----------------------------
   Buttons (utility)
------------------------------ */
button.reset { border: 0; background: inherit; font: inherit; }
button.reset > * { margin: 0; }
button.reset:not(:has(> *)) { height: 1.5rem; line-height: 1.5rem; }
button.reset:hover:not(:has(> *)) { text-decoration: underline; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.5rem; /* rounded-lg */
  padding: 0.5rem 1rem;   /* px-4 py-2 */
  font-size: 0.875rem;    /* text-sm */
  font-weight: 500;
  transition: all .15s ease;
  background: var(--color-dark);
  color: var(--color-light);
  border: 0;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-outline {
  border: 1px solid currentColor;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: transparent;
  color: var(--color-dark);
}

/* -----------------------------
   Search
------------------------------ */
.predictive-search { height: calc(100vh - var(--header-height) - 40px); overflow-y: auto; }
.predictive-search-form { background: #fff; position: sticky; top: 0; }
.predictive-search-result { margin-bottom: 2rem; }
.predictive-search-result h5 { text-transform: uppercase; }
.predictive-search-result-item { margin-bottom: .5rem; }
.predictive-search-result-item a { display: flex; align-items: center; }
.predictive-search-result-item a img { margin-right: .75rem; height: 100%; }

.search-result { margin-bottom: 1.5rem; }
.search-results-item { margin-bottom: .5rem; }
.search-results-item a { display: flex; flex-direction: row; align-items: center; gap: 1rem; }

/* -----------------------------
   Home / grids
------------------------------ */
.featured-collection { display: block; margin-bottom: 2rem; position: relative; }
.featured-collection-image { aspect-ratio: 1/1; }
@media (min-width: 45em) { .featured-collection-image { aspect-ratio: 16/9; } }
.featured-collection img { height: auto; max-height: 100%; object-fit: cover; }

.recommended-products-grid {
  display: grid; gap: 1.5rem; grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 45em) {
  .recommended-products-grid { grid-template-columns: repeat(4, 1fr); }
}
.recommended-product img { height: auto; }

/* -----------------------------
   Collections / product list
------------------------------ */
.collections-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
  margin-bottom: 2rem;
}
.collection-item img { height: auto; }

/* -----------------------------
   Collection detail
------------------------------ */
.collection-description { margin-bottom: 1rem; max-width: 95%; }
@media (min-width: 45em) { .collection-description { max-width: 600px; } }

.products-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
  margin-bottom: 2rem;
}
.product-item img { height: auto; width: 100%; }

/* -----------------------------
   Product detail
------------------------------ */
.product { display: grid; }
@media (min-width: 45em) { .product { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.product h1 { margin-top: 0; }
.product-image img { height: auto; width: 100%; }
.product-main { align-self: start; position: sticky; top: 6rem; }
.product-price-on-sale { display: flex; gap: .5rem; align-items: center; }
.product-price-on-sale s { opacity: .5; }
.product-options-grid { display: flex; flex-wrap: wrap; gap: .75rem; }
.product-options-item,
.product-options-item:disabled {
  padding: .25rem .5rem; background: transparent; font-size: 1rem; font-family: inherit;
}
.product-option-label-swatch { width: 1.25rem; height: 1.25rem; margin: .25rem 0; }
.product-option-label-swatch img { width: 100%; }

/* -----------------------------
   Blog / article
------------------------------ */
.blog-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(var(--grid-item-width), 1fr));
  margin-bottom: 2rem;
}
.blog-article-image { aspect-ratio: 3/2; display: block; }
.blog-article-image img { height: 100%; }
.article img { height: auto; width: 100%; }

/* -----------------------------
   Account
------------------------------ */
.account-logout { display: inline-block; }
.product-item .auth-cta,
.product-item .auth-cta:visited { color: #fff !important; text-decoration: none; }

/* -----------------------------
   Forms (inputs/labels)
------------------------------ */
.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .5rem .75rem;
  font-size: .875rem;
  outline: none;
}
.input:focus { box-shadow: 0 0 0 2px var(--ring); }
.label { display: block; font-size: .875rem; margin-bottom: .25rem; }

/* =========================
   Hero Banner
   ========================= */
.banner {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  isolation: isolate;
}
.banner__bg { position: absolute; inset: 0; z-index: 0; }
.banner__bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.banner__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.35); z-index: 1; }
.banner__inner {
  position: relative; z-index: 2; width: 100%; max-width: 1200px;
  margin: 0 auto; padding: 0 1rem;
}
.banner__content { color: #fff; text-align: center; margin: 0 auto; max-width: 760px; }
.banner__title {
  font-size: clamp(1.75rem, 3.2vw, 3rem); line-height: 1.1; font-weight: 600;
  letter-spacing: -0.01em; margin: 0;
}
.banner__subtitle {
  margin: .75rem auto 0; color: rgba(255,255,255,.92);
  font-size: clamp(.95rem, 1.6vw, 1.125rem); max-width: 42rem;
}

.btn-group {
  display: flex; flex-direction: column; gap: .75rem;
  align-items: center; justify-content: center; margin-top: 1.25rem;
}
@media (min-width: 640px) { .btn-group { flex-direction: row; gap: 1rem; } }

/* Buttons for hero */
.btn { border-radius: 10px; padding: 0.65rem 1.1rem; font-size: .95rem; font-weight: 600;
       text-decoration: none; transition: transform .06s ease, opacity .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease; will-change: transform; }
.btn:active { transform: translateY(1px); }
.btn--light { background: rgba(255,255,255,.95); color: #000; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.btn--light:hover { background: #fff; }
.btn--dark { background: #000; color: #fff; }
.btn--dark:hover { opacity: .9; }

/* soft fade at bottom of hero */
.banner__fade {
  position: absolute; inset-inline: 0; bottom: 0; height: 80px;
  background: linear-gradient(to top, #fff, transparent); z-index: 1;
}
@media (min-width: 1024px) { .banner { min-height: 70vh; } }

/* =========================
   4-up Value Props cards
   ========================= */
.valueprops { padding: 2.5rem 0; background: #fff; }
@media (min-width: 640px) { .valueprops { padding: 3rem 0; } }
@media (min-width: 1024px){ .valueprops { padding: 3.5rem 0; } }

.valueprops__inner { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

.valueprops__grid {
  display: grid; grid-template-columns: 1fr; gap: 0.875rem;
  list-style: none; margin: 0; padding: 0;
}
@media (min-width: 640px) { .valueprops__grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; } }
@media (min-width: 1024px){ .valueprops__grid { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; } }

.valuecard {
  border: 1px solid #e6e7e8; border-radius: 16px; background: #fff;
  padding: 18px 18px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: box-shadow .2s ease, transform .06s ease, border-color .2s ease;
}
.valuecard:hover {
  box-shadow: 0 6px 22px rgba(0,0,0,.06); border-color: #dedfe0; transform: translateY(-1px);
}
.valuecard__title {
  margin: 0 0 6px; font-size: 1rem; font-weight: 600; letter-spacing: -.01em; color: #0f172a;
}
.valuecard__desc {
  margin: 0; font-size: .9375rem; line-height: 1.45; color: #475569;
}

/* =========================
   Shop by Category cards
   ========================= */
.categories { padding: 1rem 0 1.25rem; background: #fff; }
@media (min-width: 640px){ .categories { padding: 1.25rem 0 1.5rem; } }
@media (min-width:1024px){ .categories { padding: 1.5rem 0 2rem; } }

.categories__inner { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

.categories__header {
  display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: .75rem;
}
@media (min-width:640px){ .categories__header { margin-bottom: 1rem; } }

.categories__title {
  margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em; color: #0f172a;
}
.categories__viewall { font-size: .875rem; text-decoration: underline; color: #0f172a; }
.categories__viewall:hover { text-decoration: none; }

.categories__grid {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: 1fr; gap: .75rem;
}
@media (min-width:640px){ .categories__grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; } }
@media (min-width:1024px){ .categories__grid { gap: 1.25rem; } }

.categorycard {
  position: relative; border-radius: 16px; overflow: hidden; border: 1px solid #e6e7e8;
  background: #f3f4f6; height: 0; padding-bottom: 50%; /* ~2:1 */
}
.categorycard__link { position: absolute; inset: 0; display: block; text-decoration: none; color: inherit; }
.categorycard__bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.02); transition: transform .35s ease; }
.categorycard__scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,.12) 45%, rgba(0,0,0,0)); transition: background-color .25s ease; }
.categorycard__label {
  position: absolute; left: .75rem; right: .75rem; bottom: .75rem; display: inline-block;
  background: rgba(255,255,255,.95); color: #0f172a; padding: .5rem .875rem; border-radius: 10px;
  font-size: .9375rem; font-weight: 600; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
@media (min-width:640px){
  .categorycard__label { left: 1rem; right: 1rem; bottom: 1rem; font-size: 1rem; }
}
.categorycard:hover .categorycard__bg { transform: scale(1.06); }
.categorycard:hover .categorycard__scrim { background: rgba(0,0,0,.18); }

/* ==============================
   Favorites section + 4-up grid
   ============================== */
.favsec { padding: 2rem 0 2.75rem; background: #fff; }
@media (min-width:640px){ .favsec { padding: 2.5rem 0 3rem; } }
@media (min-width:1024px){ .favsec { padding: 3rem 0 3.5rem; } }

.favsec__inner { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

.favsec__head { display: flex; align-items: flex-end; justify-content: space-between; }
.favsec__title { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em; color: #0f172a; }
.favsec__view { font-size: .875rem; text-decoration: underline; color: #0f172a; }
.favsec__view:hover { text-decoration: none; }

.favsec__loading, .favsec__empty { margin-top: 1rem; color: #475569; font-size: .95rem; }

/* Grid: 2 on phones, 3 from ~640px, 4 from ~1024px */
.favgrid {
  list-style: none; margin: 1rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem;
}
@media (min-width:640px){ .favgrid { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width:1024px){ .favgrid { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; } }

.favgrid__item { min-width: 0; }

.pcard {
  height: 100%;
  background: #fff;
  border: 1px solid #e6e7e8;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow .2s ease, transform .2s ease;
  padding: 10px;
}
.pcard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
