/*
 * Tienda pública de los tenants (marca blanca). Los colores de cada tienda llegan como
 * variables CSS (--t-pri, --t-pri-txt, --t-sec) desde views/partials/tienda_head.hbs.
 * Todo con prefijo "t-" para no chocar con Bootstrap.
 */
:root {
    --t-fondo: #f6f7f9;
    --t-borde: #e6e8ec;
    --t-texto: #1d2129;
    --t-muted: #6b7280;
    --t-radio: 12px;
}

.t-body {
    background: var(--t-fondo);
    color: var(--t-texto);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.t-body main { flex: 1; }
.t-muted { color: var(--t-muted); }

.t-previa {
    background: #fff3cd; color: #664d03; text-align: center;
    font-size: .8rem; padding: .35rem 1rem; border-bottom: 1px solid #ffe69c;
}

/* ---------- Encabezado ---------- */
.t-header { background: #fff; border-bottom: 1px solid var(--t-borde); position: sticky; top: 0; z-index: 20; }
.t-header-fila { display: flex; align-items: center; gap: 1rem; padding: .75rem 12px; flex-wrap: wrap; }
.t-marca { display: flex; align-items: center; text-decoration: none; color: var(--t-texto); min-width: 0; }
.t-marca img { max-height: 48px; max-width: 200px; object-fit: contain; }
.t-marca span { font-weight: 800; font-size: 1.25rem; color: var(--t-pri); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }

.t-buscar { flex: 1 1 260px; display: flex; min-width: 0; order: 3; }
@media (min-width: 768px) { .t-buscar { order: 0; } }
.t-buscar input {
    flex: 1; min-width: 0; border: 1px solid var(--t-borde); border-right: 0;
    border-radius: 999px 0 0 999px; padding: .55rem 1rem; outline: none;
}
.t-buscar input:focus { border-color: var(--t-pri); }
.t-buscar button {
    border: 0; background: var(--t-pri); color: var(--t-pri-txt);
    border-radius: 0 999px 999px 0; padding: 0 1.1rem;
}

.t-btn-wa {
    align-items: center; gap: .4rem; text-decoration: none; font-weight: 600;
    background: #25d366; color: #fff; border-radius: 999px; padding: .5rem 1rem; white-space: nowrap;
}

/* Categorías: botón + panel desplegable a todo el ancho. */
.t-nav { background: var(--t-sec); }
.t-nav-fila { display: flex; align-items: center; gap: .25rem; }
.t-cats { position: static; }
.t-cats > summary, .t-nav-link {
    display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .8rem; color: #fff;
    font-size: .9rem; font-weight: 700; cursor: pointer; list-style: none; text-decoration: none; white-space: nowrap;
}
.t-cats > summary::-webkit-details-marker { display: none; }
.t-cats > summary:hover, .t-nav-link:hover, .t-cats[open] > summary { background: rgba(255, 255, 255, .14); color: #fff; }
.t-cats-panel {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff;
    border-bottom: 1px solid var(--t-borde); box-shadow: 0 16px 30px rgba(0, 0, 0, .08);
    max-height: 70vh; overflow-y: auto; padding: 1.25rem 0;
}
.t-cats-grilla { columns: 4 200px; column-gap: 2rem; }
.t-cats-grupo { break-inside: avoid; margin-bottom: 1rem; }
.t-cats-padre { font-weight: 800; color: var(--t-texto); text-decoration: none; font-size: .92rem; }
.t-cats-padre:hover { color: var(--t-pri); }
.t-cats-grupo ul { list-style: none; margin: .3rem 0 0; padding: 0; }
.t-cats-grupo li a { display: block; padding: .15rem 0; color: var(--t-muted); text-decoration: none; font-size: .86rem; }
.t-cats-grupo li a:hover { color: var(--t-pri); }
.t-header { position: sticky; }  /* el panel se ubica respecto del encabezado */

/* ---------- Secciones ---------- */
.t-seccion { padding-top: 1.5rem; padding-bottom: 2.5rem; }
.t-seccion-titulo { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; gap: 1rem; }
.t-seccion-titulo h2 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.t-seccion-titulo a { color: var(--t-pri); text-decoration: none; font-weight: 600; white-space: nowrap; }

.t-hero { background: var(--t-pri); color: var(--t-pri-txt); padding: 3rem 0; text-align: center; }
.t-hero h1 { font-weight: 800; font-size: clamp(1.6rem, 4vw, 2.6rem); }
.t-hero .t-btn { background: #fff; color: var(--t-texto); }

.t-banners img { max-height: 420px; object-fit: cover; }
.t-banner-texto { background: rgba(0, 0, 0, .35); border-radius: 10px; padding: .75rem 1rem; }

.t-btn {
    display: inline-flex; align-items: center; gap: .45rem; border: 0; text-decoration: none;
    background: var(--t-pri); color: var(--t-pri-txt); font-weight: 700;
    padding: .7rem 1.3rem; border-radius: 999px;
}
.t-btn:hover { filter: brightness(.95); color: var(--t-pri-txt); }
.t-btn-secundario { background: #fff; color: var(--t-texto); border: 1px solid var(--t-borde); }
.t-btn-secundario:hover { color: var(--t-texto); }
.t-btn-wa-grande { background: #25d366; color: #fff; }
.t-btn-wa-grande:hover { color: #fff; }

/* ---------- Grilla y tarjetas ---------- */
.t-grilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 768px) { .t-grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } }
@media (min-width: 1200px) { .t-grilla { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.t-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid var(--t-borde);
    border-radius: var(--t-radio); overflow: hidden; text-decoration: none; color: var(--t-texto);
    transition: box-shadow .15s ease, transform .15s ease;
}
.t-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .07); transform: translateY(-2px); color: var(--t-texto); }
.t-card-img { aspect-ratio: 1 / 1; background: #fff; display: flex; align-items: center; justify-content: center; padding: .75rem; }
.t-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.t-card-cuerpo { padding: .75rem .9rem .9rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; border-top: 1px solid var(--t-borde); }
.t-card-marca { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--t-muted); font-weight: 700; }
.t-card-nombre {
    font-size: .9rem; font-weight: 600; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.t-card-pie { margin-top: auto; display: flex; flex-direction: column; gap: .25rem; }
.t-precio { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.t-consultar { font-weight: 700; color: var(--t-pri); }

.t-stock { display: inline-block; font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; width: fit-content; }
.t-stock-ok { background: #e7f6ec; color: #137333; border: 1px solid #c6ead2; }
.t-stock-bajo { background: #fff4e5; color: #9a5b00; border: 1px solid #ffe0b2; }

.t-sin-foto { color: #c4c8cf; font-size: 2.5rem; }
.t-sin-foto.grande { font-size: 5rem; }

/* ---------- Catálogo ---------- */
.t-migas { font-size: .85rem; color: var(--t-muted); margin-bottom: .75rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.t-migas a { color: var(--t-muted); text-decoration: none; }
.t-migas a:hover { color: var(--t-pri); }
.t-catalogo-cabecera { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.t-catalogo-cabecera h1 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.t-orden { display: flex; align-items: center; gap: .5rem; }
.t-orden select { border: 1px solid var(--t-borde); border-radius: 8px; padding: .4rem .6rem; background: #fff; }

.t-paginas { display: flex; justify-content: center; gap: .35rem; margin-top: 2rem; flex-wrap: wrap; }
.t-paginas a {
    min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; background: #fff; border: 1px solid var(--t-borde); color: var(--t-texto); text-decoration: none; font-weight: 600;
}
.t-paginas a.actual { background: var(--t-pri); color: var(--t-pri-txt); border-color: var(--t-pri); }

.t-aviso-busqueda {
    display: flex; gap: .6rem; align-items: flex-start;
    background: #fff; border: 1px solid var(--t-borde); border-left: 4px solid var(--t-pri);
    border-radius: var(--t-radio); padding: .75rem 1rem; margin-bottom: 1.25rem; color: var(--t-texto);
}
.t-aviso-busqueda i { color: var(--t-pri); font-size: 1.1rem; line-height: 1.4; }

.t-vacio { text-align: center; padding: 3rem 1rem; color: var(--t-muted); }
.t-vacio i { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.t-vacio h1 { font-size: 1.4rem; color: var(--t-texto); }

/* ---------- Ficha ---------- */
.t-ficha-foto {
    background: #fff; border: 1px solid var(--t-borde); border-radius: var(--t-radio);
    aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.t-ficha-foto img { max-width: 100%; max-height: 100%; object-fit: contain; }
.t-ficha-miniaturas { display: flex; gap: .5rem; margin-top: .75rem; overflow-x: auto; }
.t-ficha-miniaturas button { flex: 0 0 70px; height: 70px; border: 2px solid var(--t-borde); border-radius: 10px; background: #fff; padding: 4px; }
.t-ficha-miniaturas button.activa { border-color: var(--t-pri); }
.t-ficha-miniaturas img { width: 100%; height: 100%; object-fit: contain; }
.t-ficha-nombre { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 800; margin: .25rem 0; }
.t-ficha-precio { font-size: 2rem; font-weight: 800; margin: 1rem 0 .5rem; font-variant-numeric: tabular-nums; }
.t-ficha-acciones { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.5rem; max-width: 420px; }
.t-ficha-acciones .t-btn { justify-content: center; }
.t-ficha-descripcion { background: #fff; border: 1px solid var(--t-borde); border-radius: var(--t-radio); padding: 1.25rem; margin-top: 2rem; }
.t-ficha-descripcion h2 { font-size: 1.15rem; font-weight: 800; }
.t-descripcion { overflow-wrap: anywhere; }
.t-descripcion img, .t-descripcion table { max-width: 100%; height: auto; }
.t-descripcion .table-responsive { overflow-x: auto; }
/* Renglones de combos y links "INFO": el mismo tratamiento que la ficha de SuperSistemas. */
.t-descripcion [align=left] { display: flex; align-items: center; gap: 15px; margin: 7px 0; }
.t-descripcion .t-desc-info {
    background: var(--t-pri); color: var(--t-pri-txt); padding: 2px 10px; border-radius: 2rem;
    font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.t-descripcion-ccs { width: 100%; margin-top: 1rem; border-radius: 8px; overflow: hidden; }
.t-descripcion-ccs iframe { width: 100%; min-height: 750px; border: 0; display: block; }

/* ---------- Pie ---------- */
.t-footer { background: #fff; border-top: 1px solid var(--t-borde); padding: 2rem 0 1rem; font-size: .9rem; }
.t-footer a { color: var(--t-texto); text-decoration: none; }
.t-footer a:hover { color: var(--t-pri); }
.t-footer-nombre { font-weight: 800; font-size: 1.1rem; margin-bottom: .5rem; color: var(--t-pri); }
.t-footer-titulo { font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .05em; color: var(--t-muted); margin-bottom: .5rem; }
.t-footer-copy { border-top: 1px solid var(--t-borde); margin-top: 1.5rem; padding-top: 1rem; color: var(--t-muted); font-size: .8rem;
    display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
/* Sello de la plataforma. Neutro a propósito (tinta sobre el fondo del pie, sin el color del dueño)
   para que no compita con la marca de la tienda. Isotipo a 24 px: el mínimo del manual de mihard. */
.t-footer .t-hecho-con { display: inline-flex; align-items: center; gap: .45rem; color: var(--t-muted); font-weight: 600; }
.t-footer .t-hecho-con:hover { color: var(--t-texto); }
.t-hecho-con img { width: 24px; height: 24px; }
/* El botón flotante de WhatsApp (fijo abajo a la derecha, 56 px) tapaba el sello al llegar al
   final de la página: con ese botón, el pie deja lugar abajo. */
.t-footer.t-footer-con-wa { padding-bottom: 5.5rem; }
@media (max-width: 575.98px) { .t-footer-copy { justify-content: center; text-align: center; } }

.t-wa-flotante {
    position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 50%;
    background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); z-index: 40; text-decoration: none;
}
.t-wa-flotante:hover { color: #fff; }

/* ---------- Venta online (carrito, checkout, pedido, cuenta) ---------- */
.t-header-acciones { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
@media (min-width: 768px) { .t-header-acciones { margin-left: 0; } }
.t-icono {
    position: relative; width: 42px; height: 42px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; color: var(--t-texto); font-size: 1.3rem; text-decoration: none;
}
.t-icono:hover { background: var(--t-fondo); color: var(--t-pri); }
.t-contador {
    position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--t-pri); color: var(--t-pri-txt); font-size: .7rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.t-titulo-pagina { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.t-subtitulo { font-size: 1.05rem; font-weight: 800; margin-bottom: .75rem; }
.t-caja { background: #fff; border: 1px solid var(--t-borde); border-radius: var(--t-radio); padding: 1.25rem; margin-bottom: 1rem; }
.t-alerta { background: #eef4ff; color: #1d3f7a; border: 1px solid #d3e2ff; border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; }
.t-alerta-error { background: #fdecea; color: #a4262c; border-color: #f5c2c0; }
.t-alerta-ok { background: #e7f6ec; color: #137333; border-color: #c6ead2; }
.t-angosto { max-width: 760px; }
.t-angosto-form { max-width: 460px; }

.t-linea { display: flex; align-items: center; gap: .9rem; padding: .75rem 0; border-bottom: 1px solid var(--t-borde); }
.t-linea:last-child { border-bottom: 0; }
.t-linea-foto { width: 72px; height: 72px; flex-shrink: 0; border: 1px solid var(--t-borde); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #c4c8cf; background: #fff; }
.t-linea-foto img { max-width: 100%; max-height: 100%; object-fit: contain; }
.t-linea-info { flex: 1; min-width: 0; }
.t-linea-nombre { font-weight: 600; color: var(--t-texto); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-linea-cant { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; }
.t-linea-cant input { width: 70px; border: 1px solid var(--t-borde); border-radius: 8px; padding: .3rem .5rem; }
.t-quitar { border: 0; background: none; color: var(--t-muted); padding: .3rem .5rem; border-radius: 8px; }
.t-quitar:hover { color: #c62828; background: #fdecea; }
.t-linea-subtotal { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

.t-resumen { position: sticky; top: 140px; }
.t-resumen-item { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; padding: .3rem 0; }
.t-resumen-item span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-resumen-fila { display: flex; justify-content: space-between; align-items: baseline; margin: .5rem 0 1rem; font-size: 1.1rem; }
.t-resumen-total { border-top: 1px solid var(--t-borde); padding-top: .75rem; }
.t-resumen-fila strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.t-seguir { display: block; text-align: center; margin-top: .75rem; color: var(--t-muted); text-decoration: none; }
.t-seguir:hover { color: var(--t-pri); }

.t-opciones { display: flex; flex-direction: column; gap: .5rem; }
.t-opcion { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--t-borde); border-radius: 10px; padding: .7rem .9rem; cursor: pointer; }
.t-opcion:has(input:checked) { border-color: var(--t-pri); background: #f8fbff; }
.t-opcion input { accent-color: var(--t-pri); }

.t-exito { font-size: 3rem; color: #1a9e57; }
.t-datos-banco { background: var(--t-fondo); border-radius: 10px; padding: .9rem 1rem; white-space: pre-wrap; font-family: inherit; font-size: 1rem; margin: 0 0 .75rem; }

.t-pedido-fila { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--t-borde); color: var(--t-texto); text-decoration: none; }
.t-pedido-fila:last-child { border-bottom: 0; }
.t-pedido-fila .t-precio { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 1rem; }

.t-agregar { display: flex; gap: .6rem; flex-wrap: wrap; }
.t-agregar .t-btn { flex: 1 1 200px; justify-content: center; }
.t-cantidad { display: flex; border: 1px solid var(--t-borde); border-radius: 999px; overflow: hidden; background: #fff; }
.t-cantidad button { border: 0; background: none; width: 40px; font-size: 1.2rem; }
.t-cantidad input { width: 48px; border: 0; text-align: center; -moz-appearance: textfield; }
.t-cantidad input::-webkit-outer-spin-button, .t-cantidad input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.t-agregado { color: #137333; font-weight: 600; }
.t-agregado a { color: var(--t-pri); }
.t-stock-pedido { background: #eef4ff; color: #1d4ed8; border: 1px solid #d3e2ff; }

/* ---------- Páginas institucionales y arrepentimiento (paso 12) ---------- */
.t-legal { max-width: 820px; }
.t-legal h2 { font-size: 1.1rem; font-weight: 800; margin: 1.4rem 0 .5rem; }
.t-legal p, .t-legal li { line-height: 1.6; }
.t-legal-otras { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; max-width: 820px; }
.t-legal-otras a { color: var(--t-pri); text-decoration: none; font-weight: 600; }
.t-footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem; margin-top: 1.25rem; font-size: .85rem; }
.t-footer-legal a { color: inherit; }
.t-btn-arrep { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid currentColor; border-radius: 999px; padding: .35rem .9rem; font-weight: 700; text-decoration: none; }
.t-arrep { max-width: 820px; }
.t-arrep-ok { text-align: center; padding: 2rem 1.25rem; }
.t-arrep-ok > i { font-size: 2.5rem; color: #137333; display: block; margin-bottom: .5rem; }
.t-arrep-codigo { font-size: 2rem; font-weight: 800; letter-spacing: .06em; margin: .25rem 0 .75rem; font-variant-numeric: tabular-nums; }
.t-arrep-trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
