/* ============================================================
   MARKETPLACE - GALERIA INGREDIO
   ============================================================ */

:root {
    --market-ink: #10231f;
    --market-muted: #64716d;
    --market-green: #126b57;
    --market-green-dark: #0d4d40;
    --market-mint: #e7f4ef;
    --market-cream: #f7f3ea;
    --market-coral: #ef8f68;
    --market-line: rgba(16, 35, 31, 0.12);
    --market-shadow: 0 22px 60px rgba(16, 35, 31, 0.12);
}

body {
    margin: 0;
    color: var(--market-ink);
    background: #f7f8f5;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.marketplace {
    min-height: 100vh;
    background:
        linear-gradient(180deg, #f8fbf7 0%, #eef5f0 46%, #f7f8f5 100%);
}

.marketplace-hero {
    width: min(1180px, calc(100% - 32px));
    min-height: 74vh;
    margin: 0 auto;
    padding: 56px 0 36px;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 44px;
    align-items: center;
}

.hero-copy {
    max-width: 760px;
}

.logo-ingredio-hero {
    width: 168px;
    max-width: 58vw;
    height: auto;
    display: block;
    margin-bottom: 34px;
}

.hero-kicker,
.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 32px;
    padding: 7px 12px;
    border: 1px solid rgba(18, 107, 87, 0.18);
    border-radius: 999px;
    background: rgba(231, 244, 239, 0.9);
    color: var(--market-green-dark);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hero-copy h1 {
    margin: 20px 0 22px;
    max-width: 820px;
    font-family: 'Oswald', 'Inter', sans-serif;
    font-size: clamp(2.55rem, 7vw, 5.7rem);
    line-height: 0.96;
    font-weight: 700;
    color: var(--market-ink);
}

.hero-copy p {
    max-width: 640px;
    margin: 0;
    color: var(--market-muted);
    font-size: 1.15rem;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.btn-marketplace-primary,
.btn-marketplace-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 13px 20px;
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-marketplace-primary {
    background: var(--market-green);
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(18, 107, 87, 0.22);
}

.btn-marketplace-primary:hover {
    color: #ffffff;
    background: var(--market-green-dark);
    transform: translateY(-2px);
}

.btn-marketplace-secondary {
    border: 1px solid var(--market-line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--market-ink);
}

.btn-marketplace-secondary:hover {
    color: var(--market-ink);
    background: #ffffff;
    transform: translateY(-2px);
}

.hero-panel {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--market-shadow);
    padding: 22px;
    display: grid;
    gap: 14px;
}

.hero-panel::before {
    content: "";
    display: block;
    height: 180px;
    border-radius: 6px;
    background:
        linear-gradient(rgba(16, 35, 31, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 35, 31, 0.08) 1px, transparent 1px),
        #f3f7f1;
    background-size: 24px 24px;
    border: 1px solid var(--market-line);
}

.panel-stat {
    display: grid;
    gap: 2px;
    padding: 16px;
    border: 1px solid var(--market-line);
    border-radius: 8px;
    background: #fbfcf9;
}

.panel-stat strong {
    font-family: 'Oswald', 'Inter', sans-serif;
    font-size: 2rem;
    line-height: 1;
    color: var(--market-green-dark);
}

.panel-stat span {
    color: var(--market-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.marketplace-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 80px;
}

.marketplace-heading {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: end;
    margin-bottom: 22px;
}

.marketplace-heading h2,
.merchant-cta h2 {
    margin: 12px 0 0;
    font-family: 'Oswald', 'Inter', sans-serif;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1;
}

.marketplace-heading p,
.merchant-cta p {
    max-width: 470px;
    margin: 0;
    color: var(--market-muted);
    line-height: 1.55;
}

.marketplace-topbar {
    margin-bottom: 24px;
}

.marketplace #buscador {
    width: 100%;
    min-height: 56px;
    border-radius: 8px;
    padding: 16px 18px;
    font-size: 1rem;
    border: 1px solid var(--market-line);
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(16, 35, 31, 0.08);
    transition: border 0.18s ease, box-shadow 0.18s ease;
}

.marketplace #buscador:focus {
    outline: none;
    border-color: rgba(18, 107, 87, 0.45);
    box-shadow: 0 12px 34px rgba(18, 107, 87, 0.15);
}

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
}

.comercio-item {
    min-height: 210px;
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: center;
    text-decoration: none;
    color: var(--market-ink);
    background: #ffffff;
    border: 1px solid var(--market-line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(16, 35, 31, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border 0.18s ease;
}

.comercio-item:hover {
    color: var(--market-ink);
    transform: translateY(-4px);
    border-color: rgba(18, 107, 87, 0.28);
    box-shadow: 0 20px 44px rgba(16, 35, 31, 0.14);
}

.comercio-logo-wrap {
    display: grid;
    place-items: center;
    padding: 24px 18px 18px;
}

.comercio-logo {
    width: 104px;
    height: 104px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(16, 35, 31, 0.1);
    box-shadow: 0 14px 30px rgba(16, 35, 31, 0.16);
}

.comercio-nombre {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 12px 14px;
    background: var(--market-ink);
    color: #ffffff;
    text-align: center;
    font-family: 'Oswald', 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.15;
}

.marketplace-empty {
    grid-column: 1 / -1;
    display: grid;
    gap: 6px;
    padding: 28px;
    border: 1px dashed rgba(18, 107, 87, 0.3);
    border-radius: 8px;
    background: #ffffff;
}

.marketplace-empty span {
    color: var(--market-muted);
}

.merchant-cta {
    margin-top: 34px;
    padding: 28px;
    border-radius: 8px;
    background: var(--market-cream);
    border: 1px solid rgba(16, 35, 31, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.resultados-busqueda {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 26px;
    align-items: start;
}

.resultado-comercio {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--market-line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(16, 35, 31, 0.1);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.resultado-comercio:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(16, 35, 31, 0.14);
}

.comercio-header {
    text-align: center;
    margin-bottom: 18px;
}

.comercio-header a {
    color: inherit;
    text-decoration: none;
}

.comercio-header img {
    width: 82px;
    height: 82px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 10px 22px rgba(16, 35, 31, 0.14);
}

.comercio-header h3 {
    margin: 10px 0 0;
    font-family: 'Oswald', 'Inter', sans-serif;
    font-size: 1.25rem;
    color: var(--market-ink);
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 12px;
}

.producto-card-mini {
    min-height: 152px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    color: inherit;
    background: #f8faf6;
    border: 1px solid rgba(16, 35, 31, 0.08);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: transform 0.18s ease, background 0.18s ease;
}

.producto-card-mini:hover {
    color: inherit;
    background: var(--market-mint);
    transform: translateY(-2px);
}

.producto-card-mini img {
    width: 72px !important;
    height: 72px !important;
    object-fit: cover;
    display: block;
    margin: 0 auto 8px;
    border-radius: 8px;
}

.producto-nombre {
    display: block;
    margin-top: 4px;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.25;
}

.producto-precio {
    display: block;
    margin-top: auto;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--market-green-dark);
}

.skeleton-comercio {
    height: 220px;
    border-radius: 8px;
    background: linear-gradient(90deg, #e3e8e0 0%, #f5f7f1 50%, #e3e8e0 100%);
    background-size: 200% 100%;
    animation: skeleton 1.2s infinite linear;
}

.fade-in {
    animation: fadeIn 0.28s ease-out;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .marketplace-hero {
        min-height: auto;
        grid-template-columns: 1fr;
        padding-top: 34px;
    }

    .hero-panel {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-panel::before {
        display: none;
    }

    .marketplace-heading,
    .merchant-cta {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .marketplace-hero,
    .marketplace-shell {
        width: min(100% - 20px, 1180px);
    }

    .hero-copy h1 {
        font-size: clamp(2.35rem, 17vw, 3.4rem);
    }

    .hero-copy p {
        font-size: 1rem;
    }

    .hero-actions,
    .hero-panel {
        grid-template-columns: 1fr;
    }

    .btn-marketplace-primary,
    .btn-marketplace-secondary,
    .merchant-cta .btn-marketplace-primary {
        width: 100%;
    }

    .marketplace-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .comercio-item {
        min-height: 184px;
    }

    .comercio-logo {
        width: 86px;
        height: 86px;
    }

    .comercio-nombre {
        min-height: 52px;
        font-size: 0.92rem;
    }

    .resultados-busqueda {
        grid-template-columns: 1fr;
    }
}
