/* appmachine-website base styles. Mobile-first. All colours/fonts/radii come from theme.css variables. */

*, *::before, *::after { box-sizing: border-box; }
/* --fs-base sizes the root, so every rem below scales with the theme's base font size. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; font-size: var(--fs-base); }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: var(--fw-body) 1rem/var(--lh) var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
picture { display: contents; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-heading); font-weight: var(--fw-heading); line-height: 1.2; margin: 0; text-transform: var(--heading-transform); letter-spacing: var(--heading-ls); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }
/* Grid children default to min-width:auto, which lets big images/scrollers widen the page. */
.hero__inner > *, .pdp > *, .split > *, .promo > *, .site-footer__grid > *, .grid > *, .tiles > * { min-width: 0; }
.hero__inner, .pdp, .split, .promo, .site-footer__grid { grid-template-columns: minmax(0, 1fr); }
.narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--c-muted); }
.small { font-size: 0.85rem; }
.icon { flex: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--c-surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border: 1px solid var(--c-primary); border-radius: var(--radius-btn);
  background: var(--c-primary); color: var(--c-primary-text);
  font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer; text-transform: var(--btn-transform); letter-spacing: 0.02em;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--c-primary); }
.btn--text { background: none; border-color: transparent; color: var(--c-text); padding: 0 8px; }
.icon-btn {
  display: inline-grid; place-items: center; position: relative;
  width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; cursor: pointer; text-decoration: none;
}
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--c-primary); text-decoration: none; white-space: nowrap; }

/* ---------- header ---------- */
.announce { background: var(--c-announce-bg); color: var(--c-announce-text); text-align: center; font-size: 0.85rem; padding: 8px 16px; }
.site-header { position: sticky; top: 0; z-index: 20; color: var(--c-header-text); background: color-mix(in srgb, var(--c-header-bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-border); }
.site-header__inner { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-height: 64px; gap: 8px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand__logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.brand__name { font-family: var(--f-heading); font-weight: var(--fw-heading); font-size: 1.2rem; text-transform: var(--heading-transform); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
/* Mobile menu hangs off the sticky header, so it is right below it whatever sits above (announcement bar). */
.site-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--c-header-bg); border-bottom: 1px solid var(--c-border); box-shadow: var(--shadow); visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, visibility .2s; }
.site-nav.is-open { visibility: visible; opacity: 1; transform: none; }
.site-nav ul { list-style: none; padding: 8px 16px 16px; }
.site-nav a { display: block; padding: 12px 0; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--c-border); }
.site-nav a[aria-current="page"] { color: var(--c-primary); }
.cart-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--c-primary); color: var(--c-primary-text); font-size: 11px; display: grid; place-items: center; }

@media (min-width: 900px) {
  .site-header__inner { grid-template-columns: auto 1fr auto; gap: 32px; }
  .nav-toggle { display: none; }
  .brand { justify-content: flex-start; }
  .site-nav { position: static; visibility: visible; opacity: 1; transform: none; background: none; border: 0; box-shadow: none; justify-self: center; }
  .site-nav ul { display: flex; gap: 28px; padding: 0; }
  .site-nav a { border: 0; padding: 8px 0; }
}

/* ---------- sections ---------- */
.section { padding: var(--space-section) 0; }
.section--tight { padding: calc(var(--space-section) * .4) 0 calc(var(--space-section) * .8); }
.section--alt { background: var(--c-surface-alt); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section__title { font-size: calc(clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem) * var(--heading-scale)); margin-bottom: 0.3em; }
.section__sub { color: var(--c-muted); margin: 0; max-width: 60ch; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; font-weight: 600; color: var(--c-accent); margin: 0 0 8px; }
.page-head { margin: 8px 0 24px; }
.page-title { font-size: calc(clamp(1.8rem, 1.3rem + 2vw, 2.8rem) * var(--heading-scale)); margin-bottom: 0.3em; }

/* ---------- page hero (shop, category, content pages) ---------- */
.page-hero { position: relative; display: flex; align-items: flex-end; color: var(--c-hero-text); background: var(--c-surface-alt); overflow: hidden; }
.page-hero--compact { min-height: 200px; }
.page-hero--medium { min-height: 280px; }
.page-hero--tall { min-height: 380px; }
@media (min-width: 900px) {
  .page-hero--compact { min-height: 240px; }
  .page-hero--medium { min-height: 360px; }
  .page-hero--tall { min-height: 480px; }
}
.page-hero__media, .page-hero__overlay { position: absolute; inset: 0; }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.page-hero__overlay { background: var(--c-hero-overlay); opacity: var(--hero-overlay-opacity); }
.page-hero__inner { position: relative; padding-top: 28px; padding-bottom: 32px; }
.page-hero .crumbs ol { color: inherit; opacity: .85; }
.page-hero .page-title { margin: 10px 0 0; }
.page-hero__intro { margin: 10px 0 0; max-width: 60ch; opacity: .9; }
.page-hero--center { text-align: center; }
.page-hero--center .page-hero__inner { display: flex; flex-direction: column; align-items: center; }
.page-hero--center .crumbs ol { justify-content: center; }
.page-hero--plain { color: var(--c-text); }

/* ---------- hero ---------- */
.hero { padding: 24px 0 40px; }
.hero__inner { display: grid; gap: 24px; align-items: center; }
.hero__title { font-size: calc(clamp(2.1rem, 1.4rem + 3.5vw, 3.8rem) * var(--heading-scale)); margin-bottom: 0.35em; }
.hero__sub { font-size: 1.1rem; color: var(--c-muted); max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero__media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; background: var(--c-surface-alt); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero--overlay .hero__inner { position: relative; }
@media (min-width: 768px) {
  .hero { padding: 48px 0 64px; }
  .hero__inner { grid-template-columns: 1fr 1fr; gap: 56px; }
  .hero__media { aspect-ratio: 1 / 1; }
}

/* ---------- product grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
}
.card { background: var(--c-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: var(--card-border) solid var(--c-border); display: flex; flex-direction: column; }
.card__media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--c-surface-alt); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__title { font-family: var(--f-body); font-size: 0.95rem; font-weight: 500; line-height: 1.35; text-transform: none; letter-spacing: 0; }
.card__title a { text-decoration: none; }
.badge { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge--sale { background: var(--c-sale); color: #fff; }
.badge--muted { background: var(--c-text); color: var(--c-bg); left: auto; right: 10px; }
.img-placeholder { display: block; width: 100%; height: 100%; min-height: 120px; background: var(--c-surface-alt); }

.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: auto; }
.price__now { font-weight: 600; }
.price__mrp { color: var(--c-muted); font-size: 0.85rem; }
.price__off { color: var(--c-success); font-size: 0.8rem; font-weight: 600; }
.price--lg .price__now { font-size: 1.6rem; }
.price--lg .price__mrp { font-size: 1rem; }

/* ---------- rail (carousel) ---------- */
.rail { position: relative; }
.rail__track { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.rail__track::-webkit-scrollbar { display: none; }
.rail__item { scroll-snap-align: start; display: flex; }
.rail__item .card { width: 100%; }
.rail__btn { position: absolute; top: 35%; z-index: 2; background: var(--c-surface); box-shadow: var(--shadow); border: 1px solid var(--c-border); }
.rail__btn--prev { left: -8px; }
.rail__btn--next { right: -8px; }
@media (min-width: 900px) { .rail__track { grid-auto-columns: calc((100% - 72px) / 4); gap: 24px; } }

/* ---------- tiles, promo, usps ---------- */
.tiles { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; text-decoration: none; background: var(--c-surface-alt); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile__label { position: absolute; left: 12px; bottom: 12px; right: 12px; background: var(--c-surface); padding: 10px 14px; border-radius: calc(var(--radius) * .7); font-weight: 600; }

.promo { display: grid; background: var(--c-surface-alt); border-radius: var(--radius); overflow: hidden; }
.promo__media { aspect-ratio: 4 / 3; }
.promo__media img { width: 100%; height: 100%; object-fit: cover; }
.promo__copy { padding: 28px 20px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
@media (min-width: 768px) {
  .promo { grid-template-columns: 1fr 1fr; align-items: center; }
  .promo__media { aspect-ratio: auto; height: 100%; min-height: 380px; }
  .promo__copy { padding: 48px; }
}

.usps { list-style: none; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.usp { display: flex; gap: 14px; align-items: flex-start; }
.usp__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c-surface); color: var(--c-primary); border: 1px solid var(--c-border); flex: none; }
.usp__title { font-weight: 600; margin: 0 0 2px; }
.usp__text { color: var(--c-muted); font-size: 0.9rem; margin: 0; }
.pdp__info .usps { grid-template-columns: 1fr 1fr; padding: 16px 0; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.pdp__info .usp__icon { width: 36px; height: 36px; }

/* ---------- prose (migrated / rich text) ---------- */
.prose { color: var(--c-text); }
.prose h2, .prose h3, .prose h4 { margin: 1.4em 0 .5em; font-size: calc(1.3rem * var(--heading-scale)); }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .25em 0; }
.prose li p { margin: 0; }
.prose a { color: var(--c-link); }
.split { display: grid; gap: 28px; align-items: center; }
.split__media { border-radius: var(--radius); overflow: hidden; }
@media (min-width: 768px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; } }

/* ---------- testimonials, faq, contact ---------- */
.quotes { list-style: none; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.quote { background: var(--c-surface); padding: 20px; border-radius: var(--radius); border: 1px solid var(--c-border); }
.quote blockquote { margin: 0 0 12px; }
.quote__name { font-weight: 600; margin: 0; }
.stars { color: var(--c-accent); display: flex; gap: 2px; }
.faq details { border-bottom: 1px solid var(--c-border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--c-muted); }
.contact-cards { list-style: none; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 28px; }
.contact-card { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); text-decoration: none; height: 100%; }
.contact-card__label { display: block; font-size: 0.8rem; color: var(--c-muted); }
.contact-card__value { display: block; font-weight: 600; word-break: break-word; }

/* ---------- breadcrumbs ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; color: var(--c-muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- product page ---------- */
.pdp { display: grid; gap: 24px; margin-top: 16px; }
@media (min-width: 900px) { .pdp { grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; } .gallery { position: sticky; top: 88px; } }
.gallery__main { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); background: var(--c-surface-alt); }
.gallery__main::-webkit-scrollbar { display: none; }
.gallery__slide { margin: 0; scroll-snap-align: start; aspect-ratio: 1 / 1; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.gallery__thumb { flex: none; width: 64px; height: 64px; border-radius: calc(var(--radius) * .6); overflow: hidden; border: 2px solid transparent; opacity: .7; }
.gallery__thumb.is-active { border-color: var(--c-primary); opacity: 1; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp__info { display: flex; flex-direction: column; gap: 10px; }
.pdp__title { font-size: calc(clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem) * var(--heading-scale)); }
.pdp__info .prose { font-size: 0.97rem; }
.stock { font-weight: 600; font-size: 0.9rem; margin: 0; }
.stock--in { color: var(--c-success); }
.stock--out { color: var(--c-sale); }
.buy { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.buy .btn--primary, .buy .btn--ghost { flex: 1 1 220px; }
.pdp__desc { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--c-border); max-width: 820px; }

/* ---------- footer ---------- */
.site-footer { background: var(--c-footer-bg); color: var(--c-footer-text); margin-top: 24px; padding: 48px 0 24px; font-size: 0.92rem; }
.site-footer__grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.site-footer__title { font-weight: 600; margin-bottom: 12px; }
.site-footer__links { list-style: none; display: grid; gap: 8px; }
.site-footer__links a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; word-break: break-word; }
.site-footer__links a:hover { text-decoration: underline; }
.social { list-style: none; display: flex; gap: 8px; margin-top: 12px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c-surface); color: var(--c-primary); }
.site-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--c-border); font-size: 0.82rem; }
.site-footer__base p { margin: 0; }

/* ---------- image frames (theme: shape.imageBorderWidth + colors.imageBorder; 0px = off) ---------- */
.hero__media, .card__media, .tile, .promo__media, .gallery__main, .split__media {
  border: var(--img-border) solid var(--c-image-border);
}

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--c-text); color: var(--c-bg); padding: 12px 18px; border-radius: 999px; font-size: 0.9rem; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
