/* ==========================================================================
   css/comercio.css  ·  Página de un comercio (comercio.php / php/indexComercio.php)
   Se carga después de styles.css y reutiliza sus variables y estas clases:
   .portada-titulo (títulos), .tarjeta, .estrellas, .mapa-card, .btn-portada,
   .opiniones/.op-* (carrusel de comentarios) y el keyframe "marquee".

   ÍNDICE
   1. Variables y caja        6. Galería y ventana ampliada
   2. Aparecer al hacer scroll 7. Contacto, horario y mapa
   3. Flyer                    8. Servicios básicos
   4. Destacados               9. Comentarios
   5. Servicios y productos   10. Otros negocios y logos que corren
   ========================================================================== */


/* ---------- 1. Variables y caja ---------- */
:root {
    --favorito: #e63946;                    /* corazón de favoritos y mensajes de error */
    --lightbox-fondo: rgba(10, 15, 25, 0.93);
    --cm-max: 1500px;                       /* ancho máximo del contenido */
    --cm-espacio: 70px;                     /* separación entre secciones */
}

.cm-caja {
    width: var(--portada-ancho);            /* 90% */
    max-width: var(--cm-max);
    margin: 0 auto;
    padding: 30px 0 50px;
}

.cm-seccion {
    margin-top: var(--cm-espacio);
}


/* ---------- 2. Aparecer al hacer scroll (el JS quita estas clases al terminar) ---------- */
.cm-js .cm-sube {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: var(--retraso, 0s);
}

.cm-js .cm-sube.visible {
    opacity: 1;
    transform: none;
}


/* ---------- 3. Flyer ---------- */
.cm-flyer {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 20px;
    background: var(--gray);
    box-shadow: 0 14px 40px var(--card-sombra-hover);
}

.cm-flyer-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.cm-flyer-slide.activo {
    opacity: 1;
}

.cm-flyer-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cm-flyer-velo {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to top, var(--card-velo), transparent 45%),
        linear-gradient(to bottom, var(--card-velo), transparent 22%);
}

/* Logo y nombre sobre la imagen */
.cm-flyer-info {
    position: absolute;
    left: 28px;
    bottom: 26px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: calc(100% - 120px);
    color: var(--white);
}

.cm-flyer-logo {
    flex: none;
    width: clamp(60px, 9vw, 120px);
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 50%;
    border: 4px solid var(--white);
    background: var(--white);
    box-shadow: 0 6px 18px var(--shadow-md);
}

.cm-flyer-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cm-flyer-info h1 {
    font-size: clamp(1.3rem, 3.6vw, 2.8rem);
    line-height: 1.1;
    text-shadow: 0 2px 12px var(--shadow-md);
}

/* Corazón de favoritos */
.cm-favorito {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--primary-blue);
    background: var(--white);
    box-shadow: 0 6px 16px var(--shadow-md);
    transition: transform 0.25s ease, color 0.25s ease;
}

.cm-favorito:hover {
    transform: scale(1.12);
}

.cm-favorito.activo {
    color: var(--favorito);
}

.cm-favorito:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Flechas y puntos del flyer */
.cm-flecha {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    color: var(--white);
    background: var(--card-velo);
    transform: translateY(-50%);
    transition: var(--transition-fast);
}

.cm-flecha:hover {
    background: var(--primary-dark-orange);
}

.cm-flyer-prev { left: 16px; }
.cm-flyer-next { right: 16px; }

.cm-puntos {
    position: absolute;
    right: 24px;
    bottom: 22px;
    z-index: 3;
    display: flex;
    gap: 8px;
}

.cm-punto {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: var(--white-a50);
    transition: var(--transition-fast);
}

.cm-punto.activo {
    width: 28px;
    border-radius: 6px;
    background: var(--gold);
}

.cm-flecha:focus-visible,
.cm-punto:focus-visible,
.cm-favorito:focus-visible {
    outline: 3px solid var(--primary-orange);
    outline-offset: 2px;
}

/* Datos rápidos y descripción bajo el flyer */
.cm-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}

.cm-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-dark);
    background: var(--white);
    box-shadow: 0 4px 12px var(--card-sombra);
}

.cm-chip i {
    color: var(--primary-dark-orange);
}

.cm-chip .estrellas {
    font-size: 0.85rem;
}

.cm-intro {
    max-width: 900px;
    margin: 22px auto 0;
    text-align: center;
    font-size: 1.08rem;
    line-height: 1.8;
    color: var(--texto-suave);
}


/* ---------- 4. Lo más destacado (2 por renglón, 1 en pantallas chicas) ---------- */
.cm-destacados {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

.cm-destacado {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 10px 30px var(--card-sombra);
}

.cm-destacado.invertido .cm-destacado-img {
    order: 2;               /* la segunda lleva la foto a la derecha */
}

.cm-destacado:last-child:nth-child(odd) {
    grid-column: 1 / -1;    /* si queda una sola, ocupa todo el renglón */
}

.cm-destacado-img {
    min-height: 260px;
    background: var(--gray);
}

.cm-destacado-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cm-destacado-texto {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 28px;
}

.cm-destacado-texto h3 {
    font-size: 1.3rem;
    color: var(--primary-dark-orange);
}

.cm-destacado-texto p {
    line-height: 1.7;
    color: var(--texto-suave);
}


/* ---------- 5. Servicios y productos (4 por renglón) ---------- */
.cm-tarjetas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.cm-tarjetas .tarjeta {
    display: flex;
    flex-direction: column;
    width: auto;
    margin-right: 0;
}

.cm-tarjetas .tarjeta-cuerpo {
    padding-top: 18px;
}

/* La descripción se recorta a 2 renglones */
.cm-tarjetas .tarjeta-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cm-precio {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-top: auto;
}

.cm-precio-ahora {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark-orange);
}

.cm-precio-antes {
    font-size: 0.95rem;
    text-decoration: line-through;
    color: var(--texto-suave);
}

/* Tarjeta de producto / servicio (php/elementoTarjetaArticulo.php) */
:root { --oro-oscuro: #b8922f; --oro-oscuro-fuerte: #9c7a1e; }

.art-tarjeta .tarjeta-cuerpo { display: flex; flex-direction: column; flex: 1; }

.art-precio {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;          /* precio del lado derecho */
    align-items: baseline;
    gap: 4px 10px;
    margin: auto 0 0;
    padding-top: 10px;
}

.art-precio-ahora {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--oro-oscuro);
    white-space: nowrap;
}

.art-precio-antes {
    font-size: 0.92rem;
    text-decoration: line-through;
    color: var(--texto-suave);
    white-space: nowrap;
}

.art-mxn {
    font-size: 0.62em;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Etiqueta de promoción sobre la foto */
.art-promo {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--white);
    background: var(--oro-oscuro);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

.art-promo i { font-size: 0.8em; }

.cm-vermas {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.cm-vermas a {
    font-weight: 600;
    text-decoration: none;
    color: var(--primary-dark-orange);
}

.cm-vermas a:hover {
    text-decoration: underline;
}


/* ---------- 6. Galería (6 por renglón) y ventana ampliada ---------- */
.cm-galeria {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.cm-galeria-item {
    position: relative;
    aspect-ratio: 16 / 10;   /* rectangular, más ancha que alta */
    padding: 0;
    border: 0;
    overflow: hidden;
    border-radius: 14px;
    cursor: pointer;
    background: var(--gray);
    box-shadow: 0 6px 16px var(--card-sombra);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Al pasar el cursor, la foto se levanta un poco */
.cm-galeria-item:hover,
.cm-galeria-item:focus-visible {
    transform: translateY(-8px);
    box-shadow: 0 18px 32px var(--card-sombra-hover);
}

.cm-galeria-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cm-galeria-item:hover img {
    transform: scale(1.08);
}

.cm-galeria-lupa {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    color: var(--white);
    background: var(--card-velo);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cm-galeria-item:hover .cm-galeria-lupa,
.cm-galeria-item:focus-visible .cm-galeria-lupa {
    opacity: 1;
}

.cm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: var(--lightbox-fondo);
}

.cm-lightbox[hidden] {
    display: none;
}

.cm-lightbox figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: min(88vw, 1400px);
    margin: 0;
}

.cm-lightbox figure img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    animation: cmZoom 0.3s ease;
}

.cm-lightbox-contador {
    font-size: 0.9rem;
    color: var(--white);
}

.cm-lightbox-cerrar,
.cm-lightbox-flecha {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--white);
    background: var(--white-a50);
    transition: var(--transition-fast);
}

.cm-lightbox-cerrar:hover,
.cm-lightbox-flecha:hover {
    background: var(--primary-dark-orange);
}

.cm-lightbox-cerrar {
    position: absolute;
    top: 18px;
    right: 18px;
}

@keyframes cmZoom {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: none; }
}


/* ---------- 6b. Galería de videos (3 por renglón, 1 en celular) ---------- */
.cm-videos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.cm-video {
    overflow: hidden;
    border-radius: 16px;
    background: var(--black);
    box-shadow: 0 10px 26px var(--card-sombra-hover);
}

.cm-video video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: var(--black);
}

@media (max-width: 900px) {
    .cm-videos { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .cm-videos { grid-template-columns: 1fr; }
}


/* ---------- 7. Contacto · mapa · horario (3 contenedores) ---------- */
.cm-contacto {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 24px;
}

/* Contenedor: borde redondeado y fondo distinto al de la página */
.cm-panel {
    flex: 1 1 300px;
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--gray-line);
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 8px 24px var(--card-sombra);
}

.cm-panel-mapa {
    flex: 1.7 1 440px;                      /* el mapa es la parte más ancha */
}

.cm-panel h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 1.15rem;
    color: var(--text-dark);
}

.cm-panel h3 i {
    color: var(--primary-dark-orange);
}

/* Datos de contacto (izquierda) */
.cm-dato {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    text-decoration: none;
    color: var(--text-dark);
    border-bottom: 1px dashed var(--gray-line);
}

.cm-dato:last-child {
    border-bottom: 0;
}

a.cm-dato:hover strong {
    color: var(--primary-dark-orange);
}

.cm-dato-icono {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.2rem;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-dark-orange));
}

.cm-dato small {
    display: block;
    color: var(--texto-suave);
}

.cm-dato strong {
    overflow-wrap: anywhere;
}

/* Mapa y dirección (centro) */
.cm-panel-mapa .mapa-card {
    max-width: none;
    border-radius: 14px;
    box-shadow: none;
}

.cm-panel-mapa .mapa-card iframe {
    height: 380px;
}

/* "Cómo llegar" centrado debajo del mapa */
.cm-panel-mapa > .btn-portada {
    display: flex;
    width: max-content;
    max-width: 100%;
    margin: 14px auto 0;
}

.cm-direccion {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0;
    line-height: 1.5;
    color: var(--text-dark);
}

.cm-direccion i {
    margin-top: 3px;
    color: var(--primary-dark-orange);
}

/* Horario (derecha) */
.cm-horario li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    font-size: 0.95rem;
    border-bottom: 1px dashed var(--gray-line);
}

.cm-horario li:last-child {
    border-bottom: 0;
}

/* Pantallas medianas: el mapa ocupa todo el ancho, pero el orden se mantiene: contacto · ubicación · horario */
@media (max-width: 1100px) {
    .cm-panel-mapa {
        flex-basis: 100%;
    }
}

/* El horario quebrado (varios turnos) se alinea a la derecha, uno debajo del otro */
.cm-horario li strong {
    text-align: right;
}


/* ---------- 8. Servicios básicos ---------- */
.cm-basicos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
}

.cm-basico {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 160px;
    padding: 22px 14px;
    text-align: center;
    font-weight: 600;
    color: var(--text-dark);
    border-radius: var(--card-radio);
    background: var(--white);
    box-shadow: 0 6px 18px var(--card-sombra);
}

.cm-basico img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

/* Ícono de Font Awesome del servicio (tabla serviciosbasicos, columna iconoserviciobasico) */
.cm-basico > i {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--primary-orange, #d27d2d);
    background: #fff4e8;
}


/* ---------- 9. Comentarios (1/3 formulario · 2/3 carrusel) ---------- */
.cm-promedio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 28px;
}

.cm-promedio-num {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary-dark-orange);
}

.cm-promedio .estrellas {
    font-size: 1.3rem;
}

.cm-promedio small {
    color: var(--texto-suave);
}

.cm-comentarios-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 28px;
    align-items: stretch;
}

.cm-lista {
    min-width: 0;           /* evita que el carrusel ensanche la columna */
}

.cm-formulario {
    padding: 28px 24px;
    border-top: 4px solid var(--gold);
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 10px 30px var(--card-sombra);
}

.cm-formulario h3 {
    margin-bottom: 6px;
    font-size: 1.3rem;
    color: var(--text-dark);
}

.cm-formulario-nombre {
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: var(--texto-suave);
}

.cm-formulario input[type="text"],
.cm-formulario textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 14px;
    font: inherit;
    border: 1px solid var(--gray-line);
    border-radius: 12px;
    background: var(--white);
    resize: vertical;
}

.cm-formulario input[type="text"]:focus,
.cm-formulario textarea:focus {
    outline: 3px solid var(--primary-orange);
    outline-offset: 1px;
}

.cm-estrellas-pick {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 14px;
}

.cm-estrella {
    padding: 2px;
    border: 0;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--gray-line);
    background: none;
    transition: transform 0.2s ease;
}

.cm-estrella:hover {
    transform: scale(1.2);
}

.cm-estrella.activo {
    color: var(--gold);
}

.cm-contador {
    margin-bottom: 14px;
    text-align: right;
    font-size: 0.8rem;
    color: var(--texto-suave);
}

.cm-mensaje {
    margin-top: 12px;
    font-size: 0.92rem;
}

.cm-mensaje.ok    { color: var(--primary-dark-orange); }
.cm-mensaje.error { color: var(--favorito); }

.cm-nota {
    display: block;
    margin-top: 14px;
    color: var(--texto-suave);
}

/* Botón "Enviar" del comentario: a la derecha */
.cm-enviar {
    display: flex;
    justify-content: flex-end;
}

.cm-enviar .btn-portada {
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Sin sesión: "Iniciar sesión" y "Crear cuenta" en el mismo renglón, mitad y mitad */
.cm-invitacion-botones {
    display: flex;
    gap: 10px;
    width: 100%;
}

.cm-invitacion-botones .btn-portada {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
}

.cm-invitacion {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.cm-invitacion > i {
    font-size: 2.6rem;
    color: var(--primary-orange);
}

.cm-invitacion p {
    line-height: 1.6;
    color: var(--texto-suave);
}

/* Carrusel de comentarios: dentro de 2/3 de ancho y con tarjetas más altas */
.cm-comentarios .opiniones {
    --op-w: 34%;
    --op-w-min: 220px;
    --op-w-max: 340px;
    padding-top: 0;
}

.cm-comentarios .op-card {
    min-height: 400px;
}


/* ---------- 10. Otros negocios (banner) y logos que corren ---------- */
.cm-banners {
    display: grid;
    gap: 28px;
}

.cm-banner {
    position: relative;
    display: block;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    text-decoration: none;
    color: var(--white);
    border-radius: 20px;
    background: var(--gray);
    box-shadow: 0 14px 40px var(--card-sombra-hover);
}

.cm-banner > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.cm-banner:hover > img {
    transform: scale(1.06);
}

/* Encima de la foto: arriba "Visita y conoce" y el nombre; abajo a la izquierda el logo circular */
.cm-banner-velo {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: clamp(16px, 3vw, 34px);
    background: linear-gradient(180deg, var(--card-velo), transparent 45%, transparent 60%, var(--card-velo));
}

.cm-banner-texto {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-shadow: 0 2px 12px var(--shadow-md);
}

.cm-banner-texto small {
    font-size: clamp(0.85rem, 1.6vw, 1.15rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
}

.cm-banner-texto strong {
    font-size: clamp(1.3rem, 3.4vw, 2.6rem);
    line-height: 1.1;
}

.cm-banner-logo {
    flex: none;
    width: clamp(70px, 10vw, 150px);
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 50%;
    border: 4px solid var(--white);
    background: var(--white);
    box-shadow: 0 8px 22px var(--shadow-md);
}

.cm-banner-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* "También te puede interesar": los logos que corren están en styles.css (.logos), igual que en la portada */


/* ---------- Tablet y móvil ---------- */
@media (max-width: 1000px) {
    .cm-destacados { grid-template-columns: 1fr; }
    .cm-galeria { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    .cm-comentarios-grid { grid-template-columns: 1fr; }
    .cm-comentarios-grid .cm-lista { order: -1; }   /* en celular: primero el carrusel y después el formulario */
}

@media (max-width: 800px) {
    .cm-tarjetas { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 768px) {
    :root {
        --cm-espacio: 46px;
    }

    .cm-caja { width: var(--portada-ancho-movil); padding-top: 20px; padding-bottom: 36px; }
    .cm-flyer-info { left: 16px; bottom: 16px; gap: 12px; }
    .cm-favorito { top: 12px; right: 12px; width: 44px; height: 44px; }
    .cm-flecha { width: 38px; height: 38px; }
    .cm-puntos { right: 16px; bottom: 14px; }
    .cm-banner { aspect-ratio: 16 / 9; }
    .cm-lightbox { padding: 10px; gap: 8px; }
    .cm-lightbox-flecha { width: 40px; height: 40px; }
}

@media (max-width: 700px) {
    .cm-galeria { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

@media (max-width: 640px) {
    /* Lo más destacado: foto arriba y texto abajo */
    .cm-destacado { grid-template-columns: 1fr; }
    .cm-destacado.invertido .cm-destacado-img { order: 0; }
    .cm-destacado-img { min-height: 210px; }
}

@media (max-width: 560px) {
    /* Servicios y productos: 2 por renglón también en celular (4 en PC) */
    .cm-tarjetas { gap: 12px; }
    .cm-tarjetas .tarjeta-cuerpo { padding: 12px; }
    .cm-tarjetas .tarjeta-cuerpo h3 { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
    .cm-js .cm-sube { opacity: 1; transform: none; transition: none; }
    .cm-flyer-slide { transition: none; }
}


/* =====================================================================
   Catálogo de un negocio (catalogo.php · php/indexCatalogo.php)
   ===================================================================== */
.cat-cabecera { padding: 22px 0 18px; background: var(--white); border-bottom: 1px solid var(--border-color); }
.cat-cabecera-caja { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; width: var(--portada-ancho, min(1200px, 92%)); margin: 0 auto; }
.cat-volver { color: var(--texto-suave); font-weight: 600; text-decoration: none; }
.cat-volver:hover { color: var(--primary-dark-orange); }
.cat-titulo { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.cat-titulo img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.cat-titulo h1 { margin: 0; font-size: 1.6rem; color: var(--text-dark); }
.cat-titulo p { margin: 0; color: var(--texto-suave); }
.cat-tipos { display: flex; gap: 8px; }
.cat-tipos a { padding: 9px 16px; border-radius: 999px; font-weight: 700; text-decoration: none; color: var(--text-dark); background: var(--fondo); }
.cat-tipos a.activo { color: var(--white); background: var(--primary-dark-orange); }

.cat-raiz { padding-top: 26px; }
.cat-aviso { padding: 12px 16px; border-radius: 12px; color: #92400e; background: #fef3c7; }

.cat-boton {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border: 0; border-radius: 12px; cursor: pointer;
    font: inherit; font-weight: 700; color: var(--white); background: var(--primary-dark-orange);
    transition: background 0.2s ease, transform 0.2s ease;
}
.cat-boton:hover:not(:disabled) { background: var(--oro-oscuro-fuerte, #7d6116); }
.cat-boton:disabled { cursor: not-allowed; color: #6b7280; background: #e5e7eb; }

/* Tarjeta grande */
.cat-detalle {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px;
    margin-bottom: 40px; padding: 22px; border-radius: 22px; background: var(--white);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.08);
}
.cat-galeria { display: grid; gap: 10px; align-content: start; min-width: 0; }
.cat-detalle-foto { position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; overflow: hidden; border-radius: 16px; aspect-ratio: 4 / 3; background: var(--gray); }
.cat-detalle-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-promo { top: 16px; right: 16px; font-size: 1.25rem; padding: 8px 16px; }
.cat-detalle-info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cat-detalle-info h2 { margin: 0; font-size: 1.8rem; color: var(--text-dark); overflow-wrap: anywhere; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.cat-chips a { padding: 5px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; text-decoration: none; color: var(--oro-oscuro); background: #f8f1df; }
.cat-chips a:hover { background: #efe2bd; }
.cat-detalle-precio { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0; }
.cat-detalle-precio .art-precio-ahora { font-size: 2rem; }
.cat-detalle-precio .art-precio-antes { font-size: 1.1rem; }
.cat-detalle-desc { line-height: 1.6; color: var(--texto-suave); overflow-wrap: anywhere; }

.cat-carrito { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-color); }
.cat-cantidad { display: inline-flex; align-items: center; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }
.cat-cantidad button { width: 40px; height: 44px; border: 0; cursor: pointer; color: var(--text-dark); background: var(--fondo); }
.cat-cantidad button:disabled { cursor: not-allowed; opacity: 0.5; }
.cat-cantidad input { width: 56px; height: 44px; border: 0; text-align: center; font: inherit; font-weight: 700; -moz-appearance: textfield; }
.cat-cantidad input::-webkit-outer-spin-button, .cat-cantidad input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cat-agregar { flex: 1 1 200px; padding: 13px 20px; }
.cat-carrito-aviso { flex: 1 1 100%; display: flex; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 0.88rem; color: #92400e; background: #fef3c7; }
.cat-carrito-aviso a { color: inherit; font-weight: 600; }
.cat-mensaje { flex: 1 1 100%; margin: 0; font-size: 0.9rem; font-weight: 600; }
.cat-mensaje:empty { display: none; }
.cat-mensaje.ok { color: #15803d; }
.cat-mensaje.error { color: var(--danger-dark); }
.cat-mensaje a { color: inherit; }

/* Lista */
.cat-lista-cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.cat-lista-cabecera h2 { margin: 0; font-size: 1.35rem; color: var(--text-dark); }
.cat-buscar { position: relative; display: flex; gap: 8px; flex: 0 1 460px; }
.cat-buscar > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--texto-suave); }
.cat-buscar input { flex: 1; min-width: 0; padding: 11px 14px 11px 38px; border: 1px solid var(--border-color); border-radius: 12px; font: inherit; }
.cat-buscar input:focus { outline: 2px solid var(--primary-orange); border-color: transparent; }

.cat-cuerpo.con-filtros { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: start; }
.cat-cuerpo.con-filtros .cat-tarjetas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cat-filtros { position: sticky; top: 110px; padding: 16px; border-radius: 16px; background: var(--white); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06); }
.cat-filtros summary { cursor: pointer; font-weight: 800; color: var(--text-dark); list-style: none; }
.cat-filtros summary::-webkit-details-marker { display: none; }
.cat-filtros h3 { margin: 16px 0 6px; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texto-suave); }
.cat-filtro { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 9px; font-size: 0.92rem; text-decoration: none; color: var(--text-dark); }
.cat-filtro small { color: var(--texto-suave); }
.cat-filtro.sub { padding-left: 22px; font-size: 0.86rem; }
.cat-filtro:hover { background: var(--fondo); }
.cat-filtro.activo { font-weight: 700; color: var(--white); background: var(--oro-oscuro); }
.cat-filtro.activo small { color: rgba(255, 255, 255, 0.85); }
.cat-filtros details > .cat-filtro:first-of-type { margin-top: 10px; }
.cat-conteo { margin: 0 0 14px; color: var(--texto-suave); }
.cat-conteo a { color: var(--primary-dark-orange); font-weight: 600; }

.cat-paginas { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.cat-paginas-rango { color: var(--texto-suave); font-size: 0.9rem; }
.cat-paginas-numeros { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pagina { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; font-weight: 700; text-decoration: none; color: var(--text-dark); background: var(--white); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
.cat-pagina:hover { color: var(--oro-oscuro); }
.cat-pagina.activa { color: var(--white); background: var(--oro-oscuro); }
.cat-pagina.puntos { box-shadow: none; background: transparent; }

.cat-fotos-num { position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; color: var(--white); background: rgba(17, 24, 39, 0.7); }
.cat-miniaturas { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.cat-miniatura { flex: none; width: 78px; height: 58px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--fondo); }
.cat-miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-miniatura:hover, .cat-miniatura.activa { border-color: var(--oro-oscuro); }

/* Visor de fotos en grande */
.cat-visor { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 20px; background: rgba(0, 0, 0, 0.9); }
.cat-visor[hidden] { display: none; }
.cat-visor figure { margin: 0; display: grid; justify-items: center; gap: 10px; max-width: min(1100px, 100%); }
.cat-visor img { max-width: 100%; max-height: calc(100dvh - 110px); border-radius: 10px; object-fit: contain; user-select: none; }
.cat-visor figcaption { color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.cat-visor-cerrar, .cat-visor-flecha { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer; font-size: 1.2rem; color: var(--white); background: rgba(255, 255, 255, 0.15); }
.cat-visor-cerrar { position: absolute; top: 16px; right: 16px; }
.cat-visor-cerrar:hover, .cat-visor-flecha:hover { background: var(--oro-oscuro); }
.cat-visor-flecha[hidden] { display: none; }

@media (max-width: 1000px) {
    .cat-cuerpo.con-filtros .cat-tarjetas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .cat-detalle { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 18px; }
    .cat-detalle-info h2 { font-size: 1.45rem; }
    .cat-cuerpo.con-filtros { grid-template-columns: minmax(0, 1fr); }
    .cat-filtros { position: static; }
    .cat-filtros details:not([open]) { padding: 0; }
    .cat-buscar { flex: 1 1 100%; }
}
@media (max-width: 560px) {
    .cat-cabecera-caja { width: calc(100% - 32px); }
    .art-promo { top: 8px; right: 8px; padding: 4px 8px; font-size: 0.82rem; }
    .art-precio-ahora { font-size: 1.05rem; }
    .cat-promo { font-size: 1.05rem; }
    .cat-paginas { justify-content: center; }
    .cat-visor { padding: 10px; gap: 6px; }
    .cat-visor-flecha { position: absolute; bottom: 24px; width: 44px; height: 44px; }
    .cat-visor-flecha.anterior { left: calc(50% - 60px); }
    .cat-visor-flecha.siguiente { right: calc(50% - 60px); }
    .cat-visor img { max-height: calc(100dvh - 160px); }
    .cat-miniatura { width: 64px; height: 48px; }
}
