/* Tema Mercado — estilo supermercado / tienda por departamentos */
/* Variables en :root para que la personalización de la tienda (inyectada después) pueda reemplazarlas */
:root {
    --tm-primario: #0a6fb5;
    --tm-primario-texto: #ffffff;
    --tm-oscuro: #1c2541;
    --tm-texto: #222a31;
    --tm-texto-suave: #58616a;
    --tm-suave: #f3f5f7;
    --tm-borde: #e3e7ec;
    --tm-exito: #1b7f3b;
    --tm-fuente: 'Manrope', system-ui, sans-serif;
    --tm-fuente-titulos: 'Manrope', system-ui, sans-serif;
}
body.tema-mercado {
    --bs-link-color: var(--tm-primario);
    --bs-link-hover-color: var(--tm-oscuro);
    font-family: var(--tm-fuente);
    background: #ffffff;
    color: var(--tm-texto);
}

/* Neutraliza reglas genéricas del diseño base */
body.tema-mercado header,
body.tema-mercado footer { display: block; padding: 0; margin: 0; text-align: left; background: none; color: inherit; position: static; z-index: auto; justify-content: initial; }
body.tema-mercado h1, body.tema-mercado h2, body.tema-mercado h3,
body.tema-mercado h4, body.tema-mercado h5, body.tema-mercado h6 { font-family: var(--tm-fuente-titulos); color: var(--tm-texto); font-weight: 800; }
body.tema-mercado a { color: var(--tm-primario); }
body.tema-mercado .tm-inicio { margin: -20px; }

.mc-contenedor { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }

/* Barra superior */
.mc-topbar { background: var(--tm-suave); font-size: .82rem; color: var(--tm-texto-suave); }
.mc-topbar-fila { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 38px; }
.mc-topbar-der { display: flex; align-items: center; gap: 1.25rem; }
.mc-topbar-item { display: inline-flex; align-items: center; gap: .4rem; color: var(--tm-texto-suave); text-decoration: none; }
body.tema-mercado a.mc-topbar-item { color: var(--tm-texto-suave); }
.mc-topbar-item i { color: var(--tm-primario); }
.mc-moneda select { border: 1px solid var(--tm-borde); border-radius: 6px; padding: 2px 6px; background: #ffffff; font-size: .8rem; }

/* Encabezado */
body.tema-mercado header.mc-header { position: sticky; top: 0; z-index: 1030; background: #ffffff; border-bottom: 1px solid var(--tm-borde); }
.mc-header-fila { display: flex; align-items: center; gap: 1.5rem; min-height: 80px; }
.mc-menu-boton { display: none; width: 44px; height: 44px; border: 0; background: none; font-size: 1.6rem; color: var(--tm-primario); }
.mc-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; flex-shrink: 0; }
body.tema-mercado a.mc-logo { color: var(--tm-primario); }
.mc-logo .tm-logo-img { height: 38px; width: auto; }
.mc-logo .tm-logo-nombre { font-size: 1.35rem; font-weight: 800; }

.mc-buscador { position: relative; flex: 1; display: flex; align-items: center; gap: .6rem; height: 48px; background: #eef4fa; border-radius: 12px; padding: 0 6px 0 16px; }
.mc-buscador .tm-buscador-icono { color: var(--tm-primario); }
.mc-buscador input { flex: 1; border: 0; background: transparent; font-size: .98rem; outline: none; min-width: 0; }
.mc-buscador .tm-buscador-boton { height: 38px; border: 0; border-radius: 9px; padding: 0 1rem; background: var(--tm-primario); color: var(--tm-primario-texto); font-weight: 700; }
.mc-buscador:focus-within { box-shadow: 0 0 0 3px rgba(10, 111, 181, .25); }

.mc-acciones { display: flex; align-items: center; gap: .5rem; }
.mc-accion { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 .6rem; border-radius: 10px; font-weight: 700; font-size: .9rem; text-decoration: none; }
body.tema-mercado a.mc-accion { color: var(--tm-texto); }
.mc-accion:hover { background: var(--tm-suave); }
.mc-accion i { font-size: 1.3rem; color: var(--tm-primario); }

.mc-categorias { border-top: 1px solid var(--tm-borde); }
.mc-categorias-fila { display: flex; gap: .5rem; overflow-x: auto; padding-top: .6rem; padding-bottom: .6rem; scrollbar-width: none; }
.mc-categorias-fila::-webkit-scrollbar { display: none; }
.mc-cat { flex-shrink: 0; padding: .45rem 1rem; border-radius: 999px; background: var(--tm-suave); font-size: .86rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
body.tema-mercado a.mc-cat { color: var(--tm-texto); }
body.tema-mercado a.mc-cat.is-activo, body.tema-mercado a.mc-cat:hover { background: var(--tm-primario); color: var(--tm-primario-texto); }

.mc-menu-movil { border-top: 1px solid var(--tm-borde); background: #ffffff; max-height: 70vh; overflow-y: auto; }
.mc-menu-movil nav { display: flex; flex-direction: column; padding: .5rem 24px 1rem; }
.mc-menu-movil a { padding: .8rem 0; border-bottom: 1px solid var(--tm-borde); font-weight: 700; text-decoration: none; }
body.tema-mercado .mc-menu-movil a { color: var(--tm-texto); }

/* Portada */
.mc-hero-zona { padding-top: 28px; }
.mc-hero { position: relative; }
.mc-slide { display: none; min-height: 320px; border-radius: 18px; background: var(--tm-oscuro); color: #ffffff; overflow: hidden; align-items: center; justify-content: space-between; gap: 2rem; padding: 32px 64px 48px 72px; box-sizing: border-box; }
.mc-slide.is-activo { display: flex; }
.mc-slide-texto { display: flex; flex-direction: column; gap: .75rem; max-width: 560px; }
.mc-slide-antetitulo { font-size: .95rem; color: #c9d4ea; }
body.tema-mercado .mc-slide-titulo { color: #ffffff; font-size: clamp(1.8rem, 3.6vw, 3rem); line-height: 1.08; margin: 0; text-transform: uppercase; }
.mc-slide-sub { margin: 0; font-size: 1.1rem; color: #e5ebf7; }
body.tema-mercado a.mc-slide-boton { align-self: flex-start; margin-top: .5rem; padding: .8rem 1.4rem; border-radius: 10px; background: #ffffff; color: var(--tm-oscuro); font-weight: 800; text-decoration: none; }
.mc-slide-imagen { width: 40%; max-width: 420px; height: 260px; object-fit: cover; border-radius: 14px; }
.mc-hero-flecha { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: #ffffff; color: var(--tm-primario); box-shadow: 0 4px 14px rgba(20, 30, 50, .2); font-size: 1.1rem; }
.mc-hero-prev { left: -20px; }
.mc-hero-next { right: -20px; }
.mc-hero-puntos { position: absolute; left: 72px; bottom: 20px; display: flex; gap: 6px; }
.mc-hero-puntos .tm-punto { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: rgba(255,255,255,.45); transition: width .2s; }
.mc-hero-puntos .tm-punto.is-activo { width: 24px; background: #ffffff; }

.mc-seccion { margin-top: 52px; }
.mc-seccion-cabecera { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; border-bottom: 1px solid var(--tm-borde); margin-bottom: 20px; }
body.tema-mercado .mc-seccion-cabecera h2 { margin: 0; padding-bottom: 12px; font-size: 1.3rem; border-bottom: 3px solid var(--tm-primario); margin-bottom: -1px; }
.mc-seccion-cabecera h2 span { color: var(--tm-primario); }
.mc-seccion-cabecera a { padding-bottom: 12px; font-size: .85rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
body.tema-mercado .mc-seccion-cabecera a { color: var(--tm-texto); }

.mc-grilla { display: grid; gap: 18px; }
.mc-grilla-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.mc-circulos { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px; }
.mc-circulo { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; font-size: .9rem; text-align: center; }
body.tema-mercado a.mc-circulo { color: var(--tm-texto); }
.mc-circulo-img { width: 100%; max-width: 128px; aspect-ratio: 1; border-radius: 50%; background: var(--tm-suave); border: 1px solid var(--tm-borde); display: flex; align-items: center; justify-content: center; overflow: hidden; transition: border-color .2s; }
.mc-circulo:hover .mc-circulo-img { border: 2px solid var(--tm-primario); }
.mc-circulo-img img { width: 70%; height: 70%; object-fit: contain; }

.mc-promos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.mc-promo { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 190px; padding: 0 18px 0 26px; border-radius: 16px; overflow: hidden; text-decoration: none; }
.mc-promo img { width: 42%; height: 150px; object-fit: cover; border-radius: 12px; }
.mc-promo-texto { display: flex; flex-direction: column; gap: .7rem; }
.mc-promo-etiqueta { align-self: flex-start; font-size: .7rem; font-weight: 800; letter-spacing: .08em; padding: .3rem .6rem; border-radius: 6px; background: #ffffff; color: #222a31; }
.mc-promo-titulo { font-size: 1.35rem; font-weight: 800; line-height: 1.15; }
.mc-promo-enlace { font-size: .85rem; font-weight: 700; }
body.tema-mercado a.mc-promo-oscura { background: #23272b; color: #ffffff; }
.mc-promo-oscura .mc-promo-etiqueta { background: #3a4046; color: #ffffff; }
body.tema-mercado a.mc-promo-amarilla { background: #fdecb2; color: #2b2410; }
body.tema-mercado a.mc-promo-durazno { background: #fde2d3; color: #3a1d10; }

.mc-opiniones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.mc-opinion { margin: 0; padding: 20px; border: 1px solid var(--tm-borde); border-radius: 12px; display: flex; flex-direction: column; gap: .6rem; }
.mc-estrellas { color: #d99a00; display: flex; gap: 2px; }
.mc-opinion blockquote { margin: 0; font-size: 1rem; line-height: 1.5; }
.mc-opinion figcaption { font-weight: 700; color: var(--tm-texto-suave); font-size: .88rem; }
.mc-inicio > .mc-contenedor:last-child { padding-bottom: 56px; }

/* Tarjeta de producto */
.mc-card { position: relative; height: 100%; display: flex; flex-direction: column; background: #ffffff; border: 1px solid var(--tm-borde); border-radius: 12px; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.mc-card:hover { border-color: var(--tm-primario); box-shadow: 0 10px 24px rgba(10, 111, 181, .14); }
.mc-card-imagen { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / .95; background: var(--tm-suave); }
.mc-card-imagen img { width: 100%; height: 100%; object-fit: cover; }
.mc-card-dto { position: absolute; top: 0; right: 0; width: 52px; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--tm-primario); color: var(--tm-primario-texto); font-size: .82rem; font-weight: 800; line-height: 1.05; border-bottom-left-radius: 12px; }
.mc-card-dto small { font-size: .62rem; }
.mc-card-cuerpo { flex: 1; display: flex; flex-direction: column; gap: .5rem; padding: 14px; }
body.tema-mercado .mc-card-nombre { margin: 0; font-size: .92rem; font-weight: 600; line-height: 1.35; min-height: 2.5em; }
.mc-card-nombre a { color: var(--tm-texto); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.tema-mercado .mc-card-nombre a { color: var(--tm-texto); }
.mc-card-precio { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.mc-card-precio span { font-size: 1.05rem; font-weight: 800; }
.mc-card-precio del { font-size: .8rem; color: #7b848d; }
.mc-card-extra { min-height: 28px; display: flex; align-items: center; border-top: 1px solid #eef0f3; padding-top: .45rem; }
.mc-card-ahorro { font-size: .85rem; font-weight: 700; color: var(--tm-exito); }
.mc-card-tipo { font-size: .8rem; color: var(--tm-texto-suave); }
.mc-card-acciones { margin-top: auto; display: flex; flex-direction: column; gap: .4rem; }
.mc-card-acciones form { margin: 0; }
.mc-boton, .mc-boton-secundario { width: 100%; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: 10px; font-weight: 700; font-size: .88rem; text-decoration: none; border: 0; }
body.tema-mercado .mc-boton { background: var(--tm-primario); color: var(--tm-primario-texto); }
body.tema-mercado .mc-boton:hover { filter: brightness(.92); color: var(--tm-primario-texto); }
body.tema-mercado .mc-boton-secundario { background: #ffffff; color: var(--tm-primario); border: 1px solid var(--tm-primario); }
body.tema-mercado .mc-boton-secundario:hover { background: #eef4fa; }

/* Pie */
body.tema-mercado footer.mc-pie { margin-top: 0; background: var(--tm-primario); color: var(--tm-primario-texto); padding: 48px 0 20px; }
.mc-pie-columnas { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; }
.mc-pie-nombre { display: block; font-size: 1.4rem; font-weight: 800; margin-bottom: .75rem; }
.mc-pie-marca p { margin: 0 0 .5rem; font-size: .92rem; opacity: .92; }
.mc-pie-col { display: flex; flex-direction: column; gap: .55rem; font-size: .92rem; }
.mc-pie-titulo { font-weight: 800; padding-bottom: .5rem; border-bottom: 1px solid rgba(255,255,255,.35); margin-bottom: .25rem; }
body.tema-mercado .mc-pie a { color: var(--tm-primario-texto); text-decoration: none; }
body.tema-mercado .mc-pie a:hover { text-decoration: underline; }
.mc-pie-redes { display: flex; gap: 1rem; font-size: 1.3rem; margin-top: .75rem; }
.mc-pie-legal { border-top: 1px solid rgba(255,255,255,.35); margin-top: 32px; padding-top: 16px; text-align: center; font-size: .85rem; opacity: .9; }

/* Coherencia en el resto de páginas (ficha, carrito, checkout, perfil) */
body.tema-mercado .btn-primary { --bs-btn-bg: var(--tm-primario); --bs-btn-border-color: var(--tm-primario); --bs-btn-hover-bg: var(--tm-oscuro); --bs-btn-hover-border-color: var(--tm-oscuro); --bs-btn-color: var(--tm-primario-texto); --bs-btn-active-bg: var(--tm-oscuro); border-radius: 10px; font-weight: 700; }
body.tema-mercado .btn-outline-primary { --bs-btn-color: var(--tm-primario); --bs-btn-border-color: var(--tm-primario); --bs-btn-hover-bg: var(--tm-primario); --bs-btn-hover-border-color: var(--tm-primario); border-radius: 10px; }
body.tema-mercado .btn-success { border-radius: 10px; font-weight: 700; }
body.tema-mercado .page-link { color: var(--tm-primario); }
body.tema-mercado .active > .page-link, body.tema-mercado .page-link.active { background: var(--tm-primario); border-color: var(--tm-primario); color: var(--tm-primario-texto); }
body.tema-mercado .card { border-radius: 12px; border-color: var(--tm-borde); }
body.tema-mercado .form-control:focus, body.tema-mercado .form-select:focus { border-color: var(--tm-primario); box-shadow: 0 0 0 .2rem rgba(10, 111, 181, .2); }
body.tema-mercado .nav-tabs .nav-link.active { color: var(--tm-primario); font-weight: 700; }
body.tema-mercado .product-card, body.tema-mercado .row > .col > .mc-card { height: 100%; }

/* Responsive */
@media (max-width: 1199.98px) {
    .mc-grilla-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .mc-circulos { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .mc-accion .tm-icono-texto { display: none; }
}
@media (max-width: 991.98px) {
    .mc-header-fila { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "menu logo acciones" "buscador buscador buscador"; gap: .6rem 1rem; min-height: 0; padding-top: .6rem; padding-bottom: .75rem; }
    .mc-menu-boton { display: inline-flex; align-items: center; justify-content: center; grid-area: menu; }
    .mc-logo { grid-area: logo; justify-content: center; }
    .mc-logo .tm-logo-nombre { font-size: 1.1rem; }
    .mc-acciones { grid-area: acciones; gap: 0; }
    .mc-buscador { grid-area: buscador; height: 44px; }
    .mc-buscador .tm-buscador-boton { display: none; }
    .mc-categorias { display: none; }
    .mc-topbar-der .mc-topbar-item:not(:first-child) { display: none; }
    .mc-grilla-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mc-circulos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .mc-promos { grid-template-columns: minmax(0, 1fr); }
    .mc-opiniones { grid-template-columns: minmax(0, 1fr); }
    .mc-slide { padding: 28px; min-height: 260px; }
    .mc-slide-imagen { width: 36%; height: 200px; }
    .mc-hero-flecha { display: none; }
    .mc-hero-puntos { left: 28px; }
    .mc-pie-columnas { grid-template-columns: 1fr 1fr; }
    .mc-pie-marca { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
    .mc-contenedor { padding: 0 14px; }
    .mc-topbar-fila { min-height: 34px; font-size: .78rem; }
    .mc-topbar-der .mc-topbar-item { display: none; }
    .mc-grilla-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .mc-circulos { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .mc-circulo { font-size: .78rem; }
    .mc-slide { flex-direction: column; align-items: flex-start; padding: 24px 22px 44px; }
    .mc-slide-imagen { width: 100%; max-width: none; height: 170px; order: -1; }
    .mc-hero-puntos { left: 22px; bottom: 16px; }
    .mc-promo { min-height: 150px; }
    .mc-promo img { height: 120px; }
    .mc-card-cuerpo { padding: 10px; }
    .mc-pie-columnas { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .mc-seccion { margin-top: 36px; }
}
