/* Directorio de proveedores: iconos de aplicación, búsqueda y navegación. */
@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
}

body.exploring-providers,
body.exploring-providers *,
body.in-provider-store,
body.in-provider-store * {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
body.exploring-providers {
    background: #f8fafc;
    color: #0f172a;
    letter-spacing: 0;
}
body.exploring-providers ::selection { background: #0066ff; color: #fff; }
body.exploring-providers .app-container { padding-bottom: 0; }

/* El fondo de la cabecera ocupa la pantalla; su contenido sigue la rejilla. */
.marketplace-search, .marketplace-brand { display: none; }
body.exploring-providers .main-header {
    height: 64px;
    gap: 24px;
    padding: 10px max(24px, calc((100vw - 1152px) / 2 + 32px));
    border-bottom: 1px solid rgba(226, 232, 240, .8);
    background: #fff;
    box-shadow: none;
}
body.exploring-providers .main-header.es-desplazada { background: #fff; }
body.exploring-providers .main-header .logo {
    gap: 6px;
    padding: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 32px;
}
body.exploring-providers .main-header .logo-com { color: #0f172a; }
body.exploring-providers .main-header .logo-pro {
    margin: 0;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
    letter-spacing: 1px;
    background: #0066ff;
}
body.exploring-providers .main-header .marketplace-brand {
    display: block;
    width: auto;
    height: 48px;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: multiply;
}
body.exploring-providers .main-header .logo:has(.marketplace-brand) .logo-com,
body.exploring-providers .main-header .logo:has(.marketplace-brand) .logo-pro { display: none; }
body.exploring-providers #distributor-indicator { display: none !important; }
body.exploring-providers .marketplace-search {
    display: block;
    position: relative;
    flex: 1 1 448px;
    min-width: 0;
    max-width: 448px;
    margin-inline: auto;
}
body.exploring-providers .marketplace-search > svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}
body.exploring-providers #provider-search-input {
    display: block;
    width: 100%;
    min-height: 36px;
    padding: 9px 16px 9px 38px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    color: #0f172a;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    letter-spacing: 0;
    transition: background-color 150ms ease, box-shadow 150ms ease;
}
body.exploring-providers #provider-search-input::placeholder { color: #64748b; opacity: 1; }
body.exploring-providers #provider-search-input:focus { background: #fff; box-shadow: 0 0 0 2px #0066ff; }
body.exploring-providers .main-header .btn-header-register {
    flex-shrink: 0;
    min-height: 36px;
    padding: 9px 16px;
    border-radius: 999px;
    color: #fff;
    background: #0066ff;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0;
}
body.exploring-providers .main-header .btn-header-register:hover { background: #0052cc; }
body.exploring-providers .main-header .sn-header { margin-left: 0; }

/* Abajo deja sitio al dock (78px a 24px del borde) para que no tape nada. */
body.exploring-providers #provider-modal.provider-explorer {
    padding: 26px 24px calc(120px + env(safe-area-inset-bottom));
}
body.exploring-providers .provider-explorer-content {
    max-width: 1104px;
    margin-inline: auto;
}
body.exploring-providers .provider-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 896px;
    gap: 8px;
    margin: 0 auto;
    padding: 2px 0 24px;
    border: 0;
    border-bottom: 1px solid rgba(226, 232, 240, .6);
}
body.exploring-providers .provider-heading-summary { flex-shrink: 0; }
body.exploring-providers .provider-title { align-items: center; justify-content: center; gap: 10px; }
body.exploring-providers #provider-modal.provider-explorer h1 {
    margin: 0;
    padding: 0;
    color: #0f172a;
    font-size: 30px;
    font-weight: 800;
    line-height: 38px;
    letter-spacing: -1px;
}
body.exploring-providers #provider-results {
    margin: 0;
    padding: 2px 8px;
    border: 1px solid rgba(0, 102, 255, .1);
    border-radius: 999px;
    background: #eff6ff;
    color: #0066ff;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
}
body.exploring-providers #provider-results:empty { display: none; }
body.exploring-providers .provider-heading-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 12px;
    row-gap: 0;
    max-width: 100%;
    padding-top: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}
body.exploring-providers .provider-market-label { display: none; }
body.exploring-providers #provider-modal #provider-zone {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
    line-height: 22px;
    text-align: center;
}
body.exploring-providers #provider-zone:empty { display: none; }
body.exploring-providers #cp-publico-cambiar {
    min-height: 44px;
    margin: 0;
    padding: 0;
    color: #0066ff;
    font-size: 11px;
    font-weight: 600;
    line-height: 22px;
}
body.exploring-providers .provider-tools {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}
body.exploring-providers .provider-tools label { gap: 6px; min-height: 44px; font-size: 11px; font-weight: 500; }
body.exploring-providers .provider-tools input { width: 14px; height: 14px; accent-color: #0066ff; }

/* Solo el icono tiene superficie: nombre y controles flotan en el lienzo. */
body.exploring-providers #provider-list {
    display: grid;
    width: 100%;
    max-width: 896px;
    margin: 0 auto;
    padding: 64px 0 80px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    row-gap: 40px;
    justify-items: center;
    overflow: visible;
}
body.exploring-providers #provider-list .provider-choice {
    position: relative;
    display: block;
    width: 112px;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
    cursor: default;
    transform: none;
    opacity: 1;
}
body.exploring-providers #provider-list .provider-choice[hidden] { display: none; }
body.exploring-providers #provider-list .provider-filter-empty[hidden] { display: none !important; }
body.exploring-providers #provider-list .provider-choice:hover,
body.exploring-providers #provider-list .provider-choice:active { border: 0; background: none; box-shadow: none; transform: none; opacity: 1; }
body.exploring-providers #provider-list .provider-choice:has(.provider-options[open]) { z-index: 20; }
body.exploring-providers #provider-list .provider-enter,
body.exploring-providers #provider-list .provider-enter.provider-catalog {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    box-shadow: none;
    color: #0f172a;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transform-origin: center;
    transition: transform 180ms cubic-bezier(.34, 1.56, .64, 1), opacity 150ms ease, filter 150ms ease;
}
body.exploring-providers #provider-list .provider-enter:active { transform: scale(.93); filter: brightness(.96); }
body.exploring-providers #provider-list .provider-catalog:not(.provider-enter) { display: none; }
body.exploring-providers #provider-list .card-img-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    max-width: none;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 8px 24px -4px rgba(15, 23, 42, .08), 0 2px 6px -1px rgba(15, 23, 42, .04);
    overflow: hidden;
    animation: none;
    transition: box-shadow 300ms ease;
}
body.exploring-providers #provider-list .provider-enter img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    padding: 0;
    border-radius: 0;
    background: none;
    object-fit: contain;
}
body.exploring-providers #provider-list .card-img-wrapper:has(img[src*="logo_avicola"]) { padding: 8px; background: #fff; box-shadow: 0 16px 32px -4px rgba(220, 140, 40, .28), 0 4px 14px -2px rgba(15, 23, 42, .06); }
body.exploring-providers #provider-list .card-img-wrapper:has(img[src*="logo_moncarnes"]) { padding: 0; border: 0; background: #00965e; box-shadow: 0 16px 32px -4px rgba(0, 155, 104, .42), 0 6px 14px -2px rgba(0, 155, 104, .25); }
body.exploring-providers #provider-list .provider-enter img[src*="logo_moncarnes"] { object-fit: cover; }
body.exploring-providers #provider-list .card-img-wrapper:has(img[src*="logo_eiriz"], img[src*="marketplace-eiriz"]) { padding: 0; border: 0; background: #000; box-shadow: 0 16px 34px -4px rgba(0, 0, 0, .55), 0 6px 16px -2px rgba(0, 0, 0, .35); }
body.exploring-providers #provider-list .provider-enter img[src*="logo_eiriz"],
body.exploring-providers #provider-list .provider-enter img[src*="marketplace-eiriz"] { object-fit: cover; }
body.exploring-providers #provider-list .card-img-wrapper:has(img[src*="logo_navarro"]) { padding: 8px; background: #fff; box-shadow: 0 16px 32px -4px rgba(140, 20, 40, .28), 0 4px 14px -2px rgba(15, 23, 42, .06); }
body.exploring-providers #provider-list .card-img-wrapper:has(img[src*="logo_CW"]) { background: #edf6f3; box-shadow: 0 10px 25px -5px rgba(0, 88, 72, .22); }
body.exploring-providers #provider-list .provider-logo-fallback {
    width: 100% !important;
    height: 100% !important;
    border-radius: 14px;
    font-size: 26px !important;
    font-weight: 800;
}
body.exploring-providers #provider-list .card-name {
    display: block;
    width: 100%;
    min-height: 18px;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    letter-spacing: 0;
    text-overflow: clip;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    -webkit-line-clamp: unset;
    transition: color 150ms ease;
}
body.exploring-providers #provider-list .provider-description {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
body.exploring-providers #provider-list .provider-favorite {
    top: -8px;
    right: -4px;
    width: 32px;
    height: 32px;
    color: #64748b;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2px 7px rgba(15, 23, 42, .09);
    opacity: 0;
    z-index: 3;
    transition: opacity 150ms ease, color 150ms ease;
}
body.exploring-providers #provider-list .provider-favorite svg { width: 15px; height: 15px; }
body.exploring-providers #provider-list .provider-favorite.active { color: #0066ff; background: #fff; opacity: 1; }
body.exploring-providers #provider-list .provider-choice:focus-within .provider-favorite { opacity: 1; }

/* Los permisos originales determinan qué acciones contiene este desplegable. */
body.exploring-providers #provider-list .provider-options { position: absolute; top: 80px; right: -10px; z-index: 4; }
body.exploring-providers #provider-list .provider-options > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(248, 250, 252, .92);
    color: #94a3b8;
    cursor: pointer;
    list-style: none;
}
body.exploring-providers #provider-list .provider-options > summary::-webkit-details-marker { display: none; }
body.exploring-providers #provider-list .provider-options > summary svg { width: 18px; height: 18px; }
body.exploring-providers #provider-list .provider-options[open] > summary { color: #0066ff; background: #eff6ff; }
body.exploring-providers #provider-list .provider-options:not([open]) > .provider-actions { display: none; }
body.exploring-providers #provider-list .provider-options .provider-actions {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    grid-template-columns: 1fr;
    width: 190px;
    margin: 0;
    padding: 6px;
    gap: 2px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
    z-index: 20;
}
body.exploring-providers #provider-list .provider-options .provider-actions button {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100% !important;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px !important;
    background: #fff;
    color: #475569;
    font-size: 12px !important;
    font-weight: 600;
    line-height: 18px;
    text-align: left;
    cursor: pointer;
}
body.exploring-providers #provider-list .provider-options .provider-actions button:hover { background: #f1f5f9; color: #0066ff; }
body.exploring-providers #provider-list .provider-options .provider-actions button[data-csp-click="164"] { color: #dc2626; }
body.exploring-providers #provider-list .provider-options .provider-actions button[data-csp-click="164"]:hover { background: #fff1f2; }
body.exploring-providers #provider-list .provider-empty { width: 100%; }
body.exploring-providers #provider-list > button { grid-column: 1 / -1; }

/* El dock conserva destinos, visibilidad por rol y su capa de navegación. */
.bottom-nav {
    width: min(560px, calc(100% - 32px));
    height: 78px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border: 1px solid rgba(226, 232, 240, .8);
    border-radius: 999px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, .12), 0 0 1px 1px rgba(255, 255, 255, .9) inset;
}
.bottom-nav .nav-item {
    min-width: 44px;
    min-height: 56px;
    gap: 4px;
    padding: 0;
    border-radius: 12px;
    background: none;
    color: #64748b;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
}
.bottom-nav .nav-item span { font-family: inherit; }
.bottom-nav .nav-item svg { width: 24px; height: 24px; stroke-width: 2; }
.bottom-nav .nav-item.active { background: none; color: #0066ff; font-weight: 600; }
.bottom-nav .nav-item[hidden] { display: none !important; }

body.in-provider-store {
    --store-accent: #0066ff;
    --store-soft: #eff6ff;
    --store-glow: 0, 102, 255;
    --store-banner: linear-gradient(110deg, #003d99, #0066ff, #3b82f6);
}
body[data-storefront-provider="moncarnes"] {
    --store-accent: #00965e;
    --store-soft: #ecfdf5;
    --store-glow: 0, 155, 104;
    --store-banner: linear-gradient(110deg, #006640, #00965e, #10b981);
}
body[data-storefront-provider="avicola"] {
    --store-accent: #d97706;
    --store-soft: #fff7ed;
    --store-glow: 220, 140, 40;
    --store-banner: linear-gradient(110deg, #b45309, #d97706, #f59e0b);
}
body[data-storefront-provider="eiriz"] {
    --store-accent: #18181b;
    --store-soft: #f4f4f5;
    --store-glow: 0, 0, 0;
    --store-banner: linear-gradient(110deg, #000, #1c1917, #44403c);
}
body[data-storefront-provider="navarro"] {
    --store-accent: #881337;
    --store-soft: #fff1f2;
    --store-glow: 140, 20, 40;
    --store-banner: linear-gradient(110deg, #4c0519, #881337, #be123c);
}

/* Una transición breve conserva el contexto del proveedor al abrir su tienda. */
body.in-provider-store { background: #f8fafc; color: #0f172a; letter-spacing: 0; }
body.in-provider-store .app-container { padding-bottom: 0; }
body.in-provider-store .main-header {
    height: 64px;
    padding-inline: max(24px, calc((100vw - 1152px) / 2 + 32px));
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: none;
}
body.in-provider-store .main-header .logo { padding: 0; }
body.in-provider-store .main-header .marketplace-brand { display: block; width: auto; height: 48px; object-fit: contain; background: transparent; mix-blend-mode: multiply; }
body.in-provider-store .main-header .logo:has(.marketplace-brand) .logo-com,
body.in-provider-store .main-header .logo:has(.marketplace-brand) .logo-pro { display: none; }
body.in-provider-store #distributor-indicator { display: none !important; }
body.in-provider-store .storefront-header {
    position: sticky;
    top: 64px;
    z-index: 900;
    display: block;
    width: 100%;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.storefront-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1152px;
    margin: 0 auto;
    padding: 14px 32px;
    gap: 16px;
}
.storefront-identity { display: flex; align-items: center; min-width: 0; gap: 8px; }
#storefront-back,
#storefront-conditions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    gap: 6px;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}
#storefront-back svg,
#storefront-conditions svg { width: 16px; height: 16px; flex-shrink: 0; }
#storefront-back:hover { background: #eff6ff; color: #0066ff; }
#storefront-conditions { border-color: transparent; background: var(--store-soft); color: var(--store-accent); }
#storefront-conditions:hover { filter: brightness(.97); }
#storefront-logo { width: 28px; height: 28px; padding: 0; border-radius: 8px; background: #fff; object-fit: contain; flex-shrink: 0; }
body[data-storefront-provider="moncarnes"] #storefront-logo,
body[data-storefront-provider="eiriz"] #storefront-logo { object-fit: cover; }
#storefront-name { min-width: 0; color: #0f172a; font-size: 14px; font-weight: 700; line-height: 20px; overflow-wrap: anywhere; }
body.in-provider-store .storefront-hero { display: block; width: 100%; max-width: 1152px; margin: 24px auto 0; padding: 0 32px; }
#storefront-hero-banner {
    position: relative;
    padding: 40px;
    border-radius: 24px;
    background: var(--store-banner);
    color: #fff;
    overflow: hidden;
    transition: background-color 300ms ease;
}
#storefront-hero-banner > * { position: relative; z-index: 1; }
#storefront-hero-banner::after { content: ''; position: absolute; right: -32px; bottom: -48px; width: 256px; height: 256px; border-radius: 50%; background: rgba(255, 255, 255, .1); filter: blur(40px); pointer-events: none; }
.storefront-channel {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-bottom: 12px;
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    gap: 6px;
}
.storefront-channel svg { width: 14px; height: 14px; }
#storefront-title { max-width: 672px; margin: 0 0 8px; color: #fff; font-size: 40px; font-weight: 800; line-height: 48px; letter-spacing: -.9px; overflow-wrap: anywhere; }
#storefront-description { max-width: 672px; margin: 0 0 24px; color: rgba(255, 255, 255, .95); font-size: 16px; font-weight: 500; line-height: 24px; }
#storefront-description:empty { display: none; }
#storefront-terms { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; }
#storefront-terms:empty { display: none; }
#storefront-terms > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(0, 0, 0, .25); }
#storefront-terms svg { width: 15px; height: 15px; flex-shrink: 0; }
body.in-provider-store #view-tienda > .storefront-filters {
    display: flex;
    align-items: center;
    position: static;
    width: calc(100% - 64px);
    max-width: 1088px;
    margin: 32px auto 0;
    padding: 0 0 16px;
    gap: 16px;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}
body.in-provider-store .storefront-filters #category-scroll { flex: 1 1 auto; min-width: 0; max-width: none; margin: 0; padding: 0; gap: 8px; }
body.in-provider-store .storefront-filters .sort-filter-bar { display: flex; align-items: center; min-width: 0; padding: 0; gap: 12px; }
body.in-provider-store .storefront-filters .sort-dropdown { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
body.in-provider-store .storefront-filters #sort-select { min-height: 44px; max-width: 132px; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #475569; font-size: 12px; font-weight: 600; }
body.in-provider-store .storefront-filters .chip { min-height: 36px; padding: 8px 14px; border-color: #e2e8f0; border-radius: 999px; background: #fff; color: #475569; font-size: 12px; font-weight: 600; line-height: 18px; }
body.in-provider-store .storefront-filters .chip.active { background: #0f172a; border-color: #0f172a; color: #fff; }
body.in-provider-store .storefront-filters .chip-marca.active { background: var(--store-accent); border-color: var(--store-accent); color: #fff; }
body.in-provider-store .storefront-search { display: block; position: relative; width: 288px; min-width: 0; max-width: 100%; }
.storefront-search > svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
#storefront-search { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px 10px 36px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #1e293b; font-size: 12px; line-height: 18px; }
#storefront-search::placeholder { color: #64748b; opacity: 1; }
#storefront-search:focus { border-color: #0066ff; box-shadow: 0 0 0 2px rgba(0, 102, 255, .12); }
body.in-provider-store #view-tienda #grid {
    display: grid;
    width: calc(100% - 64px);
    max-width: 1088px;
    margin: 24px auto 0;
    padding: 0 0 calc(180px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}
body.in-provider-store #grid .product-card { min-width: 0; padding: 20px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); transition: box-shadow 150ms ease; }
body.in-provider-store #grid .product-card:hover { box-shadow: 0 4px 12px rgba(15, 23, 42, .08); }
body.in-provider-store #grid .product-card:active { transform: none; opacity: 1; background: #fff; }
body.in-provider-store #grid .card-img-wrapper { height: 160px; margin-bottom: 14px; padding: 12px; border: 1px solid #f1f5f9; border-radius: 12px; background: #f8fafc; }
body.in-provider-store #grid .card-img-wrapper:has(img.loaded) { background: #fff; }
body.in-provider-store #grid .card-brand { margin-bottom: 6px; color: #64748b; font-size: 10px; font-weight: 700; line-height: 16px; letter-spacing: .6px; }
body.in-provider-store #grid .card-name { display: block; min-height: 40px; height: auto; max-height: none; margin-bottom: 6px; color: #0f172a; font-size: 14px; font-weight: 700; line-height: 20px; overflow: visible; overflow-wrap: anywhere; -webkit-line-clamp: unset; }
body.in-provider-store #grid .card-desc { min-height: 36px; height: auto; margin-bottom: 16px; color: #64748b; font-size: 12px; line-height: 18px; }
body.in-provider-store #grid .card-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid #f1f5f9; gap: 8px; }
body.in-provider-store #grid .card-price { color: #0f172a; font-size: 16px; font-weight: 800; }
body.in-provider-store #grid .card-actions { flex-direction: column; align-items: stretch; gap: 8px; }
body.in-provider-store #grid .qty-control { width: 100%; min-width: 0; height: 44px; border: 0; border-radius: 12px; background: #f8fafc; box-shadow: inset 0 0 0 1px #e2e8f0; }
body.in-provider-store #grid .qty-btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; background: none; color: #334155; font-size: 18px; }
body.in-provider-store #grid .qty-input { flex: 1; width: 24px; min-width: 24px; color: #0f172a; font-size: 16px; }
body.in-provider-store #grid .btn-add-card { width: 100%; min-height: 44px; height: 44px; padding-inline: 8px; border-radius: 12px; background: #0066ff; border-color: #0066ff; color: #fff; font-size: 12px; font-weight: 700; }
body.in-provider-store #grid .btn-add-card.btn-added { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
body.in-provider-store #grid .btn-add-card.btn-agotado { background: #f1f5f9; border-color: #e2e8f0; color: #64748b; }

.storefront-conditions-detail { margin-top: 24px; padding: 20px; border: 1px solid #e2e8f0; border-radius: 16px; background: #f8fafc; color: #475569; text-align: left; }
.storefront-conditions-detail[hidden] { display: none !important; }
.storefront-conditions-detail h2,
.storefront-conditions-detail h3 { margin: 0 0 12px; color: #0f172a; font-size: 16px; font-weight: 700; line-height: 22px; }
.storefront-conditions-detail p,
.storefront-conditions-detail dl { margin: 0; font-size: 13px; line-height: 20px; }
.storefront-conditions-detail dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; }
.storefront-conditions-detail dd { color: #0f172a; font-weight: 600; text-align: right; }
.storefront-empty { grid-column: 1 / -1; width: 100%; padding: 64px 24px; color: #64748b; font-size: 14px; line-height: 22px; text-align: center; }

@media (hover: hover) and (pointer: fine) {
    body.exploring-providers #provider-list .provider-enter:hover .card-name { color: #0052cc; }
    body.exploring-providers #provider-list .provider-choice:hover .provider-favorite { opacity: 1; }
    body.exploring-providers #provider-list .provider-options > summary:hover { color: #475569; background: #fff; }
    .bottom-nav .nav-item:not(.active):hover { color: #0066ff; background: none; }
}
@media (min-width: 640px) {
    body.exploring-providers #provider-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px; }
    body.exploring-providers #provider-list .provider-choice { width: 128px; }
    body.exploring-providers #provider-list .card-img-wrapper { width: 112px; height: 112px; padding: 16px; }
    body.exploring-providers #provider-list .provider-options { top: 96px; }
    body.exploring-providers #provider-list .provider-choice:nth-child(4n + 1) .provider-actions { left: 0; right: auto; }
}
@media (min-width: 1024px) {
    body.exploring-providers .main-header { padding-inline: max(32px, calc((100vw - 1152px) / 2 + 32px)); }
    body.exploring-providers #provider-modal.provider-explorer { padding-inline: 32px; }
    body.exploring-providers .provider-explorer-content { max-width: 1088px; }
}
@media (max-width: 1023px) {
    body.in-provider-store #view-tienda #grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .storefront-header-inner { padding-inline: 24px; }
    body.in-provider-store .storefront-hero { padding-inline: 24px; }
    body.in-provider-store #view-tienda > .storefront-filters { width: calc(100% - 48px); flex-direction: column; align-items: stretch; gap: 12px; }
    body.in-provider-store .storefront-filters #category-scroll { width: 100%; flex: none; }
    body.in-provider-store .storefront-filters .sort-filter-bar { width: 100%; flex-wrap: wrap; gap: 12px; }
    body.in-provider-store .storefront-search { flex: 1 1 220px; width: auto; max-width: none; }
    body.in-provider-store #view-tienda #grid { width: calc(100% - 48px); gap: 16px; }
    body.in-provider-store #grid .product-card { padding: 16px; }
}
@media (max-width: 639px) {
    body.exploring-providers .main-header { height: auto; min-height: 64px; flex-wrap: wrap; gap: 10px 16px; padding: 10px 24px 12px; }
    body.exploring-providers .main-header .logo { order: 0; }
    body.exploring-providers .main-header .marketplace-brand { height: 44px; }
    body.exploring-providers .main-header .btn-header-register { order: 1; margin-left: auto; min-height: 44px; }
    body.exploring-providers .main-header .sn-header { order: 1; margin-left: auto; }
    body.exploring-providers .marketplace-search { order: 2; flex-basis: 100%; max-width: none; margin: 0; }
    body.exploring-providers #provider-search-input { min-height: 44px; font-size: 16px; line-height: 22px; }
    body.exploring-providers #provider-modal.provider-explorer { padding-top: 24px; }
    body.exploring-providers .provider-heading { gap: 8px; padding-bottom: 16px; }
    body.exploring-providers #provider-modal.provider-explorer h1 { font-size: 24px !important; line-height: 32px; }
    body.exploring-providers .provider-heading-context { width: 100%; }
    body.exploring-providers #provider-list { padding-top: 48px; }
    body.exploring-providers #provider-list .provider-favorite { width: 44px; height: 44px; top: -12px; right: -12px; opacity: 1; }
    body.exploring-providers #provider-list .provider-options { right: -16px; top: 70px; }
    body.exploring-providers #provider-list .provider-options > summary { width: 44px; height: 44px; }
    body.exploring-providers #provider-list .provider-choice:nth-child(2n + 1) .provider-actions { left: 0; right: auto; }
    body.in-provider-store .main-header { padding-inline: 16px; }
    body.in-provider-store .main-header .marketplace-brand { height: 44px; }
    .storefront-header-inner { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    #storefront-name { display: none; }
    #storefront-back { padding-inline: 10px; font-size: 11px; }
    #storefront-conditions { padding-inline: 10px; font-size: 11px; }
    body.in-provider-store .storefront-hero { margin-top: 16px; padding-inline: 16px; }
    #storefront-hero-banner { padding: 24px; }
    #storefront-title { font-size: 28px; line-height: 34px; letter-spacing: -.6px; }
    #storefront-description { font-size: 14px; line-height: 22px; }
    #storefront-terms { gap: 8px; }
    body.in-provider-store #view-tienda > .storefront-filters { width: calc(100% - 32px); margin-top: 24px; }
    #storefront-search { font-size: 16px; line-height: 22px; }
    body.in-provider-store #view-tienda #grid { width: calc(100% - 32px); }
    body.in-provider-store #grid .product-card { padding: 12px; }
    body.in-provider-store #grid .card-img-wrapper { height: 112px; padding: 10px; }
    body.in-provider-store #grid .card-name { font-size: 13px; line-height: 19px; min-height: 38px; }
    body.in-provider-store #grid .card-price { font-size: 14px; }
    .bottom-nav { padding: 10px 14px; }
    .bottom-nav .nav-item { font-size: 11px; }
    .bottom-nav .nav-item svg { width: 24px; height: 24px; }
}
@media (hover: none), (pointer: coarse) {
    body.exploring-providers #provider-search-input { min-height: 44px; font-size: 16px; }
    body.exploring-providers .main-header .btn-header-register { min-height: 44px; }
    body.exploring-providers #provider-list .provider-favorite { width: 44px; height: 44px; opacity: 1; }
    body.exploring-providers #provider-list .provider-options > summary { width: 44px; height: 44px; }
    body.in-provider-store .storefront-filters .chip { min-height: 44px; }
    #storefront-search { font-size: 16px; }
}
@media (max-width: 359px) {
    body.exploring-providers .main-header { padding-inline: 16px; }
    body.exploring-providers #provider-modal.provider-explorer { padding-inline: 16px; }
    body.exploring-providers #provider-list { column-gap: 20px; }
    body.in-provider-store #view-tienda #grid { gap: 12px; }
    body.in-provider-store #grid .product-card { padding: 10px; }
    .bottom-nav { width: calc(100% - 16px); padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    body.exploring-providers #provider-list .provider-enter,
    body.exploring-providers #provider-list .card-img-wrapper,
    body.exploring-providers #provider-list .provider-favorite { transition: none; }
    body.exploring-providers #provider-list .provider-enter:active { transform: none; }
    #storefront-hero-banner { transition: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.exploring-providers .main-header,
    .bottom-nav { background: #fff; }
    body.in-provider-store .storefront-header { background: #fff; }
}

/* Visitante sin código postal (16/10): el CP se pone aquí mismo y, debajo, una
   muestra de proveedores marcada como ejemplo. Letra ≥ 14 px y controles de
   48 px: el listón es un comprador de 60 años (reunión del 30/09). */
body.exploring-providers #provider-list .cp-tienda {
    grid-column: 1 / -1;
    justify-self: stretch;
    display: grid;
    gap: 40px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}
.cp-tienda-form {
    padding: 28px;
    background: #fff;
    border: 1px solid var(--compro-borde);
    border-radius: 24px;
    box-shadow: var(--compro-sombra);
}
.cp-tienda-titulo { margin: 0 0 18px; color: var(--apple-black); font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.cp-tienda-etiqueta { display: block; margin-bottom: 8px; color: var(--apple-black); font-size: 15px; font-weight: 600; }
.cp-tienda-fila { display: flex; gap: 12px; }
/* «¿En qué localidad?» cuando el CP es de varias (PROMPT_codigos_postales.md, Fase 4). */
.cp-tienda-localidad { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
/* El país, delante del CP, solo con más de un país activo (Fase 6). */
.cp-tienda-fila .cp-tienda-pais { flex: 0 0 auto; width: auto; }
/* «Avísame» en la pantalla vacía (Fase 5). Ocupa toda la rejilla de proveedores. */
.avisame {
    grid-column: 1 / -1; max-width: 520px; margin: 8px auto 0; padding: 24px;
    display: flex; flex-direction: column; gap: 8px;
    background: #fff; border: 1px solid #e5e5ea; border-radius: 18px; text-align: left;
}
.avisame h2 { font-size: 20px; margin: 0 0 4px; }
.avisame-texto { color: #6e6e73; margin: 0 0 8px; }
.avisame label { font-weight: 600; font-size: 14px; }
.avisame input[type="email"], .avisame input[type="text"], .avisame input[type="tel"] {
    height: 46px; padding: 0 14px; font-size: 16px; border: 1px solid #d2d2d7; border-radius: 12px;
}
.avisame input[aria-invalid="true"] { border-color: #c0392b; }
.avisame-opcional { font-weight: 400; color: #86868b; }
.avisame-consentimiento { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin-top: 6px; }
.avisame-consentimiento input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.avisame-estado { min-height: 1.2em; margin: 4px 0 0; }
.avisame-estado.es-error { color: #c0392b; }
.avisame-trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cp-tienda-input {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 18px;
    border: 1px solid var(--apple-border);
    border-radius: 14px;
    background: #fff;
    color: var(--apple-black);
    font: inherit;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .08em;
}
.cp-tienda-input::placeholder { color: #94a3b8; font-weight: 500; letter-spacing: 0; }
.cp-tienda-input:focus-visible { outline: 3px solid rgba(0, 102, 255, .25); outline-offset: 0; border-color: var(--apple-blue); }
.cp-tienda-input[aria-invalid="true"] { border-color: #dc2626; }
.cp-tienda-form .cp-tienda-enviar { flex: none; width: auto; min-height: 52px; margin: 0; padding: 0 24px; font-size: 16px; }
#provider-modal .cp-tienda-form .cp-tienda-enviar {
    border: 0;
    background: var(--apple-blue);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 102, 255, .22);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
#provider-modal .cp-tienda-form .cp-tienda-enviar:hover { background: #0052cc; }
.cp-tienda-form .cp-tienda-enviar:disabled { opacity: .6; cursor: progress; }
#provider-modal.pide-cp .provider-intro,
#provider-modal.pide-cp .provider-tools { display: none; }
.cp-tienda-ayuda { margin: 10px 0 0; color: var(--apple-text-sec); font-size: 14px; }
.cp-tienda-error { margin: 6px 0 0; color: #b91c1c; font-size: 15px; font-weight: 600; }
.cp-tienda-error:empty { display: none; }
.cp-tienda-rapidos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; color: var(--apple-text-sec); font-size: 14px; }
.cp-tienda-rapido {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--apple-border);
    border-radius: 999px;
    background: var(--compro-suave);
    color: var(--apple-black);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.cp-tienda-rapido:hover { border-color: var(--apple-blue); color: var(--apple-blue); }
.cp-tienda-rapido:disabled { opacity: .6; cursor: progress; }

.cp-tienda-muestra[hidden] { display: none; }
.cp-tienda-ejemplo {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 14px;
    font-weight: 700;
}
.cp-tienda-muestra-titulo { margin: 10px 0 4px; color: var(--apple-black); font-size: 20px; font-weight: 800; }
.cp-tienda-muestra-texto { margin: 0 0 18px; color: var(--apple-text-sec); font-size: 15px; }
.cp-tienda-lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.cp-tienda-proveedor {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--compro-borde);
    border-radius: 18px;
}
.cp-tienda-logo {
    flex: none;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 14px;
    background: #f1f5f9;
}
.cp-tienda-logo img { border-radius: 10px; }
.cp-tienda-proveedor-texto { min-width: 0; }
.cp-tienda-proveedor-texto h3 { margin: 2px 0 4px; color: var(--apple-black); font-size: 16px; font-weight: 700; line-height: 1.3; }
.cp-tienda-descripcion {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #475569;
    font-size: 14px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.cp-tienda-lugar { margin: 6px 0 0; color: var(--apple-text-sec); font-size: 14px; }

@media (max-width: 639px) {
    body.exploring-providers #provider-list .cp-tienda { gap: 28px; }
    .cp-tienda-form { padding: 20px; border-radius: 20px; }
    .cp-tienda-fila { flex-direction: column; }
    .cp-tienda-input { flex: none; }
    .cp-tienda-form .cp-tienda-enviar { width: 100%; }
    .cp-tienda-lista { grid-template-columns: 1fr; }
}
