:root {
    --ifsp-green: #16c38c;
    --ifsp-green-dark: #073528;
    --ifsp-ink: #071c15;
    --ifsp-muted: #60736c;
    --ifsp-line: #dce7e2;
    --ifsp-soft: #f3f7f5;
}

body.ifsp-catalog-active {
    overflow-x: clip;
    background: #fff;
}

/* Una sola superficie desde el header hasta el footer. */
.ifsp-catalog-active .site-content,
.ifsp-catalog-active.ast-separate-container .site-content,
.ifsp-catalog-active.ast-separate-container .ast-woocommerce-container {
    background: #fff !important;
}
.ifsp-catalog-active .site-content { margin: 0; padding: 0; }
/* Astra conserva 24px de flujo entre el masthead y #content aunque ambos
   reporten margen cero. Se compensa solo en archivos del catálogo. */
.ifsp-catalog-active #content {
    margin-top: -24px !important;
}
.ifsp-catalog-active .site-content > .ast-container {
    display: block;
    width: min(100%, 1240px);
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}
.ifsp-catalog-active #primary {
    float: none;
    width: 100%;
    max-width: none;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
}

/* El montaje global de testimonios no aporta contenido al catálogo y dejaba
   560px vacíos antes del footer. Solo se desactiva en archivos WooCommerce. */
body.ifsp-catalog-active #if-testimonials-auto-mount {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}
.ifsp-catalog-active .ast-woocommerce-container {
    width: 100%;
    margin: 0;
    padding: 0 !important;
    border: 0;
    box-shadow: none;
}

/* El sidebar nativo sigue funcional, pero vive en un drawer. */
.ifsp-catalog-active #secondary {
    position: fixed;
    z-index: 100002;
    top: 0;
    bottom: 0;
    left: 0;
    display: block !important;
    float: none;
    width: min(88vw, 390px);
    max-height: 100vh;
    margin: 0;
    padding: 78px 20px 28px;
    overflow-y: auto;
    background: var(--ifsp-soft);
    box-shadow: 24px 0 60px rgba(0,20,14,.18);
    transform: translateX(-110%);
    transition: transform .25s ease;
}
.ifsp-filters-open #secondary { transform: translateX(0); }
.ifsp-catalog-active #secondary .widget {
    margin: 0 0 16px;
    padding: 22px;
    border: 1px solid var(--ifsp-line);
    border-radius: 4px;
    background: #fff;
}
.ifsp-catalog-active #secondary .widget-title {
    margin: 0 0 17px;
    color: var(--ifsp-ink);
    font-size: 19px;
    line-height: 1.2;
}
.ifsp-catalog-active #secondary a { color: #344a42; }
.ifsp-catalog-active #secondary a:hover { color: #079a6a; }

/* Hero integrado: no es una tarjeta, ocupa el ancho completo del viewport. */
.ifsp-hero {
    position: relative;
    left: 50%;
    width: 100vw;
    margin: 0 0 46px -50vw;
    overflow: hidden;
    color: #fff;
    background: radial-gradient(circle at 82% 16%, rgba(26,212,151,.20), transparent 31%), linear-gradient(116deg, #031b13 0%, #063d2d 100%);
}
.ifsp-hero::after {
    position: absolute;
    right: -8vw;
    bottom: -200px;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(41,224,165,.12);
    border-radius: 50%;
    content: "";
    box-shadow: 0 0 0 70px rgba(41,224,165,.035), 0 0 0 140px rgba(41,224,165,.025);
    pointer-events: none;
}
.ifsp-hero__inner {
    position: relative;
    z-index: 1;
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: 34px 20px 0;
}
.ifsp-hero .woocommerce-breadcrumb {
    margin: 0 0 46px;
    color: #8faaa1;
    font-size: 12px;
}
.ifsp-hero .woocommerce-breadcrumb a { color: #cce0d9; font-weight: 700; }
.ifsp-hero__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, .72fr);
    gap: clamp(45px, 7vw, 100px);
    align-items: end;
}
.ifsp-hero__copy { max-width: 780px; }
.ifsp-eyebrow {
    display: block;
    margin-bottom: 16px;
    color: #4de4b4;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .18em;
}
.ifsp-hero h1 {
    margin: 0 0 20px;
    color: #fff;
    font-size: clamp(42px, 4.7vw, 68px);
    line-height: .98;
    letter-spacing: -.052em;
}
.ifsp-hero__copy > p {
    max-width: 690px;
    margin: 0;
    color: #d5e8e1;
    font-size: 16px;
    line-height: 1.7;
}
.ifsp-proof {
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(255,255,255,.16);
    list-style: none;
}
.ifsp-proof li {
    display: grid;
    grid-template-columns: 116px 1fr;
    gap: 14px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,.13);
}
.ifsp-proof strong { color: #3fe0ad; font-size: 13px; }
.ifsp-proof span { color: #bcd2cb; font-size: 11px; line-height: 1.45; }
.ifsp-categories {
    display: flex;
    gap: 0;
    margin-top: 46px;
    border-top: 1px solid rgba(255,255,255,.14);
    overflow-x: auto;
    scrollbar-width: none;
}
.ifsp-categories::-webkit-scrollbar { display: none; }
.ifsp-categories a {
    flex: 0 0 auto;
    padding: 19px 22px 18px;
    border-right: 1px solid rgba(255,255,255,.12);
    color: #c6dbd4;
    background: transparent;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    transition: color .2s ease, background .2s ease;
}
.ifsp-categories a:first-child { border-left: 1px solid rgba(255,255,255,.12); }
.ifsp-categories a:hover,
.ifsp-categories a:focus-visible,
.ifsp-categories a.is-active { color: #fff; background: rgba(22,195,140,.16); }

/* Categorías conservan su H1 nativo, sin la caja de Astra. */
.ifsp-catalog-active:not(.ifsp-main-shop) .woocommerce-breadcrumb {
    margin: 34px 0 20px;
    color: #7c8c86;
    font-size: 12px;
}
.ifsp-catalog-active:not(.ifsp-main-shop) .woocommerce-products-header {
    margin-bottom: 34px;
    padding: 32px 0;
    border-bottom: 1px solid var(--ifsp-line);
}
.ifsp-catalog-active:not(.ifsp-main-shop) .woocommerce-products-header__title {
    margin: 0;
    color: var(--ifsp-ink);
    font-size: clamp(38px, 5vw, 60px);
}

/* Controles: una línea de trabajo, no otra tarjeta. */
.ifsp-toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    margin: 0 0 28px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--ifsp-line);
}
.ifsp-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #0a3b2c;
    border-radius: 3px;
    color: #fff;
    background: var(--ifsp-green-dark);
    font-size: 11px;
    font-weight: 900;
}
.ifsp-filter-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.ifsp-catalog-active .woocommerce-result-count {
    float: none;
    margin: 0;
    color: var(--ifsp-muted);
    font-size: 13px;
    line-height: 1.5;
}
.ifsp-catalog-active .woocommerce-ordering { float: none; margin: 0; }
.ifsp-catalog-active .woocommerce-ordering select {
    min-height: 44px;
    padding: 0 42px 0 15px;
    border: 1px solid var(--ifsp-line);
    border-radius: 3px;
    color: var(--ifsp-ink);
    background-color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* Retícula WooCommerce original, normalizada visualmente. */
.ifsp-catalog-active ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
    margin: 0 0 44px;
}
.ifsp-catalog-active ul.products::before,
.ifsp-catalog-active ul.products::after { display: none !important; }
.ifsp-catalog-active ul.products li.product {
    display: flex;
    flex-direction: column;
    float: none !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    padding: 14px 14px 16px;
    border: 1px solid var(--ifsp-line);
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.ifsp-catalog-active ul.products li.product:hover {
    transform: translateY(-3px);
    border-color: rgba(22,195,140,.6);
    box-shadow: 0 16px 38px rgba(7,28,21,.07);
}
.ifsp-catalog-active ul.products li.product img {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0 0 14px;
    object-fit: contain;
    background: #fff;
}
.ifsp-catalog-active .ast-woo-product-category { color: #88958f; font-size: 10px; letter-spacing: .04em; }
.ifsp-catalog-active .woocommerce-loop-product__title {
    min-height: 2.8em;
    margin-top: 6px;
    color: var(--ifsp-ink);
    font-size: 16px;
    line-height: 1.35;
}
.ifsp-catalog-active ul.products li.product .price {
    margin-top: auto;
    padding-top: 10px;
    color: var(--ifsp-ink);
    font-size: 16px;
    font-weight: 800;
}
.ifsp-catalog-active ul.products li.product .price del { color: #8b9692; font-size: 12px; }
.ifsp-catalog-active .onsale {
    min-width: auto;
    min-height: auto;
    padding: 6px 9px;
    border-radius: 2px;
    color: #fff;
    background: var(--ifsp-green-dark);
    font-size: 10px;
    line-height: 1;
}
.ifsp-product-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 13px;
    padding: 11px 3px 0;
    border-top: 1px solid var(--ifsp-line);
    color: var(--ifsp-green-dark);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    text-decoration: none;
}
.ifsp-product-link span { color: var(--ifsp-green); font-size: 16px; transition: transform .2s ease; }
.ifsp-product-link:hover span { transform: translateX(3px); }

/* Drawer y fondo. */
.ifsp-filter-close,
.ifsp-filter-backdrop { display: none; }
.ifsp-filter-close {
    position: fixed;
    z-index: 100003;
    top: 20px;
    left: min(calc(88vw - 55px), 335px);
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--ifsp-line);
    border-radius: 50%;
    color: var(--ifsp-ink);
    background: #fff;
    font-size: 27px;
    line-height: 34px;
}
.ifsp-filter-backdrop {
    position: fixed;
    z-index: 100001;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0,20,14,.62);
}
.ifsp-filters-open .ifsp-filter-close,
.ifsp-filters-open .ifsp-filter-backdrop { display: block; }
body.ifsp-filters-open { overflow: hidden; }
.ifsp-catalog-active .woocommerce-pagination { margin: 8px 0 64px; }

@media (max-width: 1080px) {
    .ifsp-hero__layout { grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr); gap: 45px; }
    .ifsp-catalog-active ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 780px) {
    .ifsp-hero__inner { padding-top: 24px; }
    .ifsp-hero .woocommerce-breadcrumb { margin-bottom: 32px; }
    .ifsp-hero__layout { grid-template-columns: 1fr; gap: 32px; }
    .ifsp-hero h1 { font-size: clamp(38px, 9vw, 54px); }
    .ifsp-proof { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
    .ifsp-proof li { display: block; padding: 14px 12px; border-right: 1px solid rgba(255,255,255,.13); }
    .ifsp-proof span { display: block; margin-top: 5px; }
    .ifsp-categories { margin-top: 34px; }
    .ifsp-toolbar { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ifsp-toolbar .woocommerce-result-count { grid-column: 1 / -1; }
    .ifsp-toolbar .woocommerce-ordering select { width: 100%; }
}
@media (max-width: 640px) {
    .ifsp-catalog-active .site-content > .ast-container { padding: 0 16px; }
    .ifsp-hero { margin-bottom: 30px; }
    .ifsp-hero__inner { padding: 20px 20px 0; }
    .ifsp-hero .woocommerce-breadcrumb { margin-bottom: 27px; }
    .ifsp-eyebrow { margin-bottom: 12px; font-size: 9px; }
    .ifsp-hero h1 { margin-bottom: 16px; font-size: clamp(34px, 10vw, 45px); line-height: 1.01; }
    .ifsp-hero__copy > p { font-size: 14px; line-height: 1.55; }
    .ifsp-proof { grid-template-columns: 1fr; gap: 0; }
    .ifsp-proof li { display: grid; grid-template-columns: 120px 1fr; padding: 11px 0; border-right: 0; }
    .ifsp-proof span { margin: 0; }
    .ifsp-categories { margin-right: -20px; margin-top: 26px; }
    .ifsp-categories a { padding: 16px 17px; }
    .ifsp-toolbar { margin-bottom: 18px; }
    .ifsp-toolbar .ifsp-filter-button,
    .ifsp-toolbar .woocommerce-ordering { min-width: 0; }
    .ifsp-filter-button { width: 100%; padding: 0 10px; }
    .ifsp-catalog-active ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 11px !important; }
    .ifsp-catalog-active ul.products li.product { padding: 9px 9px 12px; }
    .ifsp-catalog-active ul.products li.product img { margin-bottom: 9px; }
    .ifsp-catalog-active .ast-woo-product-category { font-size: 8px; }
    .ifsp-catalog-active .woocommerce-loop-product__title { min-height: 3.8em; font-size: 12px; line-height: 1.28; }
    .ifsp-catalog-active ul.products li.product .price { font-size: 12px; }
    .ifsp-catalog-active ul.products li.product .price del { display: block; font-size: 9px; }
    .ifsp-catalog-active ul.products li.product .star-rating { font-size: 10px; }
    .ifsp-product-link { margin-top: 9px; padding-top: 9px; font-size: 8px; }
    .ifsp-catalog-active .onsale { padding: 5px 6px; font-size: 8px; }
}
