/* Farmacenter — categorías con filtros (inc/filters.php, templates/archive-product.php). */
.fc-arch-main { padding: 18px 0 40px; }
.fc-arch { position: relative; }
.fc-crumbs { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 13px; color: var(--fc-muted); margin-bottom: 10px; }
.fc-crumbs a { color: var(--fc-muted) !important; text-decoration: none !important; }
.fc-crumbs a:hover { color: var(--fc-blue-700) !important; }
.fc-crumbs > *:not(:last-child)::after { content: "›"; margin: 0 8px; color: #c4c9d1; }
.fc-crumbs [aria-current] { color: var(--fc-ink); font-weight: 600; }
.fc-arch__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.fc-arch__title { font-family: var(--fc-font-head); font-weight: 800; font-size: clamp(26px, 3vw, 36px); letter-spacing: -0.02em; line-height: 1.1; margin: 0; color: var(--fc-ink); }
.fc-arch__count { margin: 0; color: var(--fc-muted); font-size: 15px; }
.fc-arch__desc { margin: 8px 0 0; color: var(--fc-ink-2); max-width: 760px; font-size: 15px; }
.fc-subcats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 14px 0 4px; margin: 0 -2px; }
.fc-subcats::-webkit-scrollbar { display: none; }
.fc-subcats .fc-chip small { color: var(--fc-muted); font-weight: 600; margin-left: 2px; }
.fc-subcats .fc-chip.is-active small { color: inherit; opacity: .85; }

.fc-arch__layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 28px; margin-top: 18px; align-items: start; }

/* Panel de filtros (escritorio: columna fija) */
.fc-flt { position: sticky; top: 96px; max-height: calc(100vh - 112px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; outline: 0; }
.fc-flt__form { margin: 0; }
.fc-flt__head { display: none; }
.fc-flt__body { display: grid; gap: 10px; }
.fc-flt__group { background: #fff; border: 1px solid var(--fc-line); border-radius: 16px; padding: 14px 16px; }
.fc-flt__group summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--fc-ink); padding: 2px 0; }
.fc-flt__group summary::-webkit-details-marker { display: none; }
.fc-flt__group summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--fc-muted); border-bottom: 2px solid var(--fc-muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.fc-flt__group[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.fc-flt__group[open] summary { margin-bottom: 8px; }
.fc-flt__n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--fc-primary); color: #fff; font-size: 12px; font-weight: 800; }
.fc-flt__opts { display: grid; gap: 2px; }
.fc-opt, .fc-switch { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 6px; margin: 0 -6px; border-radius: 10px; cursor: pointer; font-size: 14.5px; color: var(--fc-ink-2); line-height: 1.25; }
.fc-opt:hover, .fc-switch:hover { background: #f5f7fa; }
.fc-opt input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--fc-primary); cursor: pointer; }
.fc-opt span, .fc-switch > span:not(.fc-switch__ui) { flex: 1; min-width: 0; }
.fc-opt em, .fc-switch em { font-style: normal; font-size: 12.5px; color: var(--fc-muted); background: #f3f4f6; border-radius: 999px; padding: 1px 8px; }
.fc-opt:has(input:checked) { color: var(--fc-ink); font-weight: 700; }
.fc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fc-switch__ui { width: 38px; height: 22px; border-radius: 999px; background: #d1d5db; position: relative; flex: none; transition: background .2s; }
.fc-switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.fc-switch input:checked + .fc-switch__ui { background: var(--fc-primary); }
.fc-switch input:checked + .fc-switch__ui::after { transform: translateX(16px); }
.fc-switch input:focus-visible + .fc-switch__ui { outline: 3px solid rgba(0,163,226,.35); outline-offset: 2px; }
.fc-switch.is-empty:not(:has(input:checked)) { opacity: .5; }
.fc-flt__range { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.fc-flt__range label { flex: 1; min-width: 0; }
.fc-flt__range input { width: 100%; min-height: 40px; border: 1px solid #dfe3e8 !important; border-radius: 10px !important; padding: 0 10px !important; font-size: 14px; background: #fff; }
.fc-flt__go { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--fc-blue-700); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.fc-flt__search { display: flex; align-items: center; gap: 8px; border: 1px solid #dfe3e8; border-radius: 10px; padding: 0 10px; margin-bottom: 6px; color: var(--fc-muted); }
.fc-flt__search input { border: 0 !important; outline: 0; min-height: 38px; width: 100%; font-size: 14px; padding: 0 !important; background: transparent; box-shadow: none !important; }
.fc-flt__brands.is-collapsed:not(.is-searching) .fc-opt:nth-child(n+9) { display: none; }
.fc-flt__more { background: none; border: 0; padding: 8px 0 2px; color: var(--fc-blue-700); font-weight: 700; font-size: 14px; cursor: pointer; }
.fc-flt__brands.is-searching + .fc-flt__more { display: none; }
.fc-flt__foot { display: none; }
.fc-flt__backdrop { display: none; }

/* Barra de resultados */
.fc-arch__toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 12px; }
.fc-arch__filterbtn { display: none !important; }
.fc-arch__sort { display: flex; align-items: center; gap: 8px; margin: 0; }
.fc-arch__sort label { font-size: 14px; color: var(--fc-muted); white-space: nowrap; }
.fc-arch__sort select { min-height: 42px; border: 1px solid var(--fc-line); border-radius: 999px; padding: 0 36px 0 16px; font-size: 14px; font-weight: 600; color: var(--fc-ink); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; -webkit-appearance: none; appearance: none; cursor: pointer; }
.fc-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.fc-active__chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 14px; border-radius: 999px; background: #fff1e6; color: #9a3b00 !important; font-weight: 700; font-size: 13.5px; text-decoration: none !important; border: 1px solid #fed7bd; }
.fc-active__chip:hover { background: #ffe4cf; }
.fc-active__clear { font-size: 13.5px; font-weight: 700; color: var(--fc-blue-700) !important; margin-left: 4px; }
.fc-arch .fcui-ds ul.products, .fc-arch ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fc-arch__pager .woocommerce-pagination ul { display: flex !important; justify-content: center; gap: 6px; border: 0 !important; }
.fc-arch__pager .woocommerce-pagination ul li { border: 0 !important; }
.fc-arch__pager .woocommerce-pagination a, .fc-arch__pager .woocommerce-pagination span { min-width: 42px; height: 42px; display: inline-flex !important; align-items: center; justify-content: center; border-radius: 999px !important; border: 1px solid var(--fc-line) !important; font-weight: 700; padding: 0 12px !important; }
.fc-arch__pager .woocommerce-pagination span.current { background: var(--fc-primary) !important; color: #fff !important; border-color: var(--fc-primary) !important; }

/* Cargando */
.fc-arch.is-loading .fc-arch__results ul.products, .fc-arch.is-loading .fc-empty { opacity: .45; transition: opacity .15s; pointer-events: none; }
.fc-arch.is-loading .fc-arch__results::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--fc-primary), transparent); background-size: 50% 100%; animation: fcload 1s linear infinite; }
.fc-arch__results { position: relative; min-width: 0; }
@keyframes fcload { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* Sin resultados */
.fc-empty { text-align: center; background: #fff; border: 1px dashed #d1d5db; border-radius: 20px; padding: 40px 20px; }
.fc-empty__icon { display: inline-flex; width: 64px; height: 64px; border-radius: 50%; background: var(--fc-blue-50, #e6f6fc); color: var(--fc-blue-700); align-items: center; justify-content: center; margin-bottom: 10px; }
.fc-empty h2 { font-size: 20px; margin: 0 0 6px; color: var(--fc-ink); }
.fc-empty p { color: var(--fc-muted); margin: 0 auto 16px; max-width: 420px; }
.fc-empty__cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

@media (max-width: 1200px) { .fc-arch ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Celular y tablet: filtros en hoja inferior */
@media (max-width: 960px) {
	.fc-arch__layout { grid-template-columns: 1fr; margin-top: 12px; }
	.fc-arch__toolbar { position: sticky; top: 0; z-index: 30; background: var(--fc-bg, #fff); margin: 0 -16px 12px; padding: 10px 16px; justify-content: space-between; box-shadow: 0 6px 12px -10px rgba(17,24,39,.25); }
	.fc-arch__filterbtn { display: inline-flex !important; align-items: center; gap: 8px; min-height: 42px; border-radius: 999px !important; padding: 0 16px !important; }
	.fc-arch__sort label { display: none; }
	.fc-arch__sort select { max-width: 52vw; }
	.fc-flt { position: fixed; z-index: 100000; left: 0; right: 0; bottom: 0; top: auto; max-height: 88vh; height: 88vh; background: #f6f7f9; border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); visibility: hidden; overflow: hidden; display: flex; flex-direction: column; }
	.fc-flt-open .fc-flt { transform: none; visibility: visible; }
	.fc-flt__form { display: flex; flex-direction: column; height: 100%; }
	.fc-flt__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; background: #fff; border-bottom: 1px solid var(--fc-line); font-size: 17px; position: relative; }
	.fc-flt__head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; border-radius: 2px; background: #d1d5db; transform: translateX(-50%); }
	.fc-flt__close { background: #f3f4f6; border: 0; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--fc-ink); cursor: pointer; padding: 0; }
	.fc-flt__body { flex: 1; overflow: auto; padding: 12px 16px; overscroll-behavior: contain; }
	.fc-flt__foot { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--fc-line); }
	.fc-flt__foot .fc-btn { min-height: 48px; justify-content: center; border-radius: 999px !important; }
	.fc-flt__backdrop { display: block; position: fixed; inset: 0; z-index: 99999; background: rgba(17,24,39,.45); }
	.fc-flt__backdrop[hidden] { display: none; }
	.fc-flt-open { overflow: hidden; }
	.fc-opt, .fc-switch { min-height: 44px; font-size: 15px; }
	.fc-arch ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) { .fc-arch ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .fc-flt { transition: none; } .fc-arch.is-loading .fc-arch__results::before { animation: none; } }
/* El contenedor del tema no suma margen: la alineación la da .fc-wrap (igual que el encabezado). */
.fc-arch-page .site-content > .ast-container { padding-left: 0 !important; padding-right: 0 !important; max-width: none !important; }
.fcui-ds .fc-arch ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .fcui-ds .fc-arch ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { .fcui-ds .fc-arch ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .fcui-ds .fc-arch ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .fc-arch-main { padding-top: 4px; } }
