/* OLYA — busca, páginas de conta e de categoria */

/* ---------- busca ---------- */
.search {
  position: fixed; inset: 0; z-index: 110; background: rgba(35, 38, 30, .55); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility 0s .4s;
}
.search.is-open { opacity: 1; visibility: visible; transition: opacity .4s var(--ease); }
.search__inner {
  background: var(--linen-50); padding: 1.25rem clamp(1rem, 3vw, 2rem) 1.75rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: var(--shadow-lg);
  max-height: 85vh; overflow-y: auto; transform: translateY(-16px); transition: transform .45s var(--ease);
}
.search.is-open .search__inner { transform: none; }
.search__bar { display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid var(--gold-500); padding-bottom: .5rem; }
.search__bar > svg { width: 22px; height: 22px; color: var(--gold-500); flex-shrink: 0; }
.search__bar input { flex: 1; min-width: 0; border: 0; background: none; font-family: var(--font-display); font-size: clamp(1.4rem, 2vw + .8rem, 2rem); color: var(--ink-900); padding: .4rem 0; }
.search__bar input:focus { outline: none; }
.search__bar input::-webkit-search-cancel-button { display: none; }
.search__bar .icon-btn { color: var(--olive-800); }
.search__hint { margin-top: 1.25rem; }
.search__chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.search__chips button { padding: .4rem 1rem; border: 1px solid var(--sand-200); border-radius: var(--radius-pill); font-size: .875rem; transition: border-color .3s, color .3s; }
.search__chips button:hover { border-color: var(--gold-500); color: var(--gold-700); }
.search__count { margin-top: 1rem; font-size: .875rem; color: var(--ink-600); }
.search__count:empty { display: none; }
.search__results { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .25rem; }
.search__item { display: grid; grid-template-columns: 56px 1fr auto; gap: 1rem; align-items: center; padding: .6rem; border-radius: var(--radius-md); transition: background .3s; }
.search__item:hover, .search__item:focus-visible { background: var(--linen-100); }
.search__item img { width: 56px; height: 70px; object-fit: cover; border-radius: var(--radius-sm); }
.search__item strong { display: block; font-family: var(--font-label); font-weight: 500; letter-spacing: .1em; font-size: .9375rem; color: var(--olive-900); }
.search__item em { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink-600); }
.search__price { font-weight: 500; }

/* usuário conectado (demo) */
#userBtn.is-logged::after { content: ""; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-gradient); box-shadow: 0 0 0 2px var(--olive-800); }

/* ---------- páginas de conta ---------- */
.auth { display: grid; min-height: calc(100svh - var(--header-h) - 30px); }
.auth__aside {
  position: relative; overflow: hidden; isolation: isolate; display: none;
  background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(192, 156, 96, .22), transparent 65%), var(--olive-900);
  color: var(--linen-50); padding: clamp(2.5rem, 5vw, 4.5rem); align-content: center; justify-items: center; text-align: center;
}
.auth__aside::after { content: ""; position: absolute; inset: 18px; border: 1px solid rgba(168, 132, 72, .45); border-radius: var(--radius-lg); pointer-events: none; }
.auth__aside img { width: min(240px, 60%); filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .35)); }
.auth__aside blockquote { margin: 2rem 0 0; font-family: var(--font-display); font-style: italic; font-size: clamp(1.4rem, 1vw + 1rem, 1.9rem); line-height: 1.35; color: var(--gold-200); max-width: 420px; }
.auth__main { display: grid; place-items: center; padding: clamp(2.5rem, 6vw, 5rem) var(--gutter); }
.auth__card { width: min(100%, 440px); }
.auth__card h1 { font-size: var(--fs-h1); font-weight: 400; margin-top: .6rem; }
.auth__lead { margin-top: .6rem; color: var(--ink-600); }
.auth__form { display: grid; gap: 1.1rem; margin-top: 2rem; }
.field { display: grid; gap: .4rem; }
.field > label { font-size: .8125rem; font-weight: 500; letter-spacing: .06em; color: var(--ink-900); }
.field__wrap { position: relative; }
.field input {
  width: 100%; min-height: 50px; padding: .75rem 1.1rem; border: 1px solid var(--sand-200); border-radius: var(--radius-md);
  background: #fff; font: inherit; font-size: 1rem; color: var(--ink-900); transition: border-color .3s, box-shadow .3s;
}
.field input:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(168, 132, 72, .15); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field__wrap input { padding-right: 3.2rem; }
.field__toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; display: grid; place-items: center; color: var(--olive-400); border-radius: 50%; }
.field__toggle:hover { color: var(--olive-800); }
.field__toggle svg { width: 20px; height: 20px; }
.field__err { font-size: .8125rem; color: var(--danger); }
.field__err:empty { display: none; }
.field__hint { font-size: .8125rem; color: var(--ink-600); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: .2rem; }
.strength i { height: 3px; border-radius: 3px; background: var(--sand-200); transition: background .3s; }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--gold-400); }
.strength[data-level="3"] i:nth-child(-n+3) { background: var(--olive-400); }
.strength[data-level="4"] i { background: var(--success); }
.auth__row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .875rem; }
.auth__link { color: var(--gold-700); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(122, 86, 38, .35); }
.auth__link:hover { text-decoration-color: currentColor; }
.auth .check { color: var(--ink-600); }
.or { display: flex; align-items: center; gap: 1rem; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-600); margin: .4rem 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--sand-200); }
.btn--google { border: 1px solid var(--sand-200); background: #fff; color: var(--ink-900); letter-spacing: .04em; text-transform: none; font-size: .9375rem; font-weight: 400; }
.btn--google:hover { border-color: var(--gold-500); }
.btn--google svg { width: 20px; height: 20px; }
.auth__switch { margin-top: 2rem; text-align: center; font-size: .9375rem; color: var(--ink-600); }
.auth__demo { margin-top: 1.5rem; font-size: .75rem; color: var(--ink-600); text-align: center; padding: .6rem .9rem; border: 1px dashed var(--sand-200); border-radius: var(--radius-md); }
.alert { padding: .8rem 1rem; border-radius: var(--radius-md); font-size: .9rem; }
.alert:empty { display: none; }
.alert--error { background: rgba(155, 59, 46, .08); color: var(--danger); border: 1px solid rgba(155, 59, 46, .25); }
.alert--ok { background: rgba(79, 107, 58, .1); color: var(--success); border: 1px solid rgba(79, 107, 58, .25); }
.code { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(.35rem, 1.5vw, .7rem); }
.code input {
  width: 100%; aspect-ratio: 4 / 5; text-align: center; font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.2rem);
  border: 1px solid var(--sand-200); border-radius: var(--radius-md); background: #fff; color: var(--olive-900); padding: 0;
}
.code input:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(168, 132, 72, .15); }
.logged { text-align: center; }
.logged__avatar { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 1.25rem; display: grid; place-items: center; background: var(--olive-800); color: var(--gold-200); font-family: var(--font-label); font-size: 2rem; box-shadow: 0 0 0 1px var(--gold-500), 0 0 0 6px var(--linen-50), 0 0 0 7px rgba(168, 132, 72, .4); }
.logged .btn { margin-top: 1.5rem; }
@media (min-width: 960px) {
  .auth { grid-template-columns: 1fr 1fr; }
  .auth__aside { display: grid; }
}

/* ---------- páginas de categoria ---------- */
.cat-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--olive-900); color: var(--linen-50); }
.cat-hero__bg { position: absolute; inset: 0; z-index: -2; }
.cat-hero__bg img { width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.cat-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(47, 58, 38, .95) 0%, rgba(47, 58, 38, .7) 55%, rgba(47, 58, 38, .35) 100%); }
.cat-hero__inner { padding-block: clamp(3rem, 7vw, 5.5rem); }
.cat-hero__text { max-width: 640px; }
.cat-hero .breadcrumb { color: var(--olive-200); padding: 0 0 1.5rem; }
.cat-hero .breadcrumb a:hover { color: var(--gold-200); }
.cat-hero .breadcrumb span[aria-current] { color: var(--gold-200); }
.cat-hero h1 { font-family: var(--font-label); font-weight: 500; letter-spacing: .22em; font-size: clamp(2.25rem, 4vw + 1rem, 4rem); margin-top: .75rem; background: var(--gold-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cat-hero p { margin-top: 1.1rem; font-family: var(--font-display); font-style: italic; font-size: clamp(1.2rem, .8vw + 1rem, 1.5rem); line-height: 1.45; color: var(--linen-50); }
.cat-nav { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2rem; }
.cat-nav a { padding: .45rem 1.1rem; border: 1px solid rgba(224, 201, 154, .4); border-radius: var(--radius-pill); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--olive-200); transition: all .3s; }
.cat-nav a:hover { color: var(--gold-200); border-color: var(--gold-200); }
.cat-nav a[aria-current="page"] { background: var(--gold-gradient); color: var(--olive-900); border-color: transparent; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--sand-200); }
.toolbar p { font-size: .9375rem; color: var(--ink-600); }
.toolbar label { font-size: .8125rem; color: var(--ink-600); display: flex; align-items: center; gap: .6rem; }
.toolbar select { min-height: 42px; padding: .4rem 1rem; border: 1px solid var(--sand-200); border-radius: var(--radius-pill); background: #fff; font: inherit; font-size: .875rem; color: var(--ink-900); }
.card--soon { background: transparent; border: 1px dashed var(--gold-400); display: grid; place-items: center; text-align: center; padding: 2rem 1.5rem; min-height: 320px; }
.card--soon:hover { transform: none; box-shadow: none; }
.card--soon img { width: 72px; margin: 0 auto 1rem; }
.card--soon p { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--olive-800); line-height: 1.35; }
.card--soon span { display: block; margin-top: .6rem; font-size: .8125rem; color: var(--ink-600); }

/* páginas de conta encostam no rodapé (sem faixa clara entre o painel verde e o footer) */
main.auth ~ .footer { margin-top: 0; }
main.auth ~ .footer::before { display: none; }
.logged__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ---------- menu do usuário ---------- */
.user-menu { position: relative; }
.user-drop {
  position: absolute; top: calc(100% + 14px); right: -.5rem; z-index: 60; width: 260px;
  background: var(--linen-50); color: var(--ink-900); border: 1px solid var(--sand-200); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: .5rem; animation: dropIn .25s var(--ease);
}
.user-drop::before { content: ""; position: absolute; top: -6px; right: 1.35rem; width: 11px; height: 11px; background: var(--linen-50); border-left: 1px solid var(--sand-200); border-top: 1px solid var(--sand-200); transform: rotate(45deg); }
.user-drop__head { display: flex; gap: .75rem; align-items: center; padding: .6rem .6rem .85rem; margin-bottom: .35rem; border-bottom: 1px solid var(--sand-200); }
.user-drop__head strong { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; line-height: 1.2; }
.user-drop__head span { display: block; font-size: .75rem; color: var(--ink-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.user-drop__avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--olive-800); color: var(--gold-200); font-family: var(--font-label); box-shadow: 0 0 0 1px var(--gold-500); }
.user-drop__avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-drop__head .user-drop__avatar span { display: block; max-width: none; font-size: 1.05rem; color: var(--gold-200); }
.user-drop a, .user-drop button { display: flex; width: 100%; align-items: center; gap: .7rem; padding: .6rem .6rem; border-radius: var(--radius-sm); font-size: .9375rem; color: var(--ink-900); text-align: left; }
.user-drop a:hover, .user-drop button:hover, .user-drop a:focus-visible, .user-drop button:focus-visible { background: var(--linen-100); color: var(--olive-800); outline: none; }
.user-drop svg { width: 18px; height: 18px; color: var(--gold-500); }
.user-drop button { border-top: 1px solid var(--sand-200); margin-top: .35rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding-top: .75rem; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } }

/* carrinho: botões desativados e carregando */
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.drawer__items[aria-busy="true"] { opacity: .6; pointer-events: none; transition: opacity .2s; }

/* ---------- área do cliente ---------- */
.account-hero { background: var(--olive-900); color: var(--linen-50); position: relative; overflow: hidden; isolation: isolate; }
.account-hero .container { padding-block: clamp(2.5rem, 5vw, 4rem); display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.account-hero h1 { font-size: var(--fs-h1); font-weight: 400; margin-top: .4rem; }
.account-hero .breadcrumb { color: var(--olive-200); padding: 0 0 .75rem; }
.account-hero .breadcrumb span[aria-current] { color: var(--gold-200); }
.account-hero .logged__avatar { margin: 0; box-shadow: 0 0 0 1px var(--gold-500), 0 0 0 6px var(--olive-900), 0 0 0 7px rgba(168, 132, 72, .5); }
.account-grid { display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .account-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .account-grid { grid-template-columns: repeat(3, 1fr); } }
.account-card { background: var(--linen-100); border: 1px solid var(--sand-200); border-radius: var(--radius-lg); padding: 1.75rem; display: flex; flex-direction: column; gap: .75rem; transition: border-color .4s var(--ease), transform .4s var(--ease); }
a.account-card:hover { border-color: var(--gold-500); transform: translateY(-3px); }
.account-card > svg { width: 28px; height: 28px; color: var(--gold-500); }
.account-card h2 { font-family: var(--font-label); font-size: .9375rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--olive-800); }
.account-card p, .account-card dd { color: var(--ink-600); font-size: .9375rem; margin: 0; }
.account-card dl { display: grid; gap: .5rem; margin: 0; }
.account-card dt { font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--olive-400); }
.account-card .soon { font-size: .75rem; color: var(--gold-700); }
.empty-state { text-align: center; padding: clamp(3rem, 8vw, 5rem) 1rem; border: 1px dashed var(--gold-400); border-radius: var(--radius-lg); }
.empty-state img { width: 84px; margin: 0 auto 1.25rem; }
.empty-state h2 { font-size: var(--fs-h2); font-weight: 400; }
.empty-state p { margin: .75rem auto 1.75rem; color: var(--ink-600); max-width: 420px; }

/* newsletter: campo armadilha invisível e mensagem de erro */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg.is-error { color: var(--danger-200); }
/* Turnstile: invisível na maioria das vezes; quando pede um clique, aparece aqui */
.ts-box:empty { display: none; }
.ts-box iframe { max-width: 100%; }

/* dados da conta (formulário) */
.account-card--wide { grid-column: 1 / -1; }
.form-grid { display: grid; gap: 1rem 1.5rem; }
@media (min-width: 760px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.account-card .field input[readonly] { background: var(--linen-50); color: var(--ink-600); cursor: not-allowed; }
.account-card .field input:disabled { opacity: .6; }
.profile-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }

/* catálogo vindo do banco: esgotado, preço "de/por", carregando */
.card--out .card__media img { filter: grayscale(.35) opacity(.8); }
.card__soldout { font-family: var(--font-label); font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-600); padding: .4rem .75rem; border: 1px solid var(--sand-200); border-radius: var(--radius-pill); }
.card__price s, .pdp__price s { font-weight: 300; font-size: .85em; color: var(--ink-600); margin-right: .3rem; }
.variants button.is-out { color: var(--ink-600); text-decoration: line-through; }
.skeleton-text { min-width: 8ch; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--linen-100), var(--sand-200), var(--linen-100)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.price[data-price]:empty, .price[data-price] { min-height: 2.6em; display: inline-block; }

/* acesso ao painel (só para quem está em ADMIN_EMAILS) */
.user-drop a.user-drop__admin { color: var(--gold-700); font-weight: 500; }
.account-card--admin { border-color: var(--gold-400); background: linear-gradient(135deg, var(--linen-100), var(--linen-50)); }

/* botão de finalizar com carrinho vazio */
.btn.is-disabled { opacity: .45; pointer-events: none; }

/* formulário de endereço compartilhado (Minha conta e checkout) */
.addr-form, .addr-form .fgrid { display: grid; gap: 1rem; }
@media (min-width: 640px) {
  .addr-form .fgrid--2 { grid-template-columns: 1fr 1fr; }
  .addr-form .fgrid--cep { grid-template-columns: 180px 1fr; }
  .addr-form .fgrid--num { grid-template-columns: 140px 1fr; }
  .addr-form .fgrid--city { grid-template-columns: 1fr 110px; }
}
.addr-form select { width: 100%; min-height: 50px; padding: .75rem 1rem; border: 1px solid var(--sand-200); border-radius: var(--radius-md); background: #fff; font: inherit; }
.addr-form select:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(168, 132, 72, .15); }
.addr-form select[aria-invalid="true"] { border-color: var(--danger); }

/* Minha conta → Endereços */
.addr-list { display: grid; gap: 1rem; }
@media (min-width: 760px) { .addr-list { grid-template-columns: repeat(2, 1fr); } }
.addr-card { background: #fff; border: 1px solid var(--sand-200); border-radius: var(--radius-lg); padding: 1.35rem 1.5rem; display: grid; gap: .6rem; align-content: start; transition: border-color .3s; }
.addr-card.is-default { border-color: var(--gold-400); box-shadow: var(--shadow); }
.addr-card h3 { font-family: var(--font-label); font-size: .875rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--olive-800); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.addr-card .tag { font-family: var(--font-label); font-size: .625rem; letter-spacing: .14em; color: var(--gold-700); border: 1px solid var(--gold-400); border-radius: var(--radius-pill); padding: .15rem .55rem; }
.addr-card p { color: var(--ink-600); font-size: .9375rem; line-height: 1.6; }
.addr-card__actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .25rem; }
.addr-card__actions button { font-size: .8125rem; color: var(--gold-700); text-decoration: underline; text-underline-offset: 3px; }
.addr-card__actions button.danger { color: var(--danger); }
.addr-panel { background: #fff; border: 1px solid var(--gold-400); border-radius: var(--radius-lg); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow); }
.addr-panel h2 { font-size: var(--fs-h3); font-weight: 400; margin-bottom: 1.25rem; }
.addr-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.addr-toolbar p { color: var(--ink-600); }

/* ---------- avaliar pedido ---------- */
.rv-items { list-style: none; margin: 0 0 .5rem; padding: .75rem 1rem; border: 1px solid var(--sand-200); border-radius: var(--radius-md); background: var(--linen-50); display: grid; gap: .35rem; font-size: var(--fs-small); color: var(--olive-900); }
.rv-items span { color: var(--ink-600); }
.rv-stars { border: 0; margin: 0; padding: 0; display: grid; justify-items: center; gap: .35rem; }
.rv-stars legend { font-family: var(--font-label); font-size: var(--fs-label); letter-spacing: .2em; text-transform: uppercase; color: var(--olive-800); margin: 0 auto .4rem; }
.rv-stars__row { display: flex; gap: .25rem; }
.rv-stars__row button { width: 48px; height: 48px; border: 0; background: none; padding: 4px; cursor: pointer; color: var(--sand-200); border-radius: var(--radius-sm); transition: transform .15s var(--ease), color .15s var(--ease); }
.rv-stars__row button svg { width: 100%; height: 100%; fill: currentColor; }
.rv-stars__row button.is-on { color: var(--gold-500); }
.rv-stars__row button:hover { transform: scale(1.08); }
.rv-stars__row button:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.rv-stars__label { margin: 0; min-height: 1.5em; font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--olive-800); }
.rv-form[hidden] { display: none; }
.rv-form textarea { width: 100%; resize: vertical; font: inherit; font-size: var(--fs-small); padding: .75rem .9rem; border: 1px solid var(--sand-200); border-radius: var(--radius-md); background: #fff; color: var(--ink-900); }
.rv-form textarea:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(168, 132, 72, .15); }
@media (prefers-reduced-motion: reduce) { .rv-stars__row button { transition: none; } }
