/* ==========================================================================
   RENCAIMPRIME PRO — CSS BASE NATIVO (standalone, reemplaza Astra main.min.css)
   --------------------------------------------------------------------------
   Provee los fundamentos que daba el tema padre Astra:
   reset moderno, box-sizing, tipografía (system fonts = 0 requests externos),
   contenedores responsive, formularios y botones accesibles, WooCommerce base,
   y los estilos de los templates nativos (archive, search, 404, page).
   Mobile-first. WCAG 2.2 (focus-visible). Sin @import (performance).
   Solo se carga cuando RI_STANDALONE está activo.
   ========================================================================== */

:root {
    --ri-c-brand: #2b7a3d;
    --ri-c-brand-dark: #1f5a2c;
    --ri-c-ink: #0f172a;
    --ri-c-text: #334155;
    --ri-c-muted: #64748b;
    --ri-c-border: #e2e8f0;
    --ri-c-bg: #ffffff;
    --ri-c-bg-soft: #f8fafc;
    --ri-c-wa: #25d366;
    --ri-c-danger: #dc2626;
    --ri-radius: 12px;
    --ri-radius-sm: 8px;
    --ri-container: 1200px;
    --ri-gap: clamp(16px, 4vw, 28px);
    --ri-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji";
}

/* ---------- Reset moderno ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
html, body { max-width: 100%; overflow-x: clip; }
body {
    margin: 0;
    font-family: var(--ri-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ri-c-text);
    background: var(--ri-c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
img, picture, video, canvas { display: block; max-width: 100%; height: auto; }
img { border: 0; }
/* SVG: NO forzar height:auto (colapsa íconos inline con width/height propios). */
svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul, ol { padding: 0; }
a { color: var(--ri-c-brand); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--ri-c-brand-dark); }
hr { border: 0; border-top: 1px solid var(--ri-c-border); margin: 24px 0; }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4, h5, h6 { color: var(--ri-c-ink); line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4vw, 38px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: clamp(19px, 2.4vw, 24px); }
h4 { font-size: 18px; }
p { margin: 0 0 1em; }
strong, b { font-weight: 700; }
blockquote { margin: 1em 0; padding: .6em 1.2em; border-left: 4px solid var(--ri-c-brand); background: var(--ri-c-bg-soft); border-radius: 0 var(--ri-radius-sm) var(--ri-radius-sm) 0; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }

/* ---------- Layout / contenedores ---------- */
#page.site { width: 100%; }
#content.site-content { width: 100%; }
.ri-main { padding: clamp(24px, 5vw, 48px) 0; }
.ri-main-full { padding: 0; width: 100%; } /* WooCommerce: el componente controla su ancho/padding */
.ri-container { width: 100%; max-width: var(--ri-container); margin-inline: auto; padding-inline: clamp(16px, 4vw, 28px); }

/* Skip link (WCAG 2.2) */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100000; background: var(--ri-c-ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; color: #fff; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Page headers ---------- */
.ri-page-header { margin-bottom: clamp(20px, 4vw, 34px); }
.ri-page-title { margin: 0; }
.ri-page-title span { color: var(--ri-c-brand); }
.ri-archive-desc { margin-top: 10px; color: var(--ri-c-muted); }

/* ---------- Entradas / páginas genéricas ---------- */
.ri-entry, .ri-page, .ri-single { max-width: 820px; margin-inline: auto; }
.ri-entry-title { margin: 0 0 .3em; }
.ri-entry-title a { color: var(--ri-c-ink); }
.ri-entry-title a:hover { color: var(--ri-c-brand); }
.ri-entry-thumb { margin: 18px 0; border-radius: var(--ri-radius); overflow: hidden; }
.ri-entry-content > * { margin-bottom: 1em; }
.ri-entry-content :where(h2, h3) { margin-top: 1.4em; }
.ri-entry-content img { border-radius: var(--ri-radius-sm); }
.ri-entry-content ul, .ri-entry-content ol { padding-left: 1.4em; margin-bottom: 1em; }
.ri-entry-content li { margin-bottom: .4em; }
.ri-entry-summary { color: var(--ri-c-text); }

/* ---------- Archive grid (blog) ---------- */
.ri-archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--ri-gap); }
.ri-card { background: var(--ri-c-bg); border: 1px solid var(--ri-c-border); border-radius: var(--ri-radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.ri-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15, 23, 42, .1); }
.ri-card-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; }
.ri-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ri-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.ri-card-title { font-size: 18px; margin: 0; }
.ri-card-title a { color: var(--ri-c-ink); }
.ri-card-title a:hover { color: var(--ri-c-brand); }
.ri-card-excerpt { color: var(--ri-c-muted); font-size: 14px; flex: 1; }
.ri-card-more { font-weight: 700; font-size: 14px; }

/* ---------- Resultados de búsqueda ---------- */
.ri-search-results { max-width: 820px; margin-inline: auto; }
.ri-result { padding: 18px 0; border-bottom: 1px solid var(--ri-c-border); }
.ri-result-title { font-size: 19px; margin: 0 0 .25em; }
.ri-result-excerpt { color: var(--ri-c-muted); }
.ri-no-results { color: var(--ri-c-muted); max-width: 600px; }

/* ---------- 404 ULTRA 2030 (panorámico · 2 columnas · above-the-fold) ---------- */
.ri-404 { position: relative; overflow: hidden; background: linear-gradient(135deg, #f8fafc 0%, #fff 55%); padding: clamp(30px, 5vw, 60px) 0; }
.ri-404::before { content: ""; position: absolute; inset: 0; background: radial-gradient(75% 120% at 88% 8%, rgba(43, 122, 61, .12), transparent 55%); pointer-events: none; }
.ri-404-inner { position: relative; max-width: 1120px; margin-inline: auto; padding-inline: clamp(20px, 4vw, 40px); display: grid; grid-template-columns: 1fr; gap: clamp(26px, 4vw, 52px); align-items: center; }
@media (min-width: 920px) { .ri-404-inner { grid-template-columns: 1.05fr .95fr; } }
.ri-404-left { text-align: center; }
@media (min-width: 920px) { .ri-404-left { text-align: left; } }
.ri-404-code { font-size: clamp(110px, 16vw, 210px); font-weight: 900; line-height: .82; margin: 0 0 .04em; background: linear-gradient(135deg, #2b7a3d 0%, #1f5a2c 50%, #0f172a 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -.05em; }
.ri-404-title { margin: 0 0 .25em; font-size: clamp(24px, 3.2vw, 34px); }
.ri-404-text { color: var(--ri-c-muted); font-size: 16px; max-width: 460px; margin: 0 0 26px; }
@media (max-width: 919px) { .ri-404-text { margin-inline: auto; } }
.ri-404-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
@media (min-width: 920px) { .ri-404-actions { justify-content: flex-start; } }
.ri-404-right { width: 100%; }
.ri-404-card { background: #fff; border: 1px solid var(--ri-c-border); border-radius: 20px; padding: clamp(22px, 3vw, 32px); box-shadow: 0 28px 56px -28px rgba(15, 23, 42, .22); }
.ri-404-card-label { display: block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #94a3b8; margin-bottom: 12px; }
.ri-404-search { margin: 0 0 22px; }
.ri-404-cats h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin: 0 0 12px; font-weight: 700; }
.ri-404-cats ul { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; padding: 0; margin: 0; }
.ri-404-cats a { display: inline-block; padding: 8px 16px; background: var(--ri-c-bg-soft); border: 1px solid var(--ri-c-border); border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ri-c-ink); transition: transform .2s cubic-bezier(.2, .9, .3, 1), box-shadow .2s, background .2s, color .2s; }
.ri-404-cats a:hover { background: linear-gradient(135deg, #2b7a3d, #1f5a2c); color: #fff; border-color: transparent; transform: translateY(-2px); box-shadow: 0 10px 18px -8px rgba(43, 122, 61, .55); }

/* ---------- Botones ---------- */
.ri-btn,
.button,
input[type="submit"],
button[type="submit"] {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: var(--ri-radius-sm);
    background: var(--ri-c-brand); color: #fff; font-weight: 700; font-size: 15px;
    border: 1px solid var(--ri-c-brand); line-height: 1.2; text-align: center;
    transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
}
.ri-btn:hover,
.button:hover,
input[type="submit"]:hover,
button[type="submit"]:hover { background: var(--ri-c-brand-dark); border-color: var(--ri-c-brand-dark); color: #fff; transform: translateY(-1px); }
.ri-btn-wa { background: var(--ri-c-wa); border-color: var(--ri-c-wa); }
.ri-btn-wa:hover { background: #1ea954; border-color: #1ea954; }

/* ---------- Formularios (base accesible) ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="number"], input[type="tel"], input[type="date"],
textarea, select {
    width: 100%; padding: 11px 14px; background: #fff;
    border: 1px solid var(--ri-c-border); border-radius: var(--ri-radius-sm);
    color: var(--ri-c-ink); transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ri-c-brand); box-shadow: 0 0 0 3px rgba(43, 122, 61, .15); }
::placeholder { color: #94a3b8; }
label { font-weight: 600; color: var(--ri-c-ink); }

/* Focus visible global (accesibilidad) */
:focus-visible { outline: 3px solid rgba(43, 122, 61, .4); outline-offset: 2px; }

/* ---------- Search form ---------- */
.ri-searchform { display: flex; gap: 8px; }
.ri-searchform-input { flex: 1; }
.ri-searchform-btn { flex: 0 0 auto; width: 48px; padding: 0; }
.ri-searchform-btn svg { width: 20px; height: 20px; }

/* ---------- Paginación ---------- */
.pagination, .nav-links { margin-top: 34px; display: flex; justify-content: center; }
.nav-links { gap: 6px; flex-wrap: wrap; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--ri-c-border); border-radius: var(--ri-radius-sm); color: var(--ri-c-ink); font-weight: 600; background: #fff; }
.page-numbers:hover, .page-numbers.current { background: var(--ri-c-brand); color: #fff; border-color: var(--ri-c-brand); }

/* ---------- WooCommerce base (notices / forms que no cubren los componentes RI) ---------- */
.woocommerce-message, .woocommerce-info, .woocommerce-error, .wc-block-components-notice-banner {
    padding: 14px 18px; border-radius: var(--ri-radius-sm); margin: 0 0 20px; list-style: none;
    border: 1px solid transparent; font-size: 15px;
}
.woocommerce-message { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.woocommerce-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.woocommerce-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.woocommerce form .form-row { margin: 0 0 16px; }
.woocommerce form .form-row label { display: block; margin-bottom: 6px; }
.woocommerce .required { color: var(--ri-c-danger); border: 0; }
.woocommerce-form-row .optional { color: var(--ri-c-muted); }
.screen-reader-text { display: block; }

/* ---------- Utilidades responsive ---------- */
@media (max-width: 600px) {
    .ri-archive-grid { grid-template-columns: 1fr; }
    .ri-404-actions { flex-direction: column; }
    .ri-404-actions .ri-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
