/* ==========================================================================
   Avodah — componentes de interfaz compartidos (formularios y navegación)
   Definidos en la guía de estilos (guia.html) para la Tienda y el resto
   de páginas. Usan solo los tokens de base.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field__label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field__label small { font-weight: 400; color: var(--muted); }
.field__help { font-size: 12.5px; color: var(--muted); }
.field__error { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--err); }
.field__error .ico { font-size: 15px; }

.input, .select, .textarea {
	width: 100%; height: 46px; padding: 0 16px; border: 1.5px solid #E3DED5; border-radius: 10px; background: #fff;
	font: 400 15px var(--sans); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: #A29D94; }
.input:hover, .select:hover, .textarea:hover { border-color: #CFC8BC; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--olive-700); box-shadow: 0 0 0 4px rgba(74,86,45,.12); }
.input:disabled, .select:disabled { background: var(--field); color: #9A968E; cursor: not-allowed; }
.is-invalid .input, .is-invalid .select, .is-invalid .textarea { border-color: var(--err); box-shadow: 0 0 0 4px rgba(154,59,46,.1); }
.textarea { height: auto; min-height: 110px; padding: 12px 16px; line-height: 1.5; resize: vertical; }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 44px; }
.input-addon { display: flex; align-items: stretch; }
.input-addon span { display: grid; place-items: center; padding: 0 12px; border: 1.5px solid #E3DED5; border-right: 0; border-radius: 10px 0 0 10px; background: var(--field); font-size: 14px; color: var(--muted); }
.input-addon .input { border-radius: 0 10px 10px 0; }

.select {
	appearance: none; padding-right: 42px; cursor: pointer;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232A2E28' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.select--pill { height: 42px; border-radius: 999px; padding-left: 18px; font-size: 14px; font-weight: 600; }

/* Casilla y opción única */
.check, .radio { position: relative; display: flex; align-items: center; gap: 12px; min-height: 36px; font-size: 14.5px; color: var(--text); cursor: pointer; }
.check input, .radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box, .radio__dot { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border: 1.5px solid #CFC8BC; background: #fff; transition: background .15s, border-color .15s, box-shadow .15s; }
.check__box { border-radius: 6px; }
.radio__dot { border-radius: 50%; }
.check__box svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5); transition: opacity .15s, transform .2s var(--ease-out); }
.radio__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .2s var(--ease-out); }
.check:hover .check__box, .radio:hover .radio__dot { border-color: var(--olive-700); }
.check input:checked + .check__box, .radio input:checked + .radio__dot { background: var(--olive-700); border-color: var(--olive-700); }
.check input:checked + .check__box svg { opacity: 1; transform: none; }
.radio input:checked + .radio__dot::after { transform: scale(1); }
.check input:focus-visible + .check__box, .radio input:focus-visible + .radio__dot { box-shadow: 0 0 0 4px rgba(74,86,45,.18); }
.check input:disabled + .check__box { background: var(--field); border-color: #E3DED5; }
.check__count { margin-left: auto; font-size: 12.5px; color: var(--muted); }

/* Interruptor */
.switch { display: inline-flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--text); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 44px; height: 26px; border-radius: 999px; background: #D9D3C8; transition: background .2s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.15); transition: transform .25s var(--ease-out); }
.switch input:checked + .switch__track { background: var(--olive-700); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 4px rgba(74,86,45,.18); }

/* Rango de precio (dos manijas) */
.range { position: relative; height: 36px; }
.range__track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 999px; background: #E6E0D6; }
.range__fill { position: absolute; top: 0; bottom: 0; border-radius: inherit; background: var(--olive-700); }
.range input { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; appearance: none; -webkit-appearance: none; }
.range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--olive-700); box-shadow: 0 2px 6px rgba(23,34,26,.18); cursor: grab; }
.range input::-moz-range-thumb { pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--olive-700); cursor: grab; }
.range__values { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; }
.range__values .input { height: 40px; font-size: 14px; }

/* Selector de cantidad (versión grande; la compacta vive en header.css) */
.stepper { display: inline-flex; align-items: center; height: 46px; border: 1.5px solid #E3DED5; border-radius: 999px; background: #fff; }
.stepper button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--icon); font-size: 17px; }
.stepper button:hover:not(:disabled) { background: var(--field); color: var(--olive-700); }
.stepper button:disabled { color: #C9C3B8; cursor: not-allowed; }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; color: var(--ink); }

/* --------------------------------------------------------------------------
   Navegación de contenido
   -------------------------------------------------------------------------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--muted); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid #B6B0A4; border-top: 1.5px solid #B6B0A4; transform: rotate(45deg); margin-right: 4px; }
.breadcrumb a { color: var(--text); }
.breadcrumb a:hover { color: var(--olive-700); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 6px; border-radius: 12px; font-size: 14.5px; font-weight: 600; color: var(--ink); transition: background .15s, color .15s; }
.pagination a:hover { background: var(--field); }
.pagination [aria-current] { background: var(--olive-700); color: #fff; }
.pagination .is-gap { color: var(--muted); }
.pagination .ico { font-size: 18px; }

.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: var(--field); width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs button { height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: none; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(23,34,26,.08); }

/* Filtros activos (se pueden quitar) */
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--olive-100); color: var(--olive-700); font-size: 13px; font-weight: 600; }
.fchip button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 13px; }
.fchip button:hover { background: rgba(74,86,45,.15); }
.filter-chips__clear { border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--terracotta-ink); text-decoration: underline; text-underline-offset: 3px; padding: 8px 4px; }

/* Selección por color (pastillas de opción, p. ej. tamaño o especie) */
.opt-group { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; }
.opt span { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1.5px solid #E3DED5; border-radius: 999px; background: #fff; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.opt span:hover { border-color: var(--olive-700); }
.opt input:checked + span { border-color: var(--olive-700); background: var(--olive-700); color: #fff; }
.opt input:focus-visible + span { box-shadow: 0 0 0 4px rgba(74,86,45,.18); }

/* Estado vacío */
.empty { display: grid; justify-items: center; gap: 6px; padding: 40px 20px; text-align: center; }
.empty__ico { display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 10px; border-radius: 50%; background: var(--sand); color: var(--olive-700); font-size: 36px; }
.empty strong { font: 700 20px/1.25 var(--sans); color: var(--ink); }
.empty p { max-width: 360px; margin: 0 0 12px; font-size: 14.5px; color: var(--muted); }

/* Encabezado de página interior */
.page-title { margin: 0; font: 800 40px/1.08 var(--sans); letter-spacing: -.03em; color: var(--ink); }
.page-title small { display: block; margin-top: 8px; font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--muted); }

@media (max-width: 600px) {
	.input, .select, .textarea { font-size: 16px; } /* evita el zoom automático de iOS */
	.page-title { font-size: 30px; }
	.pagination a, .pagination span { min-width: 40px; height: 40px; }
}

/* --------------------------------------------------------------------------
   Grupo de filtros plegable (<details>)
   -------------------------------------------------------------------------- */
.fgroup { border-bottom: 1px solid var(--line); }
.fgroup > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 4px 0; list-style: none; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink); }
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary .ico { font-size: 18px; color: var(--muted); transition: transform .25s var(--ease-out); }
.fgroup[open] > summary .ico { transform: rotate(180deg); }
.fgroup > summary small { margin-left: auto; margin-right: 8px; font-size: 12px; font-weight: 700; color: var(--olive-700); }
.fgroup__body { padding: 0 0 18px; }
.fgroup__more { border: 0; background: none; padding: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--olive-700); }

/* --------------------------------------------------------------------------
   Ventana modal (vista rápida, confirmaciones)
   -------------------------------------------------------------------------- */
.modal-scrim { position: fixed; inset: 0; z-index: 125; background: rgba(23,34,26,.5); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s linear .25s; }
.modal {
	position: fixed; left: 50%; top: 50%; z-index: 126; width: min(940px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto;
	background: #fff; border-radius: 22px; box-shadow: 0 40px 90px -20px rgba(23,34,26,.5);
	opacity: 0; visibility: hidden; transform: translate(-50%, -46%) scale(.98); transition: opacity .25s, transform .35s var(--ease-out), visibility 0s linear .35s;
}
body.modal-open { overflow: hidden; }
body.modal-open .modal-scrim, .modal.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.modal.is-open { transform: translate(-50%, -50%); }
.modal__close { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--ink); font-size: 20px; box-shadow: 0 2px 8px rgba(23,34,26,.1); }
.modal__close:hover { background: var(--field); }
@media (max-width: 600px) {
	.modal { top: auto; bottom: 0; left: 0; width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; transform: translateY(40px); }
	.modal.is-open { transform: none; }
}
