/* Shared foundation with the Ruslan app (src/design-tokens.css): the same type
   stack, shape scale, motion durations and curves, press feedback and sheet
   behaviour. The landing page keeps its own light surfaces and brand colours;
   only the materials below differ from the app's dark glass. Loaded last. */
:root {
  --font-sans: -apple-system, "SF Pro Text", "DM Sans", "Segoe UI", Arial, sans-serif;

  --radius-control: 12px;
  --radius-field: 14px;
  --radius-card: 20px;
  --radius-panel: 26px;
  --radius-sheet: 32px;
  --radius-pill: 999px;
  --hit-target: 44px;

  /* Light glass: a white film over a blur, edged by a hairline and a bright top line. */
  --glass-chrome: rgba(255, 255, 255, .74);
  --glass-menu: rgba(255, 255, 255, .86);
  --blur-chrome: blur(28px) saturate(180%);
  --blur-scrim: blur(8px);
  --scrim: #0a120d80;
  --hairline: #20242014;
  --hairline-strong: #20242024;
  --specular: inset 0 1px 0 #ffffffd9;
  --elevation-chrome: 0 1px 1px #1014120a, 0 18px 40px -28px #10141259;
  --elevation-sheet: 0 -1px 0 #ffffff66, 0 -24px 80px -24px #000000a6;
  --sheet-max: calc(100dvh - 44px - env(safe-area-inset-top));

  --dur-press: 120ms;
  --dur-fast: 180ms;
  --dur-base: 260ms;
  --dur-enter: 380ms;
  --dur-exit: 280ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-sheet: cubic-bezier(.3, .3, .2, 1);
  --press-scale: .97;

  --radius: var(--radius-card);
}
body { font-family: var(--font-sans); }

/* Header: real glass. The film sits on a pseudo-element so the phone menu
   below it can blur the page too (a blurred parent would hide the page from it). */
.header { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; }
.header::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--glass-chrome); -webkit-backdrop-filter: var(--blur-chrome); backdrop-filter: var(--blur-chrome); box-shadow: var(--specular), inset 0 -1px 0 var(--hairline), var(--elevation-chrome); }
/* The logo file is transparent now; blending it into the bar is no longer needed. */
.brand-logo img { mix-blend-mode: normal; }
.nav-cta { border-color: var(--hairline-strong); background: #ffffff66; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), scale var(--dur-press) var(--ease-out); }
.header nav a, .header .nav-products { transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }

/* One press response everywhere, as in the app. */
.button, .nav-toggle, .products-close, .dialog-close, .area-button, .view-switch button, .seller-filter-toggle, .map-controls button, .map-expand, .filter-chip, .atlas-opportunity a {
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), scale var(--dur-press) var(--ease-out);
}
:is(.button, .nav-toggle, .nav-cta, .products-close, .dialog-close, .area-button, .view-switch button, .seller-filter-toggle, .map-controls button, .map-expand, .filter-chip, .atlas-opportunity a):active { scale: var(--press-scale); }

/* Shape scale: fields, cards and panels step down so nested corners stay concentric. */
input, select { border-radius: var(--radius-field); transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.join, .coverage-atlas { border-radius: var(--radius-panel); }
.join-form { border-radius: calc(var(--radius-panel) - 12px); }
.product-card { border-radius: var(--radius-card); }

/* Pack photo at the top of each product card. A SKU without a photo keeps the same
   tile, with the brand mark faint on it, so the grid stays even. */
.product-card { overflow: hidden; }
.product-photo { position: relative; margin: -18px -18px 12px; aspect-ratio: 5 / 4; background: #1c1e23; }
.product-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-photo.is-empty { background: #eef1ea; }
.product-photo.is-empty::after { content: ''; position: absolute; inset: 0; background: url(assets/ruslan-logo.webp) center / 38% no-repeat; opacity: .16; }

/* The strip under the hero is glass over the photograph. */
.hero-foot { -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); background: #1219116b; box-shadow: inset 0 1px 0 #ffffff1f; border-top: 0; }

/* Dialogs open and close with the same motion as the app: they rise and fade
   in, and leave the way they came. Browsers without these features open and
   close them at once, as before. */
.products-dialog[open], .seller-dialog[open] { animation: none; }
.products-dialog, .seller-dialog {
  opacity: 0; translate: 0 12px;
  transition: opacity var(--dur-exit) var(--ease-in), translate var(--dur-exit) var(--ease-in), overlay var(--dur-exit) allow-discrete, display var(--dur-exit) allow-discrete;
}
.products-dialog[open], .seller-dialog[open] { opacity: 1; translate: 0 0; transition-duration: var(--dur-enter); transition-timing-function: var(--ease-out); }
@starting-style { .products-dialog[open], .seller-dialog[open] { opacity: 0; translate: 0 12px; } }
.products-dialog::backdrop, .seller-dialog::backdrop {
  background: var(--scrim); -webkit-backdrop-filter: var(--blur-scrim); backdrop-filter: var(--blur-scrim); opacity: 0;
  transition: opacity var(--dur-exit) linear, overlay var(--dur-exit) allow-discrete, display var(--dur-exit) allow-discrete;
}
.products-dialog[open]::backdrop, .seller-dialog[open]::backdrop { opacity: 1; transition-duration: var(--dur-enter); }
@starting-style { .products-dialog[open]::backdrop, .seller-dialog[open]::backdrop { opacity: 0; } }
.products-dialog { border-radius: var(--radius-panel); }
.seller-dialog { border-radius: var(--radius-panel); }

/* Answers unfold instead of snapping open, where the browser can animate to a natural height. */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq details::details-content { block-size: 0; overflow: clip; transition: block-size var(--dur-base) var(--ease-out), content-visibility var(--dur-base) allow-discrete; }
  .faq details[open]::details-content { block-size: auto; }
}

@media (max-width: 680px) {
  /* Phone menu: a glass panel that drops from the bar. Hidden with visibility so it
     stays out of the tab order while closed and can still animate. */
  .header nav, .header.nav-open nav { display: flex; flex-direction: column; align-items: stretch; }
  .header nav {
    visibility: hidden; opacity: 0; translate: 0 -8px; pointer-events: none;
    background: var(--glass-menu); -webkit-backdrop-filter: var(--blur-chrome); backdrop-filter: var(--blur-chrome);
    border-bottom: 0; border-radius: 0 0 var(--radius-panel) var(--radius-panel);
    box-shadow: inset 0 -1px 0 var(--hairline), 0 24px 40px -24px #10141266;
    transition: opacity var(--dur-fast) var(--ease-in), translate var(--dur-fast) var(--ease-in), visibility 0s linear var(--dur-fast);
  }
  .header.nav-open nav { visibility: visible; opacity: 1; translate: 0 0; pointer-events: auto; transition: opacity var(--dur-base) var(--ease-out), translate var(--dur-base) var(--ease-out), visibility 0s; }
  .header nav a, .header .nav-products { border-radius: var(--radius-control); }
  .header nav a:active, .header .nav-products:active { background: #2024200f; }
  .nav-toggle { border-color: var(--hairline-strong); background: #ffffff66; }

  /* All three trust points stay visible; they wrap instead of dropping the last one. */
  .hero-foot { gap: 6px 16px; }
  .hero-foot span:last-child { display: inline; }

  /* On a phone a dialog is a sheet: it rises from the bottom edge, keeps a strip
     of the page visible above it, and can be pulled down by its header (sheet-drag.js). */
  .products-dialog, .seller-dialog {
    width: 100%; max-width: 100%; height: fit-content; max-height: var(--sheet-max); margin: auto 0 0;
    border: 0; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; box-shadow: var(--elevation-sheet);
    translate: 0 100%; opacity: 1;
  }
  .products-dialog { height: var(--sheet-max); }
  .products-dialog[open], .seller-dialog[open] { transition-timing-function: var(--ease-sheet); }
  @starting-style { .products-dialog[open], .seller-dialog[open] { opacity: 1; translate: 0 100%; } }
  .products-dialog-header, .dialog-header { padding-top: 26px; touch-action: none; }
  .products-dialog-header::before, .dialog-header::before { content: ''; position: absolute; top: 9px; left: 50%; translate: -50% 0; width: 36px; height: 5px; border-radius: var(--radius-pill); background: currentColor; opacity: .26; }

  /* Product rows: a small pack thumbnail leads each row. */
  .product-card:not(:last-child) { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .product-card:not(:last-child) .product-photo { grid-column: 1; grid-row: 1 / 3; width: 64px; aspect-ratio: 1; margin: 0; border-radius: var(--radius-field); overflow: hidden; align-self: center; }
  .product-card:not(:last-child) :is(h3, p) { grid-column: 2; }
  .product-card:not(:last-child) button { grid-column: 3; }
}

/* ---- Finder controls --------------------------------------------------- */
:root { --ease-spring-snappy: var(--ease-out); }
@supports (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring-snappy: linear(0, 0.05, 0.168, 0.317, 0.471, 0.613, 0.736, 0.835, 0.911, 0.965, 1.001, 1.023, 1.035, 1.038, 1.037, 1.033, 1.027, 1.021, 1.016, 1.011, 1.007, 1.004, 1.002, 1, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 1); }
}
/* "Dekat saya" sits with the search actions and looks like the Filter button beside it. */
.near-me { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border: 1px solid #54725a; border-radius: var(--radius-pill); background: #1c3528; color: #eff7e8; font-size: 14px; font-weight: 600; white-space: nowrap; transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), scale var(--dur-press) var(--ease-out); }
.near-me:hover { background: #26452f; border-color: #abc998; }
.near-me:active { scale: var(--press-scale); }
.near-me svg { flex-shrink: 0; }
.near-me:disabled svg { animation: near-me-seek 1.1s linear infinite; }
@keyframes near-me-seek { to { rotate: 360deg; } }
.near-me-note { margin-top: 12px; padding: 12px 16px; border: 1px solid #45614c; border-radius: var(--radius-field); background: #1b3528; color: #e5f0db; font-size: 13px; line-height: 1.5; }
.atlas-search .search-form { grid-template-columns: minmax(200px, 1.3fr) minmax(280px, 2fr) auto auto; }
.user-marker { pointer-events: none; }
.user-dot { display: block; width: 22px; height: 22px; border: 3px solid #fff; border-radius: 50%; background: #2f7df6; box-shadow: 0 0 0 6px #2f7df633, 0 2px 6px #0006; }

/* One segmented control for both switches, with the app's sliding thumb on the two-way one. */
.view-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; isolation: isolate; }
.view-switch::before { content: ''; position: absolute; z-index: -1; inset: 4px auto 4px 4px; width: calc(50% - 4px); border-radius: var(--radius-pill); background: #e7efdd; transition: translate var(--dur-base) var(--ease-spring-snappy); }
.coverage-atlas[data-view=list] .view-switch::before { translate: 100% 0; }
.view-switch button, .view-switch button[aria-pressed=true] { background: transparent; transition: color var(--dur-fast) var(--ease-out), scale var(--dur-press) var(--ease-out); }
.region-switch { display: flex; gap: 4px; padding: 4px; margin-left: auto; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; border: 1px solid #45614c; border-radius: var(--radius-pill); background: #0b1e17; }
.region-switch::-webkit-scrollbar { display: none; }
.region-switch button { flex: 0 0 auto; min-height: 44px; padding: 10px 16px; border: 0; border-radius: var(--radius-pill); background: transparent; color: #cbdacf; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), scale var(--dur-press) var(--ease-out); }
.region-switch button[aria-pressed=true] { background: #2c4a36; color: #f2f7ee; box-shadow: inset 0 0 0 1px #6f8f66; }
.region-switch button:active { scale: var(--press-scale); }

/* Pager: arrows around a plain position, as in the app's lists. */
.page-status { font-size: 13px; font-weight: 600; color: #d2e2c8; font-variant-numeric: tabular-nums; }
.seller-dialog .page-status { color: #38533c; }
.area-count { font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  /* Search field on its own row; the three actions share the next one. */
  .atlas-search .search-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .near-me { order: 1; min-width: 0; padding-inline: 10px; }
  .atlas-toolbar .region-switch { width: 100%; margin: 0; }
  .region-switch button { flex: 1 0 auto; }
}
@media (max-width: 400px) {
  .atlas-search .search-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atlas-search .search-form .search-submit { grid-column: 1 / -1; }
}

/* ---- How to buy --------------------------------------------------------- */
.steps { padding-top: 64px; }
.steps-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; padding: 0; }
.steps-list li { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-card); background: #fff; }
.step-number { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 20px; border-radius: var(--radius-pill); background: #eaf0e3; color: #223a2b; font-size: 15px; font-weight: 600; }
.steps-list h3 { font-size: 18px; line-height: 1.3; letter-spacing: -.025em; margin-bottom: 8px; }
.steps-list p { font-size: 14px; line-height: 1.6; color: var(--muted); }

/* ---- Footer ------------------------------------------------------------- */
.footer-inner { align-items: flex-start; }
.footer-inner > p { flex: 1; }
.footer-links { display: grid; gap: 2px; min-width: 150px; }
.footer-links h2 { font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink); margin-bottom: 6px; }
.footer-links a, .footer-inner .footer-links > a:last-child { padding-block: 9px; font-size: 14px; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---- Floating WhatsApp --------------------------------------------------- */
.wa-float {
  position: fixed; z-index: 30; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px 0 16px;
  border-radius: var(--radius-pill); background: #25d366; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none;
  box-shadow: var(--specular), 0 14px 32px -14px #101412a6;
  transition: opacity var(--dur-base) var(--ease-out), translate var(--dur-base) var(--ease-out), scale var(--dur-press) var(--ease-out), background var(--dur-fast) var(--ease-out), visibility 0s;
}
/* WhatsApp's own green so the button is recognised at a glance. The label is dark: white on this green is too faint to read. */
.wa-float span { color: #06301a; }
.wa-float:hover { background: #1fbe5a; }
.wa-float:active { scale: var(--press-scale); }
.wa-float.is-away { opacity: 0; translate: 0 12px; visibility: hidden; pointer-events: none; transition: opacity var(--dur-fast) var(--ease-in), translate var(--dur-fast) var(--ease-in), visibility 0s linear var(--dur-fast); }

@media (max-width: 680px) {
  .steps-list { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 20px; }
  .steps-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; padding: 16px; }
  .step-number { grid-row: 1 / 3; margin: 0; }
  .steps-list h3 { font-size: 16px; margin-bottom: 4px; }
  .steps .button { width: 100%; }
  .footer-inner > p { flex-basis: 100%; }
  .footer-links { flex: 1; min-width: 130px; }
  /* Icon only on a phone, so it never covers the content beside it. */
  .wa-float { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: 52px; padding: 0; justify-content: center; }
  .wa-float span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (prefers-reduced-motion: reduce) { .wa-float, .wa-float.is-away { transition: none; } }

/* ---- Enquiry screening --------------------------------------------------- */
/* The result scrolls into view with room to spare, so its button is never flush with, or under, the screen edge. */
.enquiry-result { scroll-margin-block: 96px 28px; padding: 18px; border-radius: var(--radius-field); background: #eaf0e3; display: grid; gap: 10px; justify-items: start; }
.enquiry-result[hidden] { display: none; }
.enquiry-result:focus-visible { outline: 2px solid #223a2b; outline-offset: 2px; }
/* h4 is not in the page's heading reset, so its default margins are cleared here. */
.enquiry-result h4 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -.02em; }
.join-form .enquiry-result p { margin: 0; font-size: 14px; line-height: 1.55; color: #3d4a3f; }
.enquiry-result .button { min-height: 44px; padding: 10px 18px; }

/* "Hubungi": three plain choices in the same sheet the seller list uses. */
.contact-dialog { width: 560px; }
.contact-options { display: grid; gap: 10px; }
.contact-options button {
  display: grid; gap: 4px; width: 100%; min-height: 64px; padding: 16px 44px 16px 18px; position: relative; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-card); background: #fff; color: var(--ink); font: inherit;
  transition: border-color var(--dur-fast) var(--ease-out), scale var(--dur-press) var(--ease-out);
}
.contact-options button::after { content: '›'; position: absolute; right: 18px; top: 50%; translate: 0 -55%; font-size: 24px; color: var(--red); }
.contact-options button:hover { border-color: #bdc9b5; }
.contact-options button:active { scale: var(--press-scale); }
.contact-options strong { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.contact-options span { font-size: 13px; line-height: 1.5; color: var(--muted); }
.wa-float { border: 0; font-family: inherit; cursor: pointer; }
