/* ============================================================
   Ecommerce Basic V2 Theme — Custom CSS
   ============================================================ */

/* ---- Fuentes locales (Kanit self-hosted) ---- */
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/kanit/kanit-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/kanit/kanit-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/kanit/kanit-700-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/kanit/kanit-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Variables de paleta ---- */
:root {
    /* Marca */
    --tn-primary:        #175ea5;
    --tn-primary-dark:   #1250a0;
    --tn-primary-light:  #3d9ccc;
    --tn-secondary:      #333333;

    /* Funcionales */
    --tn-success:        #4bb98c;   /* precio transferencia / descuento */
    --tn-warning:        #dc8f38;   /* badges naranja / oferta */
    --tn-danger:         #dd7774;   /* badge oferta / error */
    --tn-transfer:       #4bb98c;   /* precio con descuento transferencia */

    /* Neutrales */
    --tn-bg:             #ffffff;
    --tn-bg-light:       #f5f5f5;
    --tn-bg-dark:        #2c2c2c;
    --tn-border:         #e5e5e5;
    --tn-text:           #333333;
    --tn-text-muted:     #666666;
    --tn-text-light:     #999999;

    /* Fuente */
    --tn-font-family:    'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --tn-font-size-base: 14px;
    --tn-line-height:    1.5;

    /* Espaciado */
    --tn-radius:         6px;
    --tn-radius-sm:      4px;
    --tn-radius-lg:      10px;

    /* Transiciones */
    --tn-transition:     0.2s ease;

    /* Topbar */
    --tn-topbar-bg:      var(--tn-primary);
    --tn-topbar-color:   #ffffff;
    --tn-topbar-height:  36px;

    /* Header */
    --tn-header-bg:      #ffffff;
    --tn-header-border:  var(--tn-border);
    --tn-header-height:  90px;

    /* Nav */
    --tn-nav-bg:         #ffffff;
    --tn-nav-color:      #333333;
    --tn-nav-hover-bg:   var(--tn-primary);

    /* Botones */
    --tn-btn-primary-bg:    var(--tn-primary);
    --tn-btn-primary-color: #ffffff;

    /* Cards */
    --tn-card-shadow:    0 1px 4px rgba(0,0,0,0.08);
    --tn-card-hover-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* ---- Reset base ---- */
*, *::before, *::after { box-sizing: border-box; }

/* Anular el border-radius:22px global de styles.min.css para inputs de formulario */
input.form-control,
input[type="text"].form-control,
input[type="number"].form-control,
input[type="email"].form-control,
input[type="password"].form-control,
input[type="search"].form-control,
textarea.form-control,
select.form-control {
    border-radius: var(--tn-radius) !important;
    height: calc(1.5em + .75rem + 2px) !important;
    cursor: text !important;
}
/* Qty específico del PDP */
.tn-pdp__qty {
    border-radius: 4px !important;
    height: 36px !important;
    cursor: text !important;
    text-align: center;
}

body {
    font-family: var(--tn-font-family);
    font-size: var(--tn-font-size-base);
    color: var(--tn-text);
    background-color: var(--tn-bg);
    line-height: var(--tn-line-height);
}

a { color: var(--tn-primary); }
a:hover { color: var(--tn-primary-dark); }

/* ---- Utilidades Bootstrap override ---- */
.btn-primary {
    background-color: var(--tn-btn-primary-bg);
    border-color: var(--tn-btn-primary-bg);
    color: var(--tn-btn-primary-color);
    font-family: var(--tn-font-family);
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: var(--tn-radius);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--tn-primary-dark);
    border-color: var(--tn-primary-dark);
}

.text-primary { color: var(--tn-primary) !important; }
.bg-primary   { background-color: var(--tn-primary) !important; }

/* ============================================================
   FASE 2 — Header, Nav, Footer, Offcanvas
   ============================================================ */

/* ---- Topbar promo ---- */
.tn-topbar {
    background: var(--tn-primary-dark);
    color: #fff;
    font-size: 13px;
    height: var(--tn-topbar-height);
    line-height: var(--tn-topbar-height);
}
.tn-topbar .container {
    height: 100%;
}
.tn-topbar__text { flex: 1; }
.tn-topbar__close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.tn-topbar__close:hover { color: #fff; }

/* ---- Header ---- */
.tn-header {
    background: var(--tn-header-bg);
    border-bottom: 1px solid var(--tn-header-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}
.tn-header__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--tn-header-height);
}

/* Logo */
.tn-header__logo {
    flex-shrink: 0;
    text-decoration: none;
}
.tn-header__logo-img {
    max-height: 60px;
    max-width: 200px;
    width: auto;
    display: block;
}
.tn-header__logo-text {
    font-family: var(--tn-font-family);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--tn-primary);
    text-decoration: none;
}

/* Buscador desktop */
.tn-header__search { flex: 1; max-width: 680px; }
.tn-header__search .tn-search-form { height: 46px; border-radius: 4px; }

/* Buscador mobile */
.tn-header__search-mobile {
    border-top: 1px solid var(--tn-border);
    padding-top: 8px;
}

/* Formulario de búsqueda (compartido desktop/mobile/offcanvas) */
.tn-search-form {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius);
    overflow: hidden;
    background: #fff;
    width: 100%;
}
.tn-search-form:focus-within {
    border-color: var(--tn-primary);
    box-shadow: 0 0 0 2px rgba(23,94,165,0.12);
}
.tn-search-form__input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 14px;
    font-family: var(--tn-font-family);
    font-size: 14px;
    color: var(--tn-text);
    background: transparent;
    min-width: 0;
}
.tn-search-form__input::placeholder { color: var(--tn-text-light); }
.tn-search-form__btn {
    background: var(--tn-primary) !important;
    border: none !important;
    color: #fff !important;
    padding: 0 18px !important;
    cursor: pointer;
    font-size: 15px;
    transition: background var(--tn-transition);
    flex-shrink: 0;
    border-radius: 0 !important;
    height: auto !important;
    line-height: normal !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}
.tn-search-form__btn:hover { background: var(--tn-primary-dark) !important; }

/* Acciones (carrito, cuenta) */
.tn-header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}
.tn-header__action { position: relative; }
.tn-header__action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--tn-text);
    text-decoration: none;
    font-size: 13px;
    border-radius: var(--tn-radius);
    transition: color var(--tn-transition), background var(--tn-transition);
}
.tn-header__action-btn:hover {
    color: var(--tn-primary);
    background: var(--tn-bg-light);
    text-decoration: none;
}
.tn-header__action-btn .fa { font-size: 20px; }
.tn-header__action-label { font-size: 13px; line-height: 1; }

/* Carrito */
.tn-cart-btn__icon { position: relative; }
.tn-cart-btn__count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--tn-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
}
.tn-cart-btn__total {
    font-size: 12px;
    color: var(--tn-primary);
    font-weight: 700;
}

/* Hamburguesa */
.tn-header__hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}
.tn-header__hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--tn-text);
    border-radius: 2px;
    transition: var(--tn-transition);
}

/* ---- Nav desktop ---- */
.tn-nav {
    background: var(--tn-nav-bg);
    border-bottom: 1px solid var(--tn-border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.tn-nav__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}
.tn-nav__item { position: relative; }
.tn-nav__link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    color: var(--tn-nav-color);
    font-family: var(--tn-font-family);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--tn-transition);
    white-space: nowrap;
}
.tn-nav__link:hover,
.tn-nav__item--has-dropdown:hover > .tn-nav__link {
    background: var(--tn-nav-hover-bg);
    color: #fff;
    text-decoration: none;
}
.tn-nav__arrow { font-size: 11px; margin-top: 1px; }

/* Dropdown nav */
.tn-nav__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--tn-border);
    border-top: 2px solid var(--tn-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 999;
    border-radius: 0 0 var(--tn-radius) var(--tn-radius);
}
.tn-nav__item--has-dropdown:hover .tn-nav__dropdown { display: block; }
.tn-nav__dropdown-item { }
.tn-nav__dropdown-link {
    display: block;
    padding: 9px 16px;
    color: var(--tn-text);
    font-size: 13px;
    text-decoration: none;
    transition: background var(--tn-transition), color var(--tn-transition);
}
.tn-nav__dropdown-link:hover {
    background: var(--tn-bg-light);
    color: var(--tn-primary);
    text-decoration: none;
}

/* ---- Offcanvas mobile ---- */
.tn-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tn-offcanvas.is-open { transform: translateX(0); }
.tn-offcanvas-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
}
.tn-offcanvas-backdrop.is-visible { display: block; }

.tn-offcanvas__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--tn-border);
    background: var(--tn-primary);
    flex-shrink: 0;
}
.tn-offcanvas__title { color: #fff; font-weight: 700; font-size: 15px; }
.tn-offcanvas__close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.tn-offcanvas__close:hover { color: #fff; }

.tn-offcanvas__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.tn-offcanvas__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tn-offcanvas__item { border-bottom: 1px solid var(--tn-border); }
.tn-offcanvas__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    color: var(--tn-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.tn-offcanvas__link:hover { color: var(--tn-primary); text-decoration: none; }
.tn-offcanvas__sub-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tn-text-muted);
    padding: 4px;
    font-size: 14px;
    transition: transform var(--tn-transition);
}
.tn-offcanvas__item--has-sub.is-open .tn-offcanvas__sub-toggle {
    transform: rotate(180deg);
}
.tn-offcanvas__submenu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0 0 8px 12px;
}
.tn-offcanvas__item--has-sub.is-open .tn-offcanvas__submenu { display: block; }
.tn-offcanvas__sublink {
    display: block;
    padding: 8px 4px;
    color: var(--tn-text-muted);
    font-size: 13px;
    text-decoration: none;
}
.tn-offcanvas__sublink:hover { color: var(--tn-primary); text-decoration: none; }

.tn-offcanvas__auth .btn { font-size: 13px; }

/* ---- Footer ---- */
.tn-footer {
    background: var(--tn-bg-dark);
    color: #ccc;
    font-size: 13px;
    margin-top: 48px;
}
.tn-footer__main { padding: 48px 0 24px; }
.tn-footer__heading {
    color: #fff;
    font-family: var(--tn-font-family);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.tn-footer__brand-name {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}
.tn-footer__logo {
    max-height: 48px;
    max-width: 160px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1); /* logo blanco sobre fondo oscuro */
    opacity: 0.9;
}
.tn-footer__desc { color: #aaa; line-height: 1.6; margin-bottom: 0; }

/* Redes sociales */
.tn-footer__social { display: flex; gap: 12px; }
.tn-footer__social-link {
    color: #aaa;
    font-size: 22px;
    text-decoration: none;
    transition: color var(--tn-transition);
}
.tn-footer__social-link:hover { color: #fff; text-decoration: none; }

/* Listas footer */
.tn-footer__list { list-style: none; margin: 0; padding: 0; }
.tn-footer__list-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    color: #aaa;
}
.tn-footer__list-icon { color: var(--tn-primary-light); flex-shrink: 0; margin-top: 2px; }
.tn-footer__list-item a,
.tn-footer__list-link {
    color: #aaa;
    text-decoration: none;
    transition: color var(--tn-transition);
}
.tn-footer__list-item a:hover,
.tn-footer__list-link:hover { color: #fff; text-decoration: none; }

/* Barra inferior */
.tn-footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 16px 0;
}
.tn-footer__copy { color: #777; margin: 0; font-size: 12px; }
.tn-footer__payments { display: flex; align-items: center; gap: 8px; }
.tn-footer__payments-label { color: #777; font-size: 12px; }
.tn-footer__payment-icon { color: #888; font-size: 22px; transition: color var(--tn-transition); }
.tn-footer__payment-icon:hover { color: #ccc; }

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .tn-header__inner { height: 60px; }
}
@media (max-width: 767.98px) {
    .tn-footer__logo { filter: none; opacity: 1; }
}

/* ============================================================
   FASE 3 — Sections, Product Cards, Brands, Categories, Features Bar
   ============================================================ */

/* ---- Secciones generales ---- */
.tn-section { padding: 40px 0; }
.tn-section--brands { background: var(--tn-bg-light); }
.tn-section__title {
    font-family: var(--tn-font-family);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--tn-secondary);
    text-align: center;
    margin-bottom: 24px;
}
.tn-section__title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--tn-primary);
    margin: 8px auto 0;
    border-radius: 2px;
}

/* ---- Product Card ---- */
.tn-product-card {
    background: #fff;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-lg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow var(--tn-transition), transform var(--tn-transition);
}
.tn-product-card:hover {
    box-shadow: var(--tn-card-hover-shadow);
    transform: translateY(-2px);
}

/* Badges */
.tn-product-card__badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tn-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    line-height: 1.4;
    letter-spacing: 0.02em;
}
.tn-badge--discount { background: var(--tn-danger);  color: #fff; }
.tn-badge--promo    { background: var(--tn-warning);  color: #fff; }
.tn-badge--soon     { background: var(--tn-secondary); color: #fff; }

/* Imagen */
.tn-product-card__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 200px;
    background: #fafafa;
}
.tn-product-card__thumb-link { display: block; }
.tn-product-card__img {
    max-height: 180px;
    width: auto;
    display: block;
    margin: auto;
    transition: transform var(--tn-transition);
}
.tn-product-card:hover .tn-product-card__img { transform: scale(1.04); }

/* Body */
.tn-product-card__body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}
.tn-product-card__title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
}
.tn-product-card__title a { color: var(--tn-text); text-decoration: none; }
.tn-product-card__title a:hover { color: var(--tn-primary); }

.tn-product-card__price {
    font-size: 15px;
    font-weight: 700;
    color: var(--tn-primary);
    min-height: 20px;
}
/* Precio tachado (herencia del parent) */
.tn-product-card__price del { color: var(--tn-text-light); font-size: 12px; font-weight: 400; }
.tn-product-card__price ins { text-decoration: none; }

.tn-product-card__actions { margin-top: auto; }
.tn-product-card__btn { font-size: 13px; font-weight: 600; }

/* Input qty + botón en una sola línea, compactos y centrados */
.tn-product-card .ajax-form {
    display: flex;
    justify-content: center;
}
.tn-product-card .ajax-form .input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    height: 36px;
    width: auto !important;
}
.tn-product-card .ajax-form .form-control {
    flex: 0 0 70px !important;
    width: 70px !important;
    max-width: 70px !important;
    height: 36px !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
    border-radius: 4px 0 0 4px !important;
    margin: 0 !important;
    text-align: center;
}
.tn-product-card .ajax-form .input-group-append {
    display: flex !important;
    margin: 0 !important;
}
.tn-product-card .ajax-form .input-group-append .btn {
    height: 36px !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    border-radius: 0 4px 4px 0 !important;
    margin: 0 !important;
    line-height: 36px !important;
}

/* Swiper product */
.tn-products-swiper { padding-bottom: 36px !important; }
.tn-products-swiper .swiper-slide { height: auto; }
.tn-products-swiper .swiper-button-prev,
.tn-products-swiper .swiper-button-next {
    color: var(--tn-primary);
}
.tn-products-swiper .swiper-button-prev::after,
.tn-products-swiper .swiper-button-next::after { font-size: 18px; }
.tn-products-swiper .swiper-pagination-bullet-active { background: var(--tn-primary); }

/* ---- Brands carousel ---- */
.tn-brands-swiper { padding: 8px 0; }
.tn-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius);
    background: #fff;
    transition: border-color var(--tn-transition), box-shadow var(--tn-transition);
}
.tn-brand-logo:hover {
    border-color: var(--tn-primary);
    box-shadow: 0 2px 8px rgba(23,94,165,0.1);
}
.tn-brand-logo__img {
    max-height: 60px;
    width: auto;
    display: block;
    margin: auto;
    object-fit: contain;
    filter: grayscale(40%);
    transition: filter var(--tn-transition);
}
.tn-brand-logo:hover .tn-brand-logo__img { filter: grayscale(0); }

/* ---- Category cards ---- */
.tn-category-card {
    display: block;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-lg);
    overflow: hidden;
    text-decoration: none;
    background: #fff;
    transition: box-shadow var(--tn-transition), transform var(--tn-transition);
}
.tn-category-card:hover {
    box-shadow: var(--tn-card-hover-shadow);
    transform: translateY(-2px);
    text-decoration: none;
}
.tn-category-card__img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    background: var(--tn-bg-light);
    overflow: hidden;
}
.tn-category-card__img {
    max-height: 140px;
    width: auto;
    object-fit: contain;
    transition: transform var(--tn-transition);
}
.tn-category-card:hover .tn-category-card__img { transform: scale(1.05); }
.tn-category-card__body {
    padding: 14px 16px;
    border-top: 1px solid var(--tn-border);
}
.tn-category-card__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--tn-text);
    margin: 0 0 4px;
}
.tn-category-card__link {
    font-size: 12px;
    color: var(--tn-primary);
    font-weight: 600;
}

/* ---- Features bar ---- */
.tn-features-bar {
    background: var(--tn-primary);
    color: #fff;
    padding: 20px 0;
}
.tn-features-bar__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.tn-features-bar__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
}
.tn-features-bar__icon {
    font-size: 28px;
    opacity: 0.9;
    flex-shrink: 0;
}
.tn-features-bar__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tn-features-bar__title {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
}
.tn-features-bar__subtitle {
    font-size: 11px;
    opacity: 0.8;
}

/* Features bar responsive */
@media (max-width: 991.98px) {
    .tn-features-bar__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
    .tn-features-bar__grid { grid-template-columns: 1fr; }
    .tn-features-bar { padding: 16px 0; }
}

/* ============================================================
   FASE 4 — Shop, PDP, Product List Item, Cart Drawer, Toast
   ============================================================ */

/* ---- Shop toolbar ---- */
.tn-shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--tn-border);
    margin-bottom: 20px;
}
.tn-shop-toolbar__count { color: var(--tn-text-muted); font-size: 13px; }
.tn-shop-toolbar__right { display: flex; align-items: center; gap: 10px; }
.tn-shop-toolbar__sort {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}
.tn-shop-toolbar__sort label { margin: 0; color: var(--tn-text-muted); white-space: nowrap; }
.tn-shop-toolbar__select {
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-sm);
    padding: 5px 10px;
    font-size: 13px;
    color: var(--tn-text);
    background: #fff;
    cursor: pointer;
}
.tn-shop-toolbar__view-toggle { display: flex; gap: 4px; }
.tn-shop-toolbar__view-btn {
    background: none;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-sm);
    padding: 5px 9px;
    color: var(--tn-text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: color var(--tn-transition), background var(--tn-transition), border-color var(--tn-transition);
}
.tn-shop-toolbar__view-btn.is-active,
.tn-shop-toolbar__view-btn:hover {
    background: var(--tn-primary);
    border-color: var(--tn-primary);
    color: #fff;
}
.tn-shop-toolbar__filter-btn {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--tn-primary);
    color: #fff;
    border: none;
    border-radius: var(--tn-radius-sm);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
@media (max-width: 991.98px) {
    .tn-shop-toolbar__filter-btn { display: flex; }
}

/* ---- Shop layout ---- */
.tn-shop-sidebar {
    border-right: 1px solid var(--tn-border);
    padding-right: 20px;
}
.tn-filter-widget { margin-bottom: 24px; }
.tn-filter-widget__title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tn-secondary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--tn-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tn-filter-widget__title .fa { font-size: 11px; color: var(--tn-text-muted); }

/* ---- Product grid ---- */
.tn-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 1199.98px) { .tn-product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px)  { .tn-product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.tn-product-grid__item { display: flex; }
.tn-product-grid__item .tn-product-card { width: 100%; }

/* ---- Product list item ---- */
.tn-product-list { display: flex; flex-direction: column; gap: 12px; }
.tn-product-list-item {
    display: flex;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-lg);
    padding: 16px;
    align-items: flex-start;
    transition: box-shadow var(--tn-transition);
}
.tn-product-list-item:hover { box-shadow: var(--tn-card-hover-shadow); }
.tn-product-list-item__thumb {
    flex-shrink: 0;
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: var(--tn-radius);
    padding: 8px;
}
.tn-product-list-item__img { max-height: 100px; width: auto; object-fit: contain; }
.tn-product-list-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tn-product-list-item__title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}
.tn-product-list-item__title a { color: var(--tn-text); text-decoration: none; }
.tn-product-list-item__title a:hover { color: var(--tn-primary); }
.tn-product-list-item__sku { font-size: 12px; color: var(--tn-text-muted); }
.tn-product-list-item__desc { font-size: 13px; color: var(--tn-text-muted); line-height: 1.4; }
.tn-product-list-item__price {
    font-size: 16px;
    font-weight: 700;
    color: var(--tn-primary);
}
.tn-product-list-item__price del { color: var(--tn-text-light); font-size: 13px; font-weight: 400; }
.tn-product-list-item__actions { margin-top: 4px; }
@media (max-width: 575.98px) {
    .tn-product-list-item__thumb { width: 80px; }
    .tn-product-list-item__title { font-size: 14px; }
}

/* ---- PDP Gallery ---- */
.tn-gallery { display: flex; gap: 16px; }
.tn-gallery__thumbs {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tn-gallery__thumb-btn {
    border: 2px solid var(--tn-border);
    border-radius: var(--tn-radius-sm);
    padding: 4px;
    cursor: pointer;
    background: #fff;
    transition: border-color var(--tn-transition);
    overflow: hidden;
}
.tn-gallery__thumb-btn:hover,
.tn-gallery__thumb-btn.is-active { border-color: var(--tn-primary); }
.tn-gallery__thumb-img { width: 100%; display: block; object-fit: contain; }
.tn-gallery__main { flex: 1; min-width: 0; }
.tn-gallery__swiper { border: 1px solid var(--tn-border); border-radius: var(--tn-radius-lg); overflow: hidden; }
.tn-gallery__slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    min-height: 360px;
}
.tn-gallery__main-img {
    max-height: 360px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    cursor: zoom-in;
}
.tn-gallery__swiper .swiper-button-prev,
.tn-gallery__swiper .swiper-button-next { color: var(--tn-primary); }
.tn-gallery__swiper .swiper-button-prev::after,
.tn-gallery__swiper .swiper-button-next::after { font-size: 16px; }
@media (max-width: 575.98px) {
    .tn-gallery { flex-direction: column-reverse; }
    .tn-gallery__thumbs { flex-direction: row; width: 100%; overflow-x: auto; }
    .tn-gallery__thumb-btn { flex-shrink: 0; width: 60px; }
    .tn-gallery__slide { min-height: 260px; }
    .tn-gallery__main-img { max-height: 260px; }
}

/* ---- Cart Drawer ---- */
.tn-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.12);
}
.tn-cart-drawer.is-open { transform: translateX(0); }
.tn-cart-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1055;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.tn-cart-drawer-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.tn-cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tn-border);
    flex-shrink: 0;
    background: var(--tn-primary);
    color: #fff;
}
.tn-cart-drawer__title { font-weight: 700; font-size: 16px; }
.tn-cart-drawer__close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--tn-radius-sm);
    transition: color var(--tn-transition), background var(--tn-transition);
    line-height: 1;
}
.tn-cart-drawer__close:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.tn-cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.tn-cart-drawer__loading { text-align: center; padding: 32px 0; }

.tn-cart-drawer__footer {
    border-top: 1px solid var(--tn-border);
    padding: 16px 20px 20px;
    flex-shrink: 0;
    background: #fafafa;
}
.tn-cart-drawer__subtotal { font-size: 15px; }

/* Items dentro del drawer */
.tn-cart-drawer__items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tn-cart-drawer__item {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tn-border);
}
.tn-cart-drawer__item:last-child { border-bottom: none; padding-bottom: 0; }
.tn-cart-drawer__item-thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: #f5f5f5;
    border-radius: var(--tn-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tn-cart-drawer__item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.tn-cart-drawer__item-no-img { color: var(--tn-text-muted); font-size: 22px; }
.tn-cart-drawer__item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tn-cart-drawer__item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--tn-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tn-cart-drawer__item-variant { font-size: 11px; color: var(--tn-text-muted); }
.tn-cart-drawer__item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.tn-cart-drawer__item-qty { font-size: 12px; color: var(--tn-text-muted); }
.tn-cart-drawer__item-price { font-size: 13px; font-weight: 700; color: var(--tn-primary); }

/* ---- Toast ---- */
.tn-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1070;
    background: #fff;
    border: 1px solid var(--tn-border);
    border-left: 4px solid var(--tn-success);
    border-radius: var(--tn-radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    max-width: 320px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.tn-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.tn-toast__icon { color: var(--tn-success); font-size: 18px; flex-shrink: 0; }
.tn-toast__msg { font-size: 13px; color: var(--tn-text); line-height: 1.4; }

/* ---- WhatsApp floating ---- */
.tn-wa-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1060;
    width: 56px;
    height: 56px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.tn-wa-float:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.28);
    color: #fff;
    text-decoration: none;
}

/* ---- Cookie banner ---- */
.tn-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1055;
    background: var(--tn-secondary);
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
}
.tn-cookie-banner__text { flex: 1; min-width: 200px; }
.tn-cookie-banner__text a { color: #add8ff; }

/* ---- Transfer price ---- */
.tn-transfer-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 6px 10px;
    background: #f0faf4;
    border: 1px solid #c3e6cb;
    border-radius: var(--tn-radius-sm);
    font-size: 13px;
}
.tn-transfer-price__label { color: var(--tn-text-muted); }
.tn-transfer-price__amount { font-weight: 700; color: var(--tn-transfer); font-size: 15px; }
.tn-transfer-price__badge {
    background: var(--tn-transfer);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
}

@media (max-width: 575.98px) {
    .tn-cart-drawer { width: 100vw; }
    .tn-toast { right: 12px; left: 12px; max-width: none; }
}

/* ---- PDP — Tabs descripción / reseñas ---- */
.tn-pdp-tabs-wrap .nav-tabs .nav-link {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--tn-secondary);
    border-radius: 0;
    padding: 10px 16px;
    margin-bottom: -1px;
}
.tn-pdp-tabs-wrap .nav-tabs .nav-link.active {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--tn-primary);
    color: var(--tn-primary);
    font-weight: 700;
}
.tn-pdp-tabs-wrap .nav-tabs .nav-link:hover:not(.active) {
    color: var(--tn-primary);
    border-bottom-color: var(--tn-border);
}

/* ==========================================================================
   Filtros de /shop
   Movido desde partials/show_filter_categories.blade.php, donde estaba
   embebido en un partial que se incluye dos veces (sidebar + modal mobile).
   ========================================================================== */

/* Quitar un filtro de categoría. Es un <button>, no un <a>: ejecuta una
   acción, no navega. Se resetean los estilos de botón para que se vea igual. */
.btn-remove-cat-filter {
    padding: 0 0 0 5px;
    font-size: 1.1em;
    line-height: 1;
    color: var(--tn-red, #dd7774);
    vertical-align: middle;
    background: none;
    border: 0;
    cursor: pointer;
}

.btn-remove-cat-filter:hover,
.btn-remove-cat-filter:focus-visible {
    color: #c0392b;
}

/* El foco tiene que verse: se navega por teclado. */
.btn-remove-cat-filter:focus-visible,
.toggle-collapse:focus-visible {
    outline: 2px solid var(--tn-primary, #175ea5);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Mientras se recarga la grilla por AJAX (Fase 2). */
#shop-items[aria-busy="true"] {
    opacity: .55;
    pointer-events: none;
    transition: opacity .15s ease-in-out;
}

/* Fila del carrito con una peticion en vuelo: evita el doble click. */
.tn-row-busy .tn-qty-btn {
    pointer-events: none;
    opacity: .5;
}

#tn-cart-summary[aria-busy="true"] {
    opacity: .6;
    transition: opacity .15s ease-in-out;
}

/* ==========================================================================
   Esqueleto de carga del quickview
   ========================================================================== */
.tn-skel {
    background: linear-gradient(90deg, var(--tn-bg-light, #f5f5f5) 25%, #ebebeb 37%, var(--tn-bg-light, #f5f5f5) 63%);
    background-size: 400% 100%;
    animation: tn-skel-shimmer 1.4s ease infinite;
    border-radius: var(--tn-radius, 6px);
}

.tn-skel--img  { width: 100%; padding-top: 100%; }
.tn-skel--line { height: 14px; margin-bottom: 12px; }

@keyframes tn-skel-shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* Respeta a quien pidio menos animacion. */
@media (prefers-reduced-motion: reduce) {
    .tn-skel { animation: none; }
}

/* ==========================================================================
   Barra fija de compra (mobile, ficha de producto)
   En un PDP largo el boton de compra queda muy arriba: sin esto hay que
   scrollear de vuelta para comprar.
   ========================================================================== */
.tn-pdp-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    /* Respeta la barra de gestos del iPhone. */
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--tn-border, #e0e0e0);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
    transform: translateY(110%);
    transition: transform .2s ease-in-out;
}

.tn-pdp-sticky.is-visible { transform: translateY(0); }

.tn-pdp-sticky__info {
    flex: 1 1 auto;
    min-width: 0;          /* deja que el texto se recorte en vez de desbordar */
    line-height: 1.2;
}

.tn-pdp-sticky__name {
    display: block;
    font-size: 12px;
    color: var(--tn-secondary, #555);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tn-pdp-sticky__price {
    display: block;
    font-weight: 700;
    color: var(--tn-primary, #175ea5);
}

.tn-pdp-sticky__btn {
    flex: 0 0 auto;
    /* Objetivo tactil comodo. */
    min-height: 44px;
    padding: 0 20px;
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    .tn-pdp-sticky { transition: none; }
}

/* ==========================================================================
   Migas de pan
   ========================================================================== */
.tn-breadcrumbs { margin-bottom: 1rem; }

.tn-breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--tn-secondary, #555);
}

.tn-breadcrumbs__item + .tn-breadcrumbs__item::before {
    content: "›";
    margin-right: 6px;
    color: var(--tn-border, #e0e0e0);
}

.tn-breadcrumbs__item a { color: var(--tn-secondary, #555); }
.tn-breadcrumbs__item a:hover { color: var(--tn-primary, #175ea5); }

.tn-breadcrumbs__item [aria-current="page"] {
    color: var(--tn-primary, #175ea5);
    font-weight: 600;
}

/* Titulo de la tienda: presente para lectores de pantalla y SEO, discreto. */
.tn-shop-heading {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--tn-primary, #175ea5);
}

/* ==========================================================================
   Hero de la home
   Se alimenta del setting `home_hero_slides` (JSON). Sin slides no se emite.
   ========================================================================== */
.tn-hero { position: relative; }

.tn-hero__slide {
    position: relative;
    display: block;
    color: inherit;
    text-decoration: none;
}

.tn-hero__img {
    display: block;
    width: 100%;
    height: auto;
    /* Reserva el espacio antes de que cargue la imagen: evita el salto. */
    aspect-ratio: 16 / 6;
    object-fit: cover;
}

.tn-hero__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px 20px;
    /* Degradado propio para que el texto se lea sobre cualquier imagen,
       sin depender de que la foto tenga una zona oscura. */
    background: linear-gradient(to top, rgba(0, 0, 0, .6), transparent);
    color: #fff;
}

.tn-hero__title    { font-size: 1.6rem; font-weight: 700; margin-bottom: .25rem; color: #fff; }
.tn-hero__subtitle { margin-bottom: .75rem; color: rgba(255, 255, 255, .9); }
.tn-hero__cta      { pointer-events: none; }   /* el <a> envuelve todo el slide */

@media (max-width: 767.98px) {
    .tn-hero__img      { aspect-ratio: 4 / 3; }
    .tn-hero__title    { font-size: 1.15rem; }
    .tn-hero__subtitle { font-size: .875rem; }
    .tn-hero__caption  { padding: 16px 14px; }
}

/* ==========================================================================
   Chips de filtros aplicados
   ========================================================================== */
.tn-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.tn-active-filters__label {
    font-size: 13px;
    color: var(--tn-secondary, #555);
    font-weight: 600;
}

.tn-active-filters__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tn-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--tn-primary, #175ea5);
    background: var(--tn-bg-light, #f5f5f5);
    border: 1px solid var(--tn-border, #e0e0e0);
    border-radius: 999px;
    text-decoration: none;
}

.tn-chip:hover,
.tn-chip:focus-visible {
    background: var(--tn-primary, #175ea5);
    color: #fff;
    text-decoration: none;
}

.tn-chip:focus-visible {
    outline: 2px solid var(--tn-primary, #175ea5);
    outline-offset: 2px;
}

.tn-chip__x { font-size: 15px; line-height: 1; }

.tn-active-filters__clear {
    font-size: 12px;
    color: var(--tn-red, #dd7774);
    text-decoration: underline;
}

/* ==========================================================================
   Favoritos
   ========================================================================== */
.tn-product-card__thumb { position: relative; }

.tn-product-card__wishlist {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.tn-product-card__wishlist .btn-wishlist {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .92);
    border-color: var(--tn-border, #e0e0e0);
    border-radius: 50%;
}

.tn-product-card__wishlist .btn-wishlist.active,
.btn-wishlist.active { color: var(--tn-red, #dd7774); }

/* Contador del header en cero: presente para el lector de pantalla, sin peso visual. */
.tn-cart-btn__count.is-empty { opacity: .45; }

/* ==========================================================================
   Accesibilidad
   ========================================================================== */

/* Saltar al contenido: invisible hasta que recibe foco por teclado. */
.tn-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    padding: 10px 16px;
    background: var(--tn-primary, #175ea5);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 var(--tn-radius, 6px) 0;
}

.tn-skip-link:focus {
    left: 0;
    color: #fff;
    text-decoration: none;
}

/* El destino del salto no debe dibujar un recuadro al recibir foco
   programatico (tiene tabindex="-1" solo para poder recibirlo). */
#editable_content:focus { outline: none; }

/* Foco visible en todo lo interactivo. Se usa :focus-visible para no
   dibujarlo en clicks de mouse, solo en navegacion por teclado. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 2px solid var(--tn-primary, #175ea5);
    outline-offset: 2px;
}

/* Utilitario propio: no depender de que el vendor traiga .sr-only. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Sugerencias del buscador
   ========================================================================== */
.tn-search-form { position: relative; }

.tn-search-suggest__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1040;
    max-height: 380px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--tn-border, #e0e0e0);
    border-radius: var(--tn-radius, 6px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
}

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

.tn-suggest__list { margin: 0; padding: 0; list-style: none; }

.tn-suggest__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--tn-secondary, #555);
    text-decoration: none;
    border-bottom: 1px solid var(--tn-bg-light, #f5f5f5);
}

/* is-active cubre el teclado; hover, el mouse. */
.tn-suggest__item:hover,
.tn-suggest__item.is-active {
    background: var(--tn-bg-light, #f5f5f5);
    color: var(--tn-primary, #175ea5);
    text-decoration: none;
}

.tn-suggest__item.is-active {
    /* Barra lateral: el resaltado no depende solo del color de fondo. */
    box-shadow: inset 3px 0 0 var(--tn-primary, #175ea5);
}

.tn-suggest__img {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.tn-suggest__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tn-suggest__price {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 13px;
    color: var(--tn-primary, #175ea5);
}

.tn-suggest__all {
    display: block;
    padding: 10px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--tn-primary, #175ea5);
    background: var(--tn-bg-light, #f5f5f5);
}

.tn-suggest__empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--tn-secondary, #555);
}

/* ==========================================================================
   Perfil del cliente (/profile/show/*)
   Esta pagina usa layouts/master, que arrastra markup de backoffice
   (AdminLTE / Bootstrap 3). Estas reglas lo encuadran dentro del theme.
   ========================================================================== */

/* Avatar: el tamaño lo fija el contenedor, no la imagen. Sin esto, un SVG
   sin dimensiones intrinsecas se expandia hasta ocupar media pantalla. */
.tn-profile-avatar img {
    width: 160px;
    height: 160px;
    max-width: 100%;
    object-fit: cover;
    border: 3px solid var(--tn-bg-light, #f5f5f5);
    background: var(--tn-bg-light, #f5f5f5);
}

/* Migas del encabezado: llegan como <ol> y se veian numeradas ("1. Dashboard"). */
.breadcrumbs,
.breadcrumbs ol,
ol.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;          /* mata la numeracion */
    font-size: 13px;
    color: var(--tn-secondary, #555);
}

.breadcrumbs li { display: inline-flex; align-items: center; }

.breadcrumbs li + li::before {
    content: "›";
    margin-right: 6px;
    color: var(--tn-border, #e0e0e0);
}

.breadcrumbs a { color: var(--tn-secondary, #555); }
.breadcrumbs a:hover { color: var(--tn-primary, #175ea5); }

/* Encabezado de la pagina */
.content-header h1,
#editable_content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tn-primary, #175ea5);
    margin-bottom: .5rem;
}

/* Pestañas del perfil, con la paleta del theme. */
.nav-tabs.customtab .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--tn-secondary, #555);
    font-weight: 600;
}

.nav-tabs.customtab .nav-link.active {
    background: transparent;
    border-bottom-color: var(--tn-primary, #175ea5);
    color: var(--tn-primary, #175ea5);
}

/* El contenido del perfil no puede desbordar su columna. */
.tab-content > .tab-pane { min-width: 0; }

/* ==========================================================================
   Menu lateral del perfil (nav.list-group.list-group-root)
   El markup viene del patron "list-group anidado" y usa .well, que es de
   Bootstrap 3 y no existe en este theme. Sin estas reglas los submenus se
   abren pero no se distinguen del padre: no hay sangria ni indicador.
   ========================================================================== */
.list-group-root {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--tn-border, #e0e0e0);
    border-radius: var(--tn-radius, 6px);
    background: #fff;
}

/* Reemplazo de .well (Bootstrap 3). */
.well {
    background: #fff;
    border-radius: var(--tn-radius, 6px);
}

.list-group-root .list-group { margin-bottom: 0; }

.list-group-root .list-group-item {
    border-radius: 0;
    border-width: 1px 0 0 0;
    border-color: var(--tn-bg-light, #f5f5f5);
    color: var(--tn-secondary, #555);
    font-size: 14px;
    padding: 11px 14px;
}

.list-group-root > .list-group-item:first-child { border-top-width: 0; }

/* Sangria por nivel: es lo que hace visible la jerarquia. */
.list-group-root > .list-group > .list-group-item { padding-left: 34px; }
.list-group-root > .list-group > .list-group > .list-group-item { padding-left: 54px; }

.list-group-root .list-group-item:hover,
.list-group-root .list-group-item:focus-visible {
    background: var(--tn-bg-light, #f5f5f5);
    color: var(--tn-primary, #175ea5);
    text-decoration: none;
}

.list-group-root .list-group-item.active {
    background: var(--tn-primary, #175ea5);
    border-color: var(--tn-primary, #175ea5);
    color: #fff;
    font-weight: 600;
}

/* Item con hijos: la flecha indica si esta abierto o cerrado. */
.list-group-root .list-group-parent { cursor: pointer; }

.list-group-root .collapse-icon {
    float: right;
    transition: transform .2s ease-in-out;
}

/* aria-expanded lo maneja Bootstrap: se usa como fuente de verdad. */
.list-group-root .list-group-parent[aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .list-group-root .collapse-icon { transition: none; }
}

/* La flecha del submenu, sin depender de que el shim v4 resuelva el prefijo:
   se fija la familia y el peso de Font Awesome 6 Free (900 = solid).
   Con la `fa` suelta de la version 4 se dibujaba el glifo vacio. */
.list-group-root .collapse-icon::before {
    font-family: "Font Awesome 6 Free", "FontAwesome";
    font-weight: 900;
    content: "\f107";           /* angle-down */
}

/* El markup traia pull-right (Bootstrap 3), que no existe en este theme. */
.list-group-root .list-group-parent {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-group-root .list-group-parent > span:not(.collapse-icon) { flex: 1 1 auto; }
.list-group-root .collapse-icon { float: none; margin-left: auto; }
