/* =========================================================
   Search, cart drawer and info panels (glass, green + gold).
   Sized in px so they stay readable at every screen width.
   ========================================================= */
html.af-lock { overflow: hidden; }

.af-dialog {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none;
  background: transparent; color: #1f2a1f; font-family: var(--sans);
}
.af-dialog:not([open]) { display: none; } /* keep closed panels hidden despite their flex layout */
.af-dialog::backdrop {
  background: rgba(0, 24, 10, .42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: afFade .3s ease;
}
.af-dialog.closing::backdrop { animation: afFade .22s ease reverse forwards; }

/* shared glass surface */
.af-search, .af-modal {
  background: linear-gradient(160deg, rgba(255,253,245,.94), rgba(250,246,232,.88));
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(220,188,106,.28), 0 30px 80px -20px rgba(0,30,12,.55);
}

.af-x {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-size: 24px; line-height: 1; color: #1f2a1f;
  background: rgba(255,255,255,.75); border: 1px solid rgba(220,188,106,.45);
  transition: transform .25s, background .25s, color .25s;
}
.af-x:hover { transform: rotate(90deg); background: #0f4a1e; color: #fff; }
.af-small { font-size: 12.5px; color: #5b6657; margin-top: 10px; }
.af-small a, .af-modal-body a { color: #145c27; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Search ---------- */
.af-search {
  position: fixed; inset: 84px auto auto 50%; transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 110px));
  border-radius: 22px; display: flex; flex-direction: column; overflow: hidden;
}
.af-search[open] { animation: afDrop .35s cubic-bezier(.2,.8,.2,1); }
.af-search.closing { animation: afDrop .22s ease reverse forwards; }
.af-search-field {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 20px;
  border-bottom: 1px solid rgba(220,188,106,.35);
}
.af-search-field > svg { width: 20px; height: 20px; color: #135522; flex: none; }
.af-search-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 17px; color: #1f2a1f; padding: 8px 0;
}
.af-search-field input::placeholder { color: #8a9486; }
.af-search-field input::-webkit-search-cancel-button { display: none; }
.af-results { overflow-y: auto; padding: 8px 10px 10px; overscroll-behavior: contain; }
.af-group { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #8b5a1e; padding: 12px 10px 6px; }
.af-result {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; text-align: left;
  transition: background .2s, box-shadow .2s;
}
.af-result img, .af-ico { width: 44px; height: 44px; border-radius: 12px; flex: none; object-fit: cover; }
.af-ico { display: grid; place-items: center; color: #135522; background: radial-gradient(circle at 35% 30%, #fff, #f3ecd5); border: 1px solid rgba(220,188,106,.5); }
.af-ico svg { width: 20px; height: 20px; }
.af-result > span:not(.af-ico) { flex: 1; min-width: 0; }
.af-result strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 16px; color: #0e3b1c; }
.af-result small { display: block; font-size: 13px; color: #5b6657; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-go { width: 14px; height: 14px; color: #b9a46a; flex: none; transition: transform .2s; }
.af-result.active { background: rgba(255,255,255,.95); box-shadow: 0 0 0 1px rgba(220,188,106,.55), 0 8px 18px -10px rgba(15,59,28,.35); }
.af-result.active .af-go { transform: translateX(3px); color: #135522; }
.af-noresult { padding: 26px 14px; text-align: center; color: #5b6657; font-size: 14px; }
.af-search-hint { padding: 10px 18px; border-top: 1px solid rgba(220,188,106,.25); font-size: 12px; color: #6d7869; }
.af-search-hint kbd {
  display: inline-block; min-width: 20px; padding: 1px 6px; margin: 0 2px; border-radius: 6px; text-align: center;
  font: 700 11px/18px var(--sans); color: #135522; background: #fff; border: 1px solid rgba(220,188,106,.55);
}

/* ---------- Info modal ---------- */
.af-modal {
  position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 48px));
  border-radius: 24px; display: flex; flex-direction: column; overflow: hidden;
}
.af-modal[open] { animation: afPopCenter .38s cubic-bezier(.2,.8,.2,1); }
.af-modal.closing { animation: afPopCenter .22s ease reverse forwards; }
.af-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 22px 14px 26px;
  border-bottom: 1px solid rgba(220,188,106,.35);
}
.af-modal-head h2::before {
  content: ""; width: 6px; height: 26px; border-radius: 3px; background: linear-gradient(180deg, #e6c46e, #c08f2e);
}
.af-modal-body { overflow-y: auto; padding: 18px 26px 26px; font-size: 15px; line-height: 1.6; color: #2f3a2e; overscroll-behavior: contain; }
.af-points { display: grid; gap: 12px; }
.af-points li {
  position: relative; padding: 12px 14px 12px 44px; border-radius: 14px;
  background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 0 0 1px rgba(220,188,106,.2);
}
.af-points li::before {
  content: ""; position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2f8a3c, #0b3f19); box-shadow: 0 0 0 3px rgba(220,188,106,.35);
}
.af-points strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 16px; color: #0e3b1c; margin-bottom: 2px; }
.af-faq { display: grid; gap: 10px; }
.af-faq details { border-radius: 14px; background: rgba(255,255,255,.78); box-shadow: 0 0 0 1px rgba(220,188,106,.25); overflow: hidden; }
.af-faq summary {
  list-style: none; cursor: pointer; padding: 14px 44px 14px 16px; position: relative;
  font-family: var(--serif); font-size: 16px; color: #0e3b1c;
}
.af-faq summary::-webkit-details-marker { display: none; }
.af-faq summary::after {
  content: "+"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font: 700 16px/1 var(--sans); color: #fff; background: linear-gradient(180deg, #1c7032, #0b3f19); transition: transform .3s;
}
.af-faq details[open] summary::after { content: "−"; transform: translateY(-50%) rotate(180deg); }
.af-faq details p { padding: 0 16px 14px; color: #3d483b; }
.af-track { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.af-track input {
  flex: 1 1 220px; min-width: 0; height: 46px; padding: 0 16px; border-radius: 99px;
  border: 1px solid rgba(220,188,106,.7); background: #fff; font: inherit; font-size: 15px; outline: 0;
  transition: box-shadow .2s, border-color .2s;
}
.af-track input:focus { border-color: #135522; box-shadow: 0 0 0 3px rgba(19,85,34,.15); }

/* ---------- Investor registration form ---------- */
.af-invest { width: min(640px, calc(100vw - 32px)); max-height: min(780px, calc(100vh - 32px)); }
.inv-intro { font-size: 14.5px; line-height: 1.55; color: #3d483b; margin-bottom: 18px; }
.inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.inv-span { grid-column: 1 / -1; }
.inv-field > span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: #0e3b1c; }
.inv-field em, .inv-consent em { font-style: normal; color: #b3412b; }
.inv-field input, .inv-field select, .inv-field textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1px solid rgba(220,188,106,.7); background: #fff; outline: 0;
  font: inherit; font-size: 15px; color: #1f2a1f;
  transition: border-color .2s, box-shadow .2s;
}
.inv-field textarea { height: auto; min-height: 88px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.inv-field select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23135522' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.inv-field input::placeholder, .inv-field textarea::placeholder { color: #9aa396; }
.inv-field input:focus, .inv-field select:focus, .inv-field textarea:focus { border-color: #135522; box-shadow: 0 0 0 3px rgba(19,85,34,.15); }
.inv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.inv-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.45; color: #3d483b; cursor: pointer; }
.inv-consent input { flex: none; width: 18px; height: 18px; margin-top: 1px; accent-color: #135522; cursor: pointer; }
.inv-error { margin-top: 16px; padding: 11px 14px; border-radius: 12px; background: #fbe9e4; color: #9a3412; font-size: 13.5px; font-weight: 600; }
.inv-error[hidden] { display: none; }
.inv-submit { width: 100%; height: 50px; margin-top: 18px; font-size: 15.5px; }
.inv-submit svg { width: 20px !important; height: 20px !important; }
.inv-submit.is-loading { opacity: .8; cursor: progress; }
.inv-done { text-align: center; padding: 26px 8px 10px; }
.inv-done[hidden], .inv-form[hidden] { display: none; }
.inv-done .af-empty-ring {
  display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; color: #135522;
  background: radial-gradient(circle at 32% 26%, #fff, #f5eed8); border: 2px solid #dcbc6a;
  box-shadow: 0 0 0 6px rgba(255,255,255,.7), 0 14px 26px -12px rgba(15,59,28,.4);
}
.inv-done .af-empty-ring svg { width: 38px; height: 38px; }
.inv-done h3 { font-family: var(--serif); font-weight: 700; font-size: 22px; color: #0e3b1c; margin-top: 18px; }
.inv-done p { font-size: 14.5px; color: #5b6657; margin: 8px auto 20px; max-width: 380px; }
.inv-done .btn { height: 46px; padding: 0 30px; font-size: 15px; }

/* ---------- Highlight a product card or section reached from search / footer ---------- */
.af-pulse { animation: afPulse 1.8s ease; }
@keyframes afPulse {
  0%, 100% { box-shadow: var(--glass-shadow, 0 .25rem .9rem rgba(90,75,30,.12)); }
  25%, 65% { box-shadow: 0 0 0 4px rgba(230,196,110,.95), 0 0 0 10px rgba(230,196,110,.25), 0 20px 40px -12px rgba(15,59,28,.45); }
}

/* ---------- Motion ---------- */
@keyframes afFade { from { opacity: 0; } }
@keyframes afDrop { from { opacity: 0; transform: translate(-50%, -18px) scale(.97); } }
@keyframes afPopCenter { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } }

@media (max-width: 560px) {
  .af-search { inset: 12px auto auto 50%; max-height: calc(100vh - 24px); border-radius: 18px; }
  .af-search-hint { display: none; }
  .af-modal { border-radius: 20px; }
  .inv-grid { grid-template-columns: 1fr; }
  .af-modal-body { padding: 16px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .af-dialog, .af-dialog::backdrop { animation: none !important; }
}
