/* ---------------------------------------------------------------------
   Novedades agrícolas — banner + grid de cards + detail
   --------------------------------------------------------------------- */

/* `.section` está definido en modules/home.css pero solo se carga con la home.
   Aquí lo replicamos para dar el mismo aire vertical entre el hero y el
   siguiente contenido (footer, en este caso). */
.section     { padding: var(--sp-12) 0; }
.section-alt { background: var(--c-surface); }

/* ---- HERO banner — mismos tokens que `.about-hero` (about-page.css) para
   que todas las páginas institucionales usen el mismo patrón visual.
   Si se estandariza más adelante, mover a components/page-hero.css. ---- */
.nov-hero {
    min-height: 380px;
    background-image: var(--nov-hero);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    color: #fff;
    display: flex;
    align-items: center;
}
.nov-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 100%);
}
.nov-hero-content {
    position: relative;
    text-align: right;
    padding: var(--sp-12) 0;
    z-index: 1;
    width: 100%;
}
.nov-hero h1 {
    color: #fff;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: var(--fw-bold);
    line-height: 1.1;
    letter-spacing: -1px;
    margin: 0 0 var(--sp-3);
}
.nov-hero-lead {
    color: #fff;
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    font-weight: var(--fw-medium);
    line-height: 1.3;
    margin: 0;
    opacity: 0.95;
}
@media (max-width: 720px) {
    .nov-hero { min-height: 280px; }
    .nov-hero-content { text-align: left; padding: var(--sp-10) 0; }
}

/* ---- Grid de cards — 4 columnas máx para dar aire ---- */
.nov-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--sp-6) var(--sp-6);
    margin-top: var(--sp-6);
}
@media (min-width: 1200px) {
    .nov-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) and (max-width: 1199px) {
    .nov-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 600px) and (max-width: 899px) {
    .nov-grid { grid-template-columns: repeat(2, 1fr); }
}

.nov-card {
    display: flex; flex-direction: column;
    background: #fff;
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.nov-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.10);
    border-color: transparent;
}

.nov-card-img {
    display: block;
    aspect-ratio: 1 / 1;
    background: #fff;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--c-border, #e5e7eb);
}
.nov-card-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 8%;
    transition: transform 0.35s ease;
}
.nov-card:hover .nov-card-img img { transform: scale(1.04); }
.nov-card:hover .nov-card-img { border-bottom-color: transparent; }

.nov-card-body {
    padding: var(--sp-4);
    display: flex; flex-direction: column;
    gap: var(--sp-2);
    flex: 1;
}
.nov-card-title {
    margin: 0;
    font-size: var(--fs-md);
    line-height: 1.3;
    /* Altura fija de 2 líneas para que ninguna card se desalinee */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.3em * 2);
}
.nov-card-title a {
    color: var(--c-brand);
    text-decoration: none;
    font-weight: var(--fw-semibold);
}
.nov-card:hover .nov-card-title a { text-decoration: underline; }

.nov-card-desc {
    margin: 0;
    color: var(--c-text-body);
    font-size: var(--fs-sm);
    line-height: 1.5;
    /* 3 líneas máx */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;   /* Ocupa el espacio disponible antes del footer */
}

/* Footer de acciones — siempre pegado al fondo, layout horizontal cómodo */
.nov-card-actions {
    display: flex; flex-direction: column;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--c-border, #eee);
}

/* ---- Botones específicos de novedades ---- */
.nov-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    border-radius: 6px;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
    line-height: 1.2;
    border: 1.5px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.nov-btn:active { transform: translateY(1px); }

.nov-btn-primary {
    background: var(--c-brand);
    color: #fff;
    border-color: var(--c-brand);
    width: 100%;
}
.nov-btn-primary:hover { background: var(--c-brand-dark); border-color: var(--c-brand-dark); color: #fff; }

/* "Descargar catálogo" — más discreto que el primary, con icono de descarga */
.nov-btn-outline {
    background: transparent;
    color: var(--c-brand);
    border-color: var(--c-brand);
    font-size: var(--fs-xs);
    padding: var(--sp-2) var(--sp-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: 100%;
}
.nov-btn-outline:hover { background: var(--c-brand); color: #fff; }
.nov-btn-outline svg { width: 14px; height: 14px; }

.nov-btn-lg { padding: var(--sp-3) var(--sp-6); font-size: var(--fs-md); }

/* ---- Empty state ---- */
.nov-empty {
    text-align: center;
    padding: var(--sp-10) 0;
    color: var(--c-text-muted);
    font-size: var(--fs-md);
}

/* ==============================================================
   DETAIL — layout artículo + sidebar sticky
   ============================================================== */
.nov-article { padding: var(--sp-10) 0 var(--sp-12); }

.nov-article-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--sp-10);
    align-items: start;
}
@media (max-width: 900px) {
    .nov-article-grid { grid-template-columns: 1fr; gap: var(--sp-8); }
}

/* --- Main column: cabecera + cuerpo --- */
.nov-article-main { min-width: 0; }
.nov-article-header {
    margin: 0 0 var(--sp-6);
    padding-bottom: var(--sp-6);
    border-bottom: 1px solid var(--c-border, #e5e7eb);
}
.nov-article-header h1 {
    color: var(--c-text-strong);
    font-size: clamp(28px, 3.4vw, 40px);
    margin: var(--sp-2) 0 0;
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.nov-article-date {
    display: inline-block;
    color: var(--c-brand);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nov-article-body {
    font-size: var(--fs-md);
    line-height: 1.75;
    color: var(--c-text-body);
}
.nov-article-body p    { margin: 0 0 var(--sp-4); }
.nov-article-body p:first-child { font-size: var(--fs-lg); color: var(--c-text-strong); line-height: 1.55; }
.nov-article-body h2   { color: var(--c-brand); font-size: var(--fs-xl); margin: var(--sp-8) 0 var(--sp-3); }
.nov-article-body h3   { font-size: var(--fs-lg); margin: var(--sp-6) 0 var(--sp-2); }
.nov-article-body ul,
.nov-article-body ol   { margin: 0 0 var(--sp-4) var(--sp-6); }
.nov-article-body li   { margin-bottom: var(--sp-1); }
.nov-article-body img  { max-width: 100%; height: auto; border-radius: var(--r-sm); margin: var(--sp-4) 0; }
.nov-article-body a    { color: var(--c-brand); }
.nov-article-body strong { color: var(--c-text-strong); }

/* --- Sidebar --- */
.nov-article-side { min-width: 0; }
.nov-side-sticky {
    position: sticky;
    top: var(--sp-6);
    display: flex; flex-direction: column;
    gap: var(--sp-4);
}
@media (max-width: 900px) { .nov-side-sticky { position: static; } }

.nov-side-figure {
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    background: #fff;
    border: 3px solid var(--c-brand);
}
.nov-side-figure img { display: block; width: 100%; height: auto; }

.nov-side-card {
    background: #fff;
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 10px;
    padding: var(--sp-4);
}
.nov-side-card--catalog {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: var(--sp-3);
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 60%);
    border-color: #fecaca;
}
.nov-side-catalog-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: #fee2e2; color: var(--c-brand);
    border-radius: 8px;
}
.nov-side-catalog-text {
    display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.nov-side-catalog-text strong { color: var(--c-text-strong); font-size: var(--fs-sm); line-height: 1.2; }
.nov-side-catalog-text small  { color: var(--c-text-muted); font-size: 11px; }
.nov-side-card--catalog .nov-btn {
    padding: 8px 12px;
    font-size: var(--fs-sm);
    width: auto;
}

.nov-side-card--back { padding: var(--sp-3) var(--sp-4); }
.nov-side-back {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    color: var(--c-brand); text-decoration: none;
    font-weight: var(--fw-semibold); font-size: var(--fs-sm);
}
.nov-side-back:hover { text-decoration: underline; }

/* ==============================================================
   PRODUCTOS VINCULADOS — inline, dentro de la columna del artículo
   ============================================================== */
.nov-inline-products {
    margin-top: var(--sp-10);
    padding-top: var(--sp-8);
    border-top: 1px solid var(--c-border, #e5e7eb);
}
.nov-inline-products-header {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: var(--sp-4); margin-bottom: var(--sp-5);
}
.nov-inline-products-title {
    color: var(--c-text-strong);
    font-size: clamp(20px, 2.2vw, 26px);
    margin: 0; line-height: 1.2;
}
.nov-inline-products-count {
    color: var(--c-brand);
    font-size: 11px;
    font-weight: var(--fw-bold);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 4px 10px;
    background: #fee2e2;
    border-radius: 999px;
    white-space: nowrap;
}
.nov-inline-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-4);
}
@media (min-width: 700px) {
    .nov-inline-products-grid { grid-template-columns: repeat(3, 1fr); }
}
/* Ver la imagen del producto completa (patrón del catálogo), no recortada */
.nov-inline-products-grid .product-card-img {
    background: #fff;
    aspect-ratio: 1 / 1;
}
.nov-inline-products-grid .product-card-img img {
    object-fit: contain;
    padding: 8%;
}

/* ==============================================================
   OTRAS NOVEDADES — banda inferior con novedades random
   ============================================================== */
.nov-others-section { padding: var(--sp-12) 0; }
.nov-others-header {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: var(--sp-4); margin-bottom: var(--sp-6);
}
.nov-others-title {
    color: var(--c-text-strong);
    font-size: clamp(22px, 2.4vw, 28px);
    margin: 0; line-height: 1.2;
}
.nov-others-all {
    color: var(--c-brand);
    text-decoration: none;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    white-space: nowrap;
}
.nov-others-all:hover { text-decoration: underline; }

.nov-others-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--sp-5);
}
@media (min-width: 1000px) {
    .nov-others-grid { grid-template-columns: repeat(4, 1fr); }
}
.nov-other-card {
    display: flex; flex-direction: column;
    background: #fff;
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.nov-other-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.10);
    border-color: var(--c-brand);
}
.nov-other-img {
    aspect-ratio: 4 / 3;
    background: #fff;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.nov-other-img img {
    display: block; width: 100%; height: 100%;
    object-fit: contain;
    padding: 6%;
    transition: transform 0.3s ease;
}
.nov-other-card:hover .nov-other-img img { transform: scale(1.04); }
.nov-other-body {
    padding: var(--sp-4);
    display: flex; flex-direction: column;
    gap: var(--sp-2);
    flex: 1;
}
.nov-other-date {
    color: var(--c-brand);
    font-size: 11px;
    font-weight: var(--fw-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}
.nov-other-title {
    color: var(--c-text-strong);
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.nov-other-cta {
    color: var(--c-brand);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    margin-top: auto;
}
