/* ============================================================
   Carta publica tipo tienda en linea (products.html)
   Buscador con sugerencias, filtros laterales (cajon en celular),
   orden, vista cuadricula/lista, etiquetas de filtros activos,
   tarjetas con precio grande y vista rapida con pedido por WhatsApp.
   Usa las variables de landing.css (--lp-*), que siguen al tema.
   ============================================================ */

/* ---------- Cabecera con buscador ---------- */
.tn-cabecera {
    position: relative;
    padding: 34px 0 26px;
    color: #fff;
    background:
        radial-gradient(ellipse 50% 90% at 100% 0, color-mix(in srgb, var(--lp-acento) 30%, transparent) 0, transparent 70%),
        linear-gradient(120deg, var(--lp-oscuro), var(--lp-primario));
}

.tn-migas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, .75);
    margin-bottom: 8px;
}

.tn-migas a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.tn-migas a:hover { color: #fff; text-decoration: underline; }
.tn-migas i { font-size: 9px; opacity: .7; }
.tn-migas span { color: #fff; font-weight: 600; }

.tn-cabecera h1 {
    font-family: var(--lp-fuente);
    font-weight: 800;
    font-size: clamp(24px, 3.4vw, 36px);
    color: #fff;
    margin: 0 0 18px;
    letter-spacing: -.01em;
}

.tn-buscador {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 760px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}

.tn-buscador > i {
    position: absolute;
    left: 18px;
    color: #9a8b80;
    font-size: 16px;
    pointer-events: none;
}

.tn-buscador input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 54px;
    border: 0;
    background: transparent;
    padding: 0 14px 0 48px;
    font-family: var(--lp-fuente);
    font-size: 16px;
    color: var(--lp-texto);
    outline: none;
}

.tn-buscador button[type="submit"] {
    flex: 0 0 auto;
    height: 44px;
    margin-right: 5px;
    padding: 0 22px;
    border: 0;
    border-radius: 10px;
    background: var(--lp-primario);
    color: #fff;
    font-family: var(--lp-fuente);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s ease;
}

.tn-buscador button[type="submit"]:hover { background: var(--lp-primario-hover); }

/* Sugerencias del buscador */
.tn-sugerencias {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 50;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, .2);
    overflow: hidden;
    color: var(--lp-texto);
}

.tn-sugerencias a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--lp-texto);
    border-bottom: 1px solid var(--lp-borde);
}

.tn-sugerencias a:last-child { border-bottom: 0; }

.tn-sugerencias a:hover,
.tn-sugerencias a.enfocada {
    background: color-mix(in srgb, var(--lp-primario) 8%, #fff);
    text-decoration: none;
}

.tn-sug-img {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--lp-primario) 10%, #fff);
    color: var(--lp-primario);
}

.tn-sug-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tn-sug-texto { flex: 1 1 auto; min-width: 0; }
.tn-sug-texto b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-sug-texto b mark { background: transparent; color: var(--lp-primario); padding: 0; }
.tn-sug-texto small { color: var(--lp-texto-suave); font-size: 12px; }
.tn-sug-precio { font-weight: 700; color: var(--lp-primario); font-size: 14px; }

.tn-sug-todos {
    justify-content: center;
    color: var(--lp-primario) !important;
    font-weight: 600;
    font-size: 14px;
}

.tn-sug-vacio { padding: 14px 16px; color: var(--lp-texto-suave); font-size: 14px; }

/* Chips de categoria */
.tn-chips {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.tn-chips::-webkit-scrollbar { display: none; }

.tn-chips a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}

.tn-chips a:hover { background: rgba(255, 255, 255, .25); text-decoration: none; color: #fff; }

.tn-chips a.activo {
    background: #fff;
    color: var(--lp-primario);
    border-color: #fff;
    font-weight: 600;
}

/* ---------- Cuerpo: filtros + resultados ---------- */
.tn-cuerpo {
    padding: 30px 0 70px;
    background: var(--lp-fondo-alterno);
}

.tn-grid-principal {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 26px;
    align-items: start;
}

.tn-filtros {
    position: sticky;
    top: calc(var(--lp-alto-header) + 14px);
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--lp-borde);
    padding: 18px;
}

.tn-filtros-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.tn-filtros-cabecera h2 {
    font-family: var(--lp-fuente);
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}

.tn-filtros-cabecera h2 i { color: var(--lp-primario); }

.tn-cerrar {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: var(--lp-fondo-alterno);
    color: var(--lp-texto);
    cursor: pointer;
}

.tn-filtro { padding: 14px 0; border-top: 1px solid var(--lp-borde); }
.tn-filtro:first-of-type { border-top: 0; }

.tn-filtro h3 {
    font-family: var(--lp-fuente);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--lp-texto-suave);
    margin: 0 0 10px;
}

.tn-filtro ul { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 2px; }

.tn-filtro li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    color: var(--lp-texto);
    font-size: 14px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.tn-filtro li a i { width: 16px; color: var(--lp-texto-suave); }
.tn-filtro li a span { margin-left: auto; color: var(--lp-texto-suave); font-size: 12px; }
.tn-filtro li a:hover { background: var(--lp-fondo-alterno); text-decoration: none; color: var(--lp-texto); }

.tn-filtro li a.activo {
    background: color-mix(in srgb, var(--lp-primario) 10%, #fff);
    color: var(--lp-primario);
    font-weight: 600;
}

.tn-filtro li a.activo i,
.tn-filtro li a.activo span { color: var(--lp-primario); }

.tn-precio {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tn-precio input {
    flex: 1 1 0;
    min-width: 0;
    height: 38px;
    border: 1px solid var(--lp-borde);
    border-radius: 10px;
    padding: 0 8px;
    font-size: 14px;
}

.tn-precio input:focus { outline: none; border-color: var(--lp-primario); }

.tn-precio button {
    flex: 0 0 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: var(--lp-primario);
    color: #fff;
    cursor: pointer;
}

.tn-fondo-filtros { display: none; }

/* Barra superior de resultados */
.tn-barra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.tn-barra-info { display: flex; align-items: center; gap: 12px; }
.tn-barra-info strong { font-size: 15px; color: var(--lp-texto); }

.tn-boton-filtros {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--lp-borde);
    background: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.tn-boton-filtros i { color: var(--lp-primario); }

.tn-barra-acciones { display: flex; align-items: center; gap: 14px; }

.tn-orden { display: flex; align-items: center; gap: 8px; margin: 0; }
.tn-orden label { margin: 0; font-size: 14px; color: var(--lp-texto-suave); font-weight: 500; white-space: nowrap; }

.tn-orden select {
    height: 38px;
    border: 1px solid var(--lp-borde);
    border-radius: 10px;
    padding: 0 30px 0 12px;
    background: #fff;
    font-family: var(--lp-fuente);
    font-size: 14px;
    font-weight: 600;
    color: var(--lp-texto);
    cursor: pointer;
}

.tn-vistas {
    display: flex;
    border: 1px solid var(--lp-borde);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.tn-vistas button {
    width: 38px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--lp-texto-suave);
    cursor: pointer;
}

.tn-vistas button.activo { background: var(--lp-primario); color: #fff; }

/* Filtros activos */
.tn-activos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.tn-etiqueta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--lp-borde);
    color: var(--lp-texto);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.tn-etiqueta i { color: var(--lp-texto-suave); font-size: 11px; }
.tn-etiqueta:hover { border-color: var(--lp-primario); color: var(--lp-primario); text-decoration: none; }
.tn-etiqueta:hover i { color: var(--lp-primario); }
.tn-limpiar { font-size: 13px; font-weight: 600; color: var(--lp-primario); }

/* ---------- Tarjetas ---------- */
.tn-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}

.tn-producto {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--lp-borde);
    overflow: hidden;
    cursor: pointer;
    outline: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.tn-producto:hover,
.tn-producto:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(31, 26, 23, .14);
}

.tn-producto:focus-visible { box-shadow: 0 0 0 3px var(--lp-acento); }

.tn-producto-img {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--lp-acento) 18%, transparent) 0, transparent 60%),
        color-mix(in srgb, var(--lp-primario) 8%, #fff);
    color: var(--lp-primario);
    font-size: 52px;
    border-bottom: 1px solid var(--lp-borde);
}

.tn-producto-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 14px;
    background: #fff;
    transition: transform .3s ease;
}

.tn-producto:hover .tn-producto-img img { transform: scale(1.05); }

.tn-sello {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #6b7280;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.tn-producto.agotado .tn-producto-img { filter: grayscale(1); opacity: .7; }

.tn-producto-cuerpo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px 6px;
    flex: 1 1 auto;
}

.tn-producto-cuerpo small {
    color: var(--lp-texto-suave);
    font-size: 12px;
    font-weight: 500;
}

.tn-producto-cuerpo h3 {
    font-family: var(--lp-fuente);
    font-size: 15px;
    font-weight: 600;
    color: var(--lp-texto);
    line-height: 1.3;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tn-descripcion {
    display: none;                     /* solo en vista de lista */
    color: var(--lp-texto-suave);
    font-size: 13px;
    margin: 0 0 6px;
}

.tn-precio-grande {
    font-family: var(--lp-fuente);
    font-size: 24px;
    font-weight: 700;
    color: var(--lp-texto);
    line-height: 1.1;
}

.tn-estado {
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
}

.tn-estado.no { color: #6b7280; }

.tn-ver {
    display: block;
    margin: 6px 16px 14px;
    color: var(--lp-primario);
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
}

.tn-producto:hover .tn-ver,
.tn-producto:focus-visible .tn-ver { opacity: 1; transform: none; }

/* Vista de lista */
.tn-productos.tn-lista { grid-template-columns: 1fr; gap: 12px; }
.tn-lista .tn-producto { flex-direction: row; align-items: stretch; }
.tn-lista .tn-producto-img { flex: 0 0 160px; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--lp-borde); font-size: 42px; }
.tn-lista .tn-producto-cuerpo { padding: 16px 18px; justify-content: center; }
.tn-lista .tn-descripcion { display: block; }
.tn-lista .tn-ver { align-self: center; opacity: 1; transform: none; margin: 0 20px; white-space: nowrap; }

/* Paginacion */
.tn-paginacion {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
}

.tn-paginacion a,
.tn-paginacion span {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    color: var(--lp-texto);
    background: #fff;
    border: 1px solid var(--lp-borde);
}

.tn-paginacion a:hover { border-color: var(--lp-primario); color: var(--lp-primario); text-decoration: none; }
.tn-paginacion .actual { background: var(--lp-primario); border-color: var(--lp-primario); color: #fff; }

/* Estado vacio */
.tn-vacio {
    text-align: center;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--lp-borde);
    padding: 40px 24px;
}

.tn-vacio > i {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--lp-primario);
    background: color-mix(in srgb, var(--lp-primario) 10%, #fff);
    margin-bottom: 14px;
}

.tn-vacio h2 {
    font-family: var(--lp-fuente);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.tn-vacio ul {
    list-style: none;
    padding: 0;
    margin: 0 auto 20px;
    max-width: 420px;
    color: var(--lp-texto-suave);
    font-size: 14px;
    display: grid;
    gap: 4px;
}

.tn-subtitulo {
    font-family: var(--lp-fuente);
    font-size: 20px;
    font-weight: 700;
    margin: 34px 0 14px;
}

/* ---------- Vista rapida ---------- */
.tn-modal {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tn-modal[hidden] { display: none; }

.tn-modal-fondo {
    position: absolute;
    inset: 0;
    background: rgba(15, 10, 8, .6);
    backdrop-filter: blur(3px);
    animation: tn-aparecer .2s ease;
}

.tn-modal-caja {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 820px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 40px 90px rgba(0, 0, 0, .35);
    animation: tn-subir .28s cubic-bezier(.2, .8, .2, 1);
}

@keyframes tn-aparecer { from { opacity: 0; } }
@keyframes tn-subir { from { opacity: 0; transform: translateY(24px) scale(.98); } }

.tn-modal-cerrar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.tn-modal-img {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--lp-acento) 20%, transparent) 0, transparent 60%),
        color-mix(in srgb, var(--lp-primario) 8%, #fff);
    color: var(--lp-primario);
    font-size: 90px;
}

.tn-modal-img img { width: 100%; height: 100%; max-height: 460px; object-fit: contain; background: #fff; padding: 20px; }

.tn-modal-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 34px 30px 28px;
}

.tn-modal-info small { color: var(--lp-primario); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }

.tn-modal-info h2 {
    font-family: var(--lp-fuente);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.tn-modal-info p { color: var(--lp-texto-suave); font-size: 15px; margin: 0; }
.tn-modal-info .tn-precio-grande { font-size: 32px; margin-top: 6px; }

.tn-cantidad {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 6px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--lp-fondo-alterno);
    font-size: 14px;
    font-weight: 600;
}

.tn-cantidad > div { display: flex; align-items: center; gap: 4px; }

.tn-cantidad button {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--lp-borde);
    background: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.tn-cantidad button:hover { border-color: var(--lp-primario); color: var(--lp-primario); }
.tn-cantidad output { min-width: 34px; text-align: center; font-size: 16px; }
.tn-cantidad b { color: var(--lp-primario); font-size: 16px; }

/* Datos opcionales del pedido por WhatsApp */
.tn-pedido-datos {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}

.tn-entrega {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tn-entrega label { margin: 0; cursor: pointer; }
.tn-entrega input { position: absolute; opacity: 0; pointer-events: none; }

.tn-entrega span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--lp-borde);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--lp-texto-suave);
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.tn-entrega input:checked + span {
    border-color: var(--lp-primario);
    background: color-mix(in srgb, var(--lp-primario) 9%, #fff);
    color: var(--lp-primario);
}

.tn-entrega input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lp-primario) 30%, transparent); }

.tn-pedido-datos input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid var(--lp-borde);
    font-size: 14px;
    background: #fff;
    outline: none;
}

.tn-pedido-datos input[type="text"]:focus { border-color: var(--lp-primario); }

.tn-btn-whatsapp {
    background: #25d366;
    color: #fff !important;
    padding: 13px 20px;
    font-size: 16px;
    box-shadow: 0 10px 24px rgba(37, 211, 102, .35);
}

.tn-btn-whatsapp:hover { background: #1ebe5a; }

.tn-btn-whatsapp.deshabilitado {
    background: #9ca3af;
    box-shadow: none;
    pointer-events: none;
}

.tn-seguir {
    border: 0;
    background: transparent;
    color: var(--lp-texto-suave);
    font-weight: 600;
    font-size: 14px;
    padding: 8px;
    cursor: pointer;
}

.tn-seguir:hover { color: var(--lp-primario); }

body.tn-sin-scroll { overflow: hidden; }

/* ---------- Responsivo ---------- */
@media (max-width: 991.98px) {
    .tn-grid-principal { grid-template-columns: 1fr; }

    /* Filtros como cajon deslizable desde la izquierda */
    .tn-filtros {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1055;
        width: min(320px, 86vw);
        border-radius: 0 20px 20px 0;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .3s ease;
    }

    .tn-filtros-abiertos .tn-filtros { transform: none; }

    .tn-fondo-filtros {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(15, 10, 8, .5);
        opacity: 0;
        pointer-events: none;
        transition: opacity .3s ease;
    }

    .tn-filtros-abiertos .tn-fondo-filtros { opacity: 1; pointer-events: auto; }
    .tn-cerrar { display: inline-flex; align-items: center; justify-content: center; }
    .tn-boton-filtros { display: inline-flex; }
}

@media (max-width: 575.98px) {
    .tn-buscador input[type="search"] { height: 48px; font-size: 15px; }
    .tn-buscador button[type="submit"] { padding: 0 14px; height: 38px; }
    .tn-productos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .tn-producto-cuerpo { padding: 10px 12px 4px; }
    .tn-precio-grande { font-size: 20px; }
    .tn-orden label { display: none; }
    .tn-lista .tn-producto-img { flex-basis: 110px; }
    .tn-lista .tn-ver { display: none; }
    .tn-modal-caja { grid-template-columns: 1fr; }
    .tn-modal-img { min-height: 220px; font-size: 70px; }
    .tn-modal-info { padding: 22px 20px; }
}
