/* ================================================================
   CIMAGREEN — homepage.css
   Estilos exclusivos de la página de inicio.
   Solo se carga en front-page (wp_is_front_page check en functions.php).
   ================================================================ */

/* ─── Hero bullets (propuesta de valor) ────────────────────────── */
.cimagreen-hero__bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: flex;
    flex-direction: column;
    gap: .625rem;
}
.cimagreen-hero__bullet {
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: clamp(.875rem, 2vw, 1rem);
    color: rgba(255,255,255,.92);
    line-height: 1.4;
}
.cimagreen-hero__bullet svg { flex-shrink: 0; color: var(--color-accent); }

/* ─── Micro-trust bar bajo los CTAs ────────────────────────────── */
.cimagreen-hero__trust {
    margin: .875rem 0 0;
    font-size: .8125rem;
    color: rgba(255,255,255,.65);
    letter-spacing: .01em;
}

/* ─── Stats bar (dentro del hero) ──────────────────────────────── */
.cimagreen-hero-stats {
    position: relative;
    z-index: 3;
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255,255,255,.2);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (min-width: 640px) {
    .cimagreen-hero-stats { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
}
.cimagreen-hero-stats__item { text-align: center; }
.cimagreen-hero-stats__number {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: .25rem;
}
.cimagreen-hero-stats__label {
    display: block;
    font-size: clamp(.7rem, 2vw, .875rem);
    color: rgba(255,255,255,.8);
    line-height: 1.3;
}

/* ─── Farm to Business ──────────────────────────────────────────── */
.cimagreen-farm-to-biz {
    padding-block: 4rem;
    background: var(--color-white);
    overflow: hidden;
}
@media (min-width: 768px) { .cimagreen-farm-to-biz { padding-block: 6rem; } }

.cimagreen-farm-to-biz__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}
@media (min-width: 1024px) {
    .cimagreen-farm-to-biz__inner { grid-template-columns: 1fr 1fr; gap: 5rem; }
}

/* Visual lado izquierdo */
.cimagreen-farm-to-biz__visual {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}
.cimagreen-farm-to-biz__visual-img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.cimagreen-farm-to-biz__visual-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a6b55 0%, #3a9e3f 60%, #f4b400 100%);
}
.cimagreen-farm-to-biz__visual-badge {
    position: absolute;
    bottom: 1.25rem; right: 1.25rem;
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: .875rem 1.25rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}
.cimagreen-farm-to-biz__visual-badge-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}
.cimagreen-farm-to-biz__visual-badge-label {
    display: block;
    font-size: .75rem;
    color: #666;
    margin-top: .2rem;
}

/* Contenido lado derecho */
.cimagreen-farm-to-biz__eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--color-secondary);
    margin-bottom: .875rem;
}
.cimagreen-farm-to-biz__title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    color: var(--color-primary);
    margin-bottom: 1.25rem;
    line-height: 1.25;
}
.cimagreen-farm-to-biz__text {
    color: #555;
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}
.cimagreen-farm-to-biz__checklist {
    display: flex;
    flex-direction: column;
    gap: .875rem;
    margin-bottom: 2rem;
}
.cimagreen-farm-to-biz__check-item {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    font-size: .9375rem;
    color: var(--color-gray-dark);
    line-height: 1.5;
}
.cimagreen-farm-to-biz__check-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-top: .125rem;
}
.cimagreen-farm-to-biz__check-icon svg { width: 12px; height: 12px; }

/* ─── Advantages mejoradas ──────────────────────────────────────── */
.cimagreen-advantage-card__stat {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: .5rem;
}
@media (min-width: 768px) { .cimagreen-advantage-card__stat { font-size: 2.5rem; } }

/* ─── Logistics ─────────────────────────────────────────────────── */
.cimagreen-logistics {
    padding-block: 4rem;
    background: var(--color-gray-light);
}
@media (min-width: 768px) { .cimagreen-logistics { padding-block: 6rem; } }

.cimagreen-logistics__chain {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    margin-top: 3rem;
}
@media (min-width: 1024px) {
    .cimagreen-logistics__chain {
        flex-direction: row;
        align-items: stretch;
        gap: 0;
    }
}

.cimagreen-logistics__node {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    flex: 1;
    transition: box-shadow var(--transition), transform var(--transition);
}
@media (min-width: 1024px) {
    .cimagreen-logistics__node { padding: 2.5rem 2rem; }
}
.cimagreen-logistics__node:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.cimagreen-logistics__node--origin {
    border-top: 4px solid var(--color-secondary);
}
.cimagreen-logistics__node--transit {
    border-top: 4px solid var(--color-accent);
    background: linear-gradient(180deg, #fffdf0 0%, var(--color-white) 100%);
}
.cimagreen-logistics__node--dest {
    border-top: 4px solid var(--color-primary);
}

.cimagreen-logistics__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    opacity: .5;
    padding: 0 .5rem;
    transform: rotate(90deg);
}
@media (min-width: 1024px) {
    .cimagreen-logistics__arrow {
        transform: rotate(0deg);
        padding: 0 .75rem;
    }
}
.cimagreen-logistics__arrow svg { width: 28px; height: 28px; }

.cimagreen-logistics__node-icon {
    width: 56px; height: 56px;
    background: var(--color-gray-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    color: var(--color-primary);
}
.cimagreen-logistics__node-icon svg { width: 28px; height: 28px; }
.cimagreen-logistics__node--transit .cimagreen-logistics__node-icon {
    background: #fff9e0;
    color: #b07800;
}
.cimagreen-logistics__node-tag {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: .5rem;
}
.cimagreen-logistics__node-title {
    font-size: 1.0625rem;
    color: var(--color-primary);
    margin-bottom: .75rem;
}
.cimagreen-logistics__node-list {
    list-style: none;
    margin: 0; padding: 0;
    font-size: .875rem;
    color: #555;
    text-align: left;
}
.cimagreen-logistics__node-list li {
    padding: .3rem 0;
    padding-left: 1rem;
    position: relative;
}
.cimagreen-logistics__node-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: .5;
}
.cimagreen-logistics__node--transit .cimagreen-logistics__node-list li::before {
    background: var(--color-accent);
}

.cimagreen-logistics__facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 3rem;
}
@media (min-width: 640px) { .cimagreen-logistics__facts { grid-template-columns: repeat(4, 1fr); } }
.cimagreen-logistics__fact {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.cimagreen-logistics__fact-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: .25rem;
}
.cimagreen-logistics__fact-label {
    display: block;
    font-size: .8rem;
    color: #666;
    line-height: 1.3;
}

/* ─── Testimonials mejorados ────────────────────────────────────── */
.cimagreen-testimonial__stars {
    display: flex;
    gap: .2rem;
    margin-bottom: .875rem;
    color: var(--color-accent);
}
.cimagreen-testimonial__stars svg { width: 16px; height: 16px; }
.cimagreen-testimonial__company {
    display: block;
    font-size: .8rem;
    color: rgba(255,255,255,.55);
    margin-top: .2rem;
}
@media (min-width: 1024px) {
    .cimagreen-testimonials__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─── CTA Final mejorado ────────────────────────────────────────── */
.cimagreen-cta-final {
    padding-block: 4rem;
    background: linear-gradient(135deg, #0d3d2f 0%, var(--color-primary) 50%, #2d6e3e 100%);
    text-align: center;
}
@media (min-width: 768px) { .cimagreen-cta-final { padding-block: 6rem; } }

.cimagreen-cta-final__eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1rem;
}
.cimagreen-cta-final__title {
    font-size: clamp(1.375rem, 4vw, 2.5rem);
    color: var(--color-white);
    margin-bottom: 1rem;
    max-width: 700px;
    margin-inline: auto;
    line-height: 1.25;
}
.cimagreen-cta-final__subtitle {
    color: rgba(255,255,255,.8);
    font-size: clamp(.9375rem, 2.5vw, 1.125rem);
    max-width: 540px;
    margin-inline: auto;
    margin-bottom: 2.5rem;
}
.cimagreen-cta-final__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}
@media (min-width: 540px) {
    .cimagreen-cta-final__actions { flex-direction: row; justify-content: center; flex-wrap: wrap; }
}
.cimagreen-cta-final__trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,.15);
}
.cimagreen-cta-final__trust-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: rgba(255,255,255,.75);
}
.cimagreen-cta-final__trust-item svg { width: 18px; height: 18px; color: var(--color-accent); flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   CG Products — Homepage product grid (category-band + product-card)
   Layout: 2 col mobile → 3 col tablet (768px) → 4 col desktop (992px)
   Scope: only .cg-products-section — does NOT affect shop pages
═══════════════════════════════════════════════════════════════ */

/* ── Variables de categoría ──────────────────────────────────── */
:root {
    --cg-cat-frutas:   #FF8A3D;
    --cg-cat-verduras: #308629;
    --cg-cat-hierbas:  #1E5C3F;
}

/* ── Sección wrapper ─────────────────────────────────────────── */
.cg-products-section {
    padding-block: 2.5rem 3.5rem;
}
@media (min-width: 768px) {
    .cg-products-section { padding-block: 4rem 5.5rem; }
}

/* ── Header de sección ───────────────────────────────────────── */
.cg-section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.cg-section-header__title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--color-gray-dark);
    margin: 0 0 .5rem;
    letter-spacing: -.01em;
}
.cg-section-header__subtitle {
    font-size: clamp(.9375rem, 2.5vw, 1.0625rem);
    color: #666;
    margin: 0 auto;
    max-width: 540px;
}

/* ── Category Block — separator wrapper per category ─────────── */
.cg-category-block {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dde8dd;
}
.cg-category-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
@media (min-width: 768px) {
    .cg-category-block {
        margin-bottom: 3rem;
        padding-bottom: 1.5rem;
    }
}

/* ── Category Band ───────────────────────────────────────────── */
.cg-category-band {
    position: relative;
    height: 145px;
    background-size: cover;
    background-position: center;
    border-left: 5px solid var(--band-color, #1F7A63);
    overflow: hidden;
    margin-bottom: 0;
}
@media (min-width: 768px) {
    .cg-category-band { height: 170px; }
}
@media (min-width: 992px) {
    .cg-category-band { height: 196px; }
}

.cg-category-band__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, .65) 0%,
        rgba(0, 0, 0, .35) 55%,
        rgba(0, 0, 0, .15) 100%
    );
    pointer-events: none;
}

.cg-category-band__inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.cg-category-band__emoji {
    font-size: 1.875rem;
    line-height: 1;
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .cg-category-band__emoji { font-size: 2.25rem; }
}

.cg-category-band__title {
    font-size: clamp(1.25rem, 3.5vw, 2rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: .01em;
    flex: 1;
    margin: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

.cg-category-band__see-all {
    margin-left: auto;
    flex-shrink: 0;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .75rem;
    text-decoration: none;
    background: rgba(255, 255, 255, .15);
    border: 1.5px solid rgba(255, 255, 255, .45);
    padding: .4rem .875rem;
    border-radius: 999px;
    transition: background var(--transition, .2s ease), border-color var(--transition, .2s ease);
    white-space: nowrap;
}
@media (min-width: 768px) {
    .cg-category-band__see-all { font-size: .875rem; padding: .5rem 1.125rem; }
}
.cg-category-band__see-all:hover {
    background: rgba(255, 255, 255, .28);
    border-color: rgba(255, 255, 255, .75);
}

/* ── Products Grid — 2 col · 3 col · 4 col ──────────────────── */
.cg-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .875rem;
    padding-block: 1.25rem 0;
    margin-bottom: 0;
}
@media (min-width: 768px) {
    .cg-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        padding-block: 1.5rem 0;
    }
}
@media (min-width: 992px) {
    .cg-products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
        padding-block: 1.75rem 0;
    }
}

/* ── Product Card ────────────────────────────────────────────── */
.cg-product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, .06),
        0 4px 12px rgba(0, 0, 0, .07),
        0 0 0 1px rgba(0, 0, 0, .04);
    transition: transform .25s ease, box-shadow .25s ease;
    will-change: transform;
}
@media (min-width: 992px) {
    .cg-product-card { border-radius: 12px; }
}
.cg-product-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, .06),
        0 14px 36px rgba(0, 0, 0, .11),
        0 0 0 1px rgba(0, 0, 0, .05);
}

.cg-product-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

/* ── Media — 4:3 ratio, consistent across all breakpoints ───── */
.cg-product-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f4f7f4;
}

.cg-product-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .4s ease;
}
.cg-product-card:hover .cg-product-card__img {
    transform: scale(1.06);
}

/* No-image placeholder */
.cg-product-card__media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f4f7f4 0%, #eaf0ea 100%);
}
.cg-product-card__no-img {
    width: 36px; height: 36px;
    color: #b8ccb4;
}
@media (min-width: 768px) {
    .cg-product-card__no-img { width: 52px; height: 52px; }
}
.cg-product-card__no-img svg { width: 100%; height: 100%; }

/* ── Badge ───────────────────────────────────────────────────── */
.cg-product-card__badge {
    position: absolute;
    top: .4rem; left: .4rem;
    z-index: 2;
    background: rgba(255, 255, 255, .95);
    color: var(--color-primary, #1F7A63);
    font-family: var(--font-heading);
    font-size: .5625rem;
    font-weight: 700;
    padding: .175rem .5rem;
    border-radius: 999px;
    letter-spacing: .02em;
    white-space: nowrap;
    max-width: 6.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .14);
    line-height: 1.4;
}
@media (min-width: 768px) {
    .cg-product-card__badge {
        top: .75rem; left: .75rem;
        font-size: .6875rem;
        padding: .275rem .7rem;
        max-width: 9rem;
    }
}

/* ── Card body ───────────────────────────────────────────────── */
.cg-product-card__body {
    padding: .625rem .75rem .5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
@media (min-width: 768px) {
    .cg-product-card__body { padding: .875rem 1rem .75rem; gap: .375rem; }
}
@media (min-width: 992px) {
    .cg-product-card__body { padding: 1.125rem 1.25rem .875rem; }
}

.cg-product-card__name {
    font-family: var(--font-heading);
    font-size: .8125rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (min-width: 768px) {
    .cg-product-card__name { font-size: .9375rem; line-height: 1.35; }
}
@media (min-width: 992px) {
    .cg-product-card__name { font-size: 1.0625rem; }
}

.cg-product-card__desc {
    font-size: .75rem;
    color: #5c6b5c;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
@media (min-width: 768px) {
    .cg-product-card__desc { font-size: .8125rem; line-height: 1.5; }
}
@media (min-width: 992px) {
    .cg-product-card__desc { font-size: .875rem; line-height: 1.55; }
}

/* ── Card footer / CTA ───────────────────────────────────────── */
.cg-product-card__footer {
    padding: .375rem .625rem .5rem;
    border-top: 1px solid #f0f0f0;
}
@media (min-width: 768px) {
    .cg-product-card__footer { padding: .75rem 1rem; }
}
@media (min-width: 992px) {
    .cg-product-card__footer { padding: .875rem 1.25rem; }
}

.cg-product-card__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    width: 100%;
    min-height: 38px;
    padding: .4rem .375rem;
    border-radius: 6px;
    background: var(--color-primary, #1F7A63);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .625rem;
    letter-spacing: .025em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 768px) {
    .cg-product-card__cta {
        gap: .4375rem;
        padding: .625rem .875rem;
        font-size: .75rem;
        border-radius: 8px;
    }
}
@media (min-width: 992px) {
    .cg-product-card__cta {
        padding: .75rem 1rem;
        font-size: .8125rem;
        letter-spacing: .03em;
    }
}
.cg-product-card__cta:hover {
    background: #175f4e;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(31, 122, 99, .3);
}
.cg-product-card__cta:focus-visible {
    outline: 3px solid var(--color-accent, #F4B400);
    outline-offset: 3px;
}
.cg-product-card__cta svg {
    flex-shrink: 0;
    width: 12px; height: 12px;
}
@media (min-width: 768px) {
    .cg-product-card__cta svg { width: 14px; height: 14px; }
}

/* ── Section footer — catalog button ────────────────────────── */
.cg-products-section__footer {
    text-align: center;
    padding-top: 2rem;
}

.cg-catalog-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .875rem 1.75rem;
    background: transparent;
    border: 2px solid var(--color-primary, #1F7A63);
    color: var(--color-primary, #1F7A63);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .9375rem;
    letter-spacing: .02em;
    border-radius: 8px;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
@media (min-width: 992px) {
    .cg-catalog-btn { padding: 1rem 2.5rem; font-size: 1rem; }
}
.cg-catalog-btn:hover {
    background: var(--color-primary, #1F7A63);
    color: #fff;
    box-shadow: 0 4px 16px rgba(31, 122, 99, .2);
}
.cg-catalog-btn:focus-visible {
    outline: 3px solid var(--color-accent, #F4B400);
    outline-offset: 3px;
}
