/* ==========================================================================
   WALLSites Core — estilos dos componentes
   Autossuficiente: não depende do tema para os tokens (usa fallback).
   Carregado apenas quando um bloco WALLSites está na página.
   ========================================================================== */

.ws-btn,
.ws-chip,
.ws-tag,
.ws-card,
.ws-mini,
.ws-tab,
.ws-acc__btn,
.ws-locator__item,
.ws-form,
.ws-timeline__step {
	--ws-ink: var(--wp--preset--color--ink, #0e1316);
	--ws-ink-2: var(--wp--preset--color--ink-soft, #1b2429);
	--ws-muted: var(--wp--preset--color--ink-muted, #64747d);
	--ws-line: var(--wp--preset--color--line, #e3e7e9);
	--ws-line-strong: #cfd6da;
	--ws-surface: var(--wp--preset--color--surface, #f5f7f6);
	--ws-surface-2: var(--wp--preset--color--surface-2, #eef1f0);
	--ws-accent: var(--ws-accent, #12c46a);
	--ws-accent-soft: var(--wp--preset--color--accent-soft, #e6f8ee);
	--ws-accent-ink: var(--wp--preset--color--accent-ink, #062e1a);
	--ws-dur: 260ms;
	--ws-ease: cubic-bezier(.2, .7, .3, 1);
	--ws-radius: 14px;
}

.ws-visually-hidden {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------- Botões -------------------------------- */
.ws-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 18px; border-radius: 999px; border: 1px solid transparent;
	background: var(--ws-ink); color: #fff; font-size: .92rem; font-weight: 700;
	line-height: 1.2; text-decoration: none; cursor: pointer;
	transition: transform var(--ws-dur) var(--ws-ease), background var(--ws-dur) var(--ws-ease), box-shadow var(--ws-dur) var(--ws-ease);
}
.ws-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px -10px rgba(14,19,22,.4); }
.ws-btn--accent { background: var(--ws-accent); color: var(--ws-accent-ink); }
.ws-btn--accent:hover { color: var(--ws-accent-ink); }
.ws-btn--ghost { background: transparent; color: var(--ws-ink); border-color: var(--ws-line-strong); }
.ws-btn--ghost:hover { color: var(--ws-ink); background: var(--ws-surface); }
.ws-btn--on-dark { background: #fff; color: var(--ws-ink); }
.ws-btn--sm { padding: 8px 13px; font-size: .82rem; }
.ws-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.ws-btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ws-iconbtn {
	width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ws-line-strong);
	background: #fff; display: inline-grid; place-items: center; cursor: pointer; color: var(--ws-ink);
	transition: background var(--ws-dur) var(--ws-ease), border-color var(--ws-dur) var(--ws-ease);
}
.ws-iconbtn:hover { background: var(--ws-surface); border-color: var(--ws-ink); }
.ws-iconbtn[disabled] { opacity: .4; cursor: not-allowed; }

.ws-tag {
	display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
	background: var(--ws-surface-2); font-size: .72rem; font-weight: 700; letter-spacing: .04em;
	text-transform: uppercase; color: #46545c; text-decoration: none;
}
.ws-tag--accent { background: var(--ws-accent-soft); color: var(--ws-accent-ink); }
.ws-chip {
	border: 1px solid var(--ws-line-strong); background: #fff; border-radius: 999px;
	padding: 7px 14px; font-size: .82rem; font-weight: 600; cursor: pointer; color: #3a4750;
	transition: background var(--ws-dur) var(--ws-ease), color var(--ws-dur) var(--ws-ease);
	line-height: 1.3;
}
.ws-chip:hover { background: var(--ws-surface); }
.ws-chip[aria-pressed="true"] { background: var(--ws-ink); border-color: var(--ws-ink); color: #fff; }
.ws-small { font-size: .84rem; }
.ws-muted { color: var(--ws-muted); }
.ws-mono { font-family: var(--wp--preset--font-family--mono, ui-monospace, monospace); font-size: .78rem; }

/* -------------------------------- Banner --------------------------------- */
.ws-banner {
	position: relative; overflow: hidden; border-radius: var(--ws-radius);
	background: var(--ws-ink); color: #fff;
	display: grid; grid-template-columns: 1.06fr .94fr; align-items: stretch;
}
.ws-banner--media-left { grid-template-columns: .94fr 1.06fr; }
.ws-banner--media-left .ws-banner__content { order: 2; }
.ws-banner--media-top { grid-template-columns: 1fr; }
.ws-banner--media-top .ws-banner__media { order: -1; }
.ws-banner__content { padding: clamp(20px, 3vw, 38px); display: grid; gap: 12px; align-content: center; }
.ws-banner__title { margin: 0; color: #fff; font-size: clamp(1.3rem, 2.4vw, 1.9rem); line-height: 1.1; }
.ws-banner__text { margin: 0; color: #b6c4cb; font-size: .94rem; }
.ws-banner__media { min-height: 190px; background: var(--ws-ink-2); overflow: hidden; }
.ws-banner__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 720px) {
	.ws-banner { grid-template-columns: 1fr; }
	.ws-banner__media { order: -1; min-height: 150px; }
	.ws-banner--media-left .ws-banner__content { order: 0; }
}

/* animações configuráveis por bloco */
.ws-banner[data-ws-anim-style="none"] .ws-anim-target { animation: none !important; }
.ws-banner[data-ws-anim-style="fade"] .ws-anim-target { animation: wsFade var(--ws-anim-dur, 600ms) var(--ws-ease) both; }
.ws-banner[data-ws-anim-style="rise"] .ws-anim-target { animation: wsRise var(--ws-anim-dur, 600ms) var(--ws-ease) both; }
.ws-banner[data-ws-anim-style="slide"] .ws-anim-target { animation: wsSlide var(--ws-anim-dur, 600ms) var(--ws-ease) both; }
@keyframes wsFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes wsRise { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: translateY(0) } }
@keyframes wsSlide { from { opacity: 0; transform: translateX(-22px) } to { opacity: 1; transform: translateX(0) } }

/* --------------------------------- Cartões -------------------------------- */
.ws-cards-mini {
	display: grid; gap: 12px;
	grid-template-columns: repeat(var(--ws-cols, 3), minmax(0, 1fr));
}
@media (max-width: 780px) { .ws-cards-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ws-cards-mini { grid-template-columns: minmax(0, 1fr); } }
.ws-mini {
	position: relative; display: grid; gap: 8px; padding: 16px; border-radius: var(--ws-radius);
	border: 1px solid var(--ws-line); background: #fff; text-decoration: none; color: var(--ws-ink);
	transition: border-color var(--ws-dur) var(--ws-ease), background var(--ws-dur) var(--ws-ease), transform var(--ws-dur) var(--ws-ease);
	min-height: 44px;
}
.ws-mini b { font-size: .95rem; }
.ws-mini .desc { font-size: .84rem; color: var(--ws-muted); }
.ws-mini .more { font-size: .8rem; font-weight: 700; color: var(--ws-accent-ink); opacity: .6; }
.ws-mini:hover, .ws-mini:focus-visible, .ws-mini.is-active {
	border-color: var(--ws-accent); background: var(--ws-accent-soft); transform: translateY(-2px); color: var(--ws-ink);
}
.ws-mini:hover .more, .ws-mini:focus-visible .more { opacity: 1; }
.ws-mini__ico {
	width: 30px; height: 30px; border-radius: 9px; background: var(--ws-surface-2);
	display: grid; place-items: center;
}

/* ---------------------------------- Abas --------------------------------- */
.ws-tabs__list {
	display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--ws-line); margin-bottom: 16px;
}
.ws-tab {
	border: 0; background: transparent; font: inherit; font-size: .88rem; font-weight: 600; color: #5a6a72;
	padding: 11px 14px; min-height: 44px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
	border-radius: 8px 8px 0 0;
	transition: color var(--ws-dur) var(--ws-ease), border-color var(--ws-dur) var(--ws-ease), background var(--ws-dur) var(--ws-ease);
}
.ws-tab:hover { color: var(--ws-ink); background: var(--ws-surface); }
.ws-tab[aria-selected="true"] { color: var(--ws-ink); border-bottom-color: var(--ws-accent); }
.ws-tab-panel { padding: 4px 2px 0; }
.ws-tab-panel[hidden] { display: none; }
.ws-tab-panel h4 { margin: 0 0 6px; font-size: 1rem; }
.ws-tab-panel p { font-size: .92rem; color: #4b5a62; margin: 0; }

/* -------------------------------- Acordeão -------------------------------- */
.ws-accordion { display: grid; gap: 8px; }
.ws-acc__item { border: 1px solid var(--ws-line); border-radius: 12px; overflow: hidden; background: #fff; }
.ws-acc__item.is-open { border-color: var(--ws-accent); }
.ws-acc__btn {
	width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 48px;
	background: transparent; border: 0; font: inherit; font-weight: 700; font-size: .92rem;
	text-align: left; cursor: pointer; color: var(--ws-ink);
}
.ws-acc__btn:hover { background: var(--ws-surface); }
.ws-acc__btn .ico {
	margin-left: auto; width: 22px; height: 22px; border-radius: 50%; background: var(--ws-surface-2);
	display: grid; place-items: center; flex: 0 0 auto;
	transition: transform var(--ws-dur) var(--ws-ease), background var(--ws-dur) var(--ws-ease);
}
.ws-acc__btn[aria-expanded="true"] .ico { transform: rotate(45deg); background: var(--ws-accent); }
.ws-acc__panel { padding: 0 16px 15px; font-size: .92rem; color: #4b5a62; }
.ws-acc__panel p:last-child { margin-bottom: 0; }

/* --------------------------------- Galeria -------------------------------- */
.ws-gallery__filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ws-gallery__grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .ws-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ws-gal {
	position: relative; border: 0; padding: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in;
	aspect-ratio: 4 / 3; background: var(--ws-surface-2); display: block; width: 100%;
	transition: transform var(--ws-dur) var(--ws-ease);
}
.ws-gal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ws-gal:hover { transform: scale(1.02); }
.ws-gal__cap {
	position: absolute; inset: auto 0 0 0; padding: 22px 12px 10px; text-align: left;
	background: linear-gradient(transparent, rgba(14,19,22,.82)); color: #fff; font-size: .76rem; font-weight: 600;
}
.ws-gal.is-hidden { display: none; }

/* diálogo de ampliação */
dialog.ws-dialog {
	border: 0; padding: 0; border-radius: 20px; max-width: min(860px, 94vw); width: 100%;
	box-shadow: 0 40px 80px -30px rgba(0,0,0,.5); background: #fff; color: var(--ws-ink);
}
dialog.ws-dialog::backdrop { background: rgba(9,13,15,.62); }
.ws-dialog__head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--ws-line); }
.ws-dialog__head h3 { margin: 0; font-size: 1rem; }
.ws-dialog__head .ws-iconbtn { margin-left: auto; }
.ws-dialog__body { padding: 14px 16px 18px; }
.ws-lightbox__img { border-radius: 12px; overflow: hidden; background: var(--ws-surface-2); }
.ws-lightbox__img img, .ws-lightbox__img svg { display: block; width: 100%; height: auto; }
.ws-lightbox__bar { display: flex; align-items: center; gap: 10px; padding-top: 12px; font-size: .84rem; color: var(--ws-muted); }
.ws-lightbox__bar .spacer { margin-left: auto; }

/* ------------------------------- Depoimentos ------------------------------ */
.ws-carousel { position: relative; }
.ws-carousel__viewport { overflow: hidden; border-radius: var(--ws-radius); touch-action: pan-y; }
.ws-carousel__track { display: flex; transition: transform var(--ws-dur) var(--ws-ease); }
.ws-carousel__slide { min-width: 100%; padding: 2px; }
@media (min-width: 760px) { .ws-carousel__slide { min-width: 50%; } }
.ws-quote {
	border: 1px solid var(--ws-line); border-radius: var(--ws-radius); background: #fff;
	padding: clamp(18px, 2.6vw, 26px); display: grid; gap: 14px; height: 100%; margin: 0;
}
.ws-quote blockquote { margin: 0; font-size: .98rem; color: #33424a; line-height: 1.6; }
.ws-quote blockquote::before { content: "“"; display: block; font-size: 2.2rem; line-height: .6; color: var(--ws-accent); margin-bottom: 8px; font-weight: 800; }
.ws-quote figcaption { display: flex; align-items: center; gap: 11px; }
.ws-avatar {
	width: 40px; height: 40px; border-radius: 50%; background: var(--ws-ink); color: #fff;
	display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex: 0 0 auto; object-fit: cover;
}
.ws-quote cite { font-style: normal; font-weight: 700; font-size: .87rem; display: block; }
.ws-quote small { color: var(--ws-muted); font-size: .78rem; }
.ws-carousel__nav { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.ws-carousel__dots { display: flex; gap: 6px; margin-left: auto; }
.ws-dot {
	width: 10px; height: 10px; border-radius: 50%; border: 0; background: var(--ws-line-strong);
	cursor: pointer; padding: 0;
}
.ws-dot[aria-current="true"] { background: var(--ws-accent); width: 22px; border-radius: 5px; }

/* ------------------------------- Linha do tempo --------------------------- */
.ws-timeline { display: grid; gap: 14px; }
.ws-timeline__steps { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-timeline__step {
	border: 1px solid var(--ws-line); background: #fff; border-radius: 999px;
	padding: 8px 14px 8px 8px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
	display: inline-flex; align-items: center; gap: 8px; color: #46545c; min-height: 40px;
	transition: background var(--ws-dur) var(--ws-ease), color var(--ws-dur) var(--ws-ease), border-color var(--ws-dur) var(--ws-ease);
}
.ws-timeline__step b {
	width: 20px; height: 20px; border-radius: 50%; background: var(--ws-surface-2);
	display: grid; place-items: center; font-size: .7rem; color: #46545c;
}
.ws-timeline__step[aria-selected="true"] { background: var(--ws-ink); border-color: var(--ws-ink); color: #fff; }
.ws-timeline__step[aria-selected="true"] b { background: var(--ws-accent); color: var(--ws-accent-ink); }
.ws-timeline__detail {
	border: 1px solid var(--ws-line); border-radius: var(--ws-radius); padding: clamp(16px, 2.4vw, 24px);
	background: var(--ws-surface); display: grid; gap: 6px;
}
.ws-timeline__detail h4 { margin: 0; font-size: 1.05rem; }
.ws-timeline__detail p { margin: 0; color: #4b5a62; font-size: .92rem; }
.ws-timeline__detail .meta { font-size: .72rem; color: var(--ws-muted); text-transform: uppercase; letter-spacing: .08em; }

/* -------------------------------- Localizador ----------------------------- */
.ws-locator__filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ws-locator { display: grid; gap: 14px; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: start; }
.ws-locator--no-map { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .ws-locator { grid-template-columns: minmax(0, 1fr); } }
.ws-locator__list { display: grid; gap: 8px; }
.ws-locator__item {
	border: 1px solid var(--ws-line); border-radius: 12px; background: #fff; padding: 12px 14px;
	display: grid; gap: 4px; cursor: pointer;
	transition: border-color var(--ws-dur) var(--ws-ease), background var(--ws-dur) var(--ws-ease);
}
.ws-locator__item:hover { border-color: var(--ws-line-strong); background: var(--ws-surface); }
.ws-locator__item[aria-current="true"] { border-color: var(--ws-accent); background: var(--ws-accent-soft); }
.ws-locator__item strong { font-size: .92rem; }
.ws-locator__item span { font-size: .8rem; color: var(--ws-muted); }
.ws-locator__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ws-locator__map { border: 1px solid var(--ws-line); border-radius: var(--ws-radius); background: #eaeff0; overflow: hidden; }
.ws-locator__map svg { display: block; width: 100%; height: auto; }
.ws-locator__map iframe { display: block; width: 100%; border: 0; }
.ws-locator__meta {
	margin: 0; padding: 8px 12px; border-top: 1px solid var(--ws-line); background: #fff;
	font-size: .78rem; color: var(--ws-muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.ws-map-marker { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform var(--ws-dur) var(--ws-ease); }
.ws-map-marker circle { fill: #fff; stroke: var(--ws-accent); stroke-width: 2.5; }
.ws-map-marker.is-active circle { fill: var(--ws-accent); }
.ws-map-marker.is-active { transform: scale(1.28); }

/* ---------------------------- Formulário por etapas ----------------------- */
.ws-input, .ws-select, .ws-textarea {
	width: 100%; font: inherit; font-size: .9rem; padding: 11px 13px; border-radius: 10px;
	border: 1px solid var(--ws-line-strong); background: #fff; color: var(--ws-ink);
	transition: border-color var(--ws-dur) var(--ws-ease), box-shadow var(--ws-dur) var(--ws-ease);
}
.ws-input:focus, .ws-select:focus, .ws-textarea:focus {
	outline: none; border-color: var(--ws-accent); box-shadow: 0 0 0 3px var(--ws-accent-soft);
}
.ws-form { display: grid; gap: 16px; }
.ws-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ws-steps__item { display: flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; color: var(--ws-muted); }
.ws-steps__item b {
	width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
	background: var(--ws-surface-2); color: #55646c; font-size: .72rem;
}
.ws-steps__item[data-state="current"] { color: var(--ws-ink); }
.ws-steps__item[data-state="current"] b { background: var(--ws-ink); color: #fff; }
.ws-steps__item[data-state="done"] b { background: var(--ws-accent); color: var(--ws-accent-ink); }
.ws-steps__sep { flex: 1; min-width: 10px; height: 1px; background: var(--ws-line); }
.ws-form__panel[hidden] { display: none; }
.ws-field { display: grid; gap: 6px; margin-bottom: 12px; }
.ws-field label { font-size: .82rem; font-weight: 700; color: #33424a; }
.ws-field .req { color: #b0342a; }
.ws-field__error { font-size: .76rem; color: #b0342a; }
.ws-field[data-invalid="true"] .ws-input,
.ws-field[data-invalid="true"] .ws-select,
.ws-field[data-invalid="true"] .ws-textarea { border-color: #cf4b3f; }
.ws-form__nav { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.ws-form__nav .ws-muted { margin-left: auto; font-size: .78rem; }
.ws-summary { border: 1px solid var(--ws-line); border-radius: var(--ws-radius); overflow: hidden; }
.ws-summary dl { margin: 0; display: grid; grid-template-columns: minmax(0,.6fr) minmax(0,1fr); }
.ws-summary dt, .ws-summary dd { margin: 0; padding: 9px 14px; font-size: .85rem; border-bottom: 1px solid var(--ws-line); }
.ws-summary dt { color: var(--ws-muted); background: var(--ws-surface); font-weight: 600; }
.ws-summary dt:last-of-type, .ws-summary dd:last-of-type { border-bottom: 0; }
.ws-success {
	display: grid; gap: 10px; padding: clamp(16px, 3vw, 26px); border-radius: var(--ws-radius);
	background: var(--ws-accent-soft); border: 1px solid var(--ws-accent);
}
.ws-success__ico { width: 40px; height: 40px; border-radius: 50%; background: var(--ws-accent); color: var(--ws-accent-ink); display: grid; place-items: center; }
.ws-success h4 { margin: 0; }
.ws-success p { margin: 0; font-size: .9rem; color: #33424a; }

/* --------------------------------- Joomla --------------------------------- */
.ws-joomla__frame iframe { max-width: 100%; }
.ws-joomla__api { border: 1px solid var(--ws-line); border-radius: var(--ws-radius); padding: 16px; background: #fff; }

/* --------------------------- Exemplo interativo --------------------------- */
.ws-example__card { border: 1px solid var(--ws-line); border-radius: var(--ws-radius); padding: 20px; background: #fff; }
.ws-example__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ws-example__count {
	font-size: 1.6rem; font-weight: 800; min-width: 56px; text-align: center;
	font-variant-numeric: tabular-nums;
}

/* --------------------------- Movimento reduzido --------------------------- */
@media (prefers-reduced-motion: reduce) {
	.ws-banner .ws-anim-target { animation: none !important; }
	.ws-carousel__track, .ws-gal, .ws-mini, .ws-btn, .ws-map-marker { transition-duration: .001ms !important; }
}
html[data-reduce-motion="true"] .ws-banner .ws-anim-target { animation: none !important; }
html[data-reduce-motion="true"] .ws-carousel__track { transition-duration: .001ms !important; }
