/* ================================================================
   ESTRUCTURA BASE INTEGRADA THUNDERSHOP ELITE - FINAL V1.5
   ================================================================ */

/* --- 💻 LÓGICA PARA COMPUTADORES (PC) --- */
@media (min-width: 768px) {
    /* Por defecto, MOSTRAR cabecera y menú en PC */
    .ts-custom-header {
        display: block !important;
        position: relative !important; /* Para que no flote sobre el diseño original de PC */
        width: 100%;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    
    .ts-secondary-nav {
        display: block !important;
        position: relative !important;
        width: 100%;
        background: #fff;
        border-bottom: 1px solid #eee;
        height: 50px;
    }

    /* EXCEPCIÓN: Ocultar si es Tienda o Checkout (Clases inyectadas por PHP) */
    .ts-is-shop-page, 
    .ts-is-checkout-page {
        display: none !important;
    }

    body {
        padding-top: 0 !important; 
    }
}

/* 1. Header Principal (Fijo arriba) - SOLO MÓVIL */
@media (max-width: 767px) {
    .ts-custom-header {
        width: 100%;
        background: #fff;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
        position: fixed; 
        top: 0;
        left: 0;
        z-index: 10000;
        display: block;
    }
}

/* Barra Superior de Visitantes */
.ts-top-announcement {
    background: #0F172A;
    color: white;
    text-align: center;
    padding: 6px 0;
    font-size: 11px;
    font-weight: bold;
}
.ts-vc-item span { 
    color: #FFD700; 
    font-family: 'Courier New', monospace; 
}

/* Logo e Iconos Superiores */
.ts-main-nav { 
    padding: 10px 15px; 
    background: #fff; 
}
.ts-header-row-top { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 8px; 
}
.ts-logo img { 
    height: 70px; 
    width: auto; 
}
.ts-header-icons { 
    display: flex; 
    gap: 20px; 
    font-size: 24px; 
}
.ts-icon-link { 
    text-decoration: none; 
    color: #334155; 
}

/* Buscador Optimizado */
.ts-search-container { 
    position: relative; 
    max-width: 600px; 
    margin: 0 auto; 
    width: 100%; 
}
.ts-search-input { 
    width: 100%; 
    padding: 5px 15px; 
    border: 2px solid #ea580c;
    border-radius: 50px; 
    outline: none; 
    font-size: 14px;
}
.ts-search-btn { 
    position: absolute; 
    right: 5px; 
    top: 50%; 
    transform: translateY(-50%); 
    background: #ea580c; 
    border: none; 
    color: #fff; 
    padding: 5px 12px; 
    border-radius: 50px; 
    cursor: pointer; 
}

/* 2. Menú de Iconos Secundario */
.ts-secondary-nav {
    position: fixed;
    left: 0;
    width: 100%;
    z-index: 9999; 
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.ts-nav-container {
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0 auto;
}

.ts-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: #334155;
    transition: all 0.2s ease;
    padding: 0;
}

/* Iconos pegados al texto para evitar botones del celular */
.ts-nav-icon svg { 
    width: 30px; 
    height: 30px; 
    margin-bottom: -2px; /* Pegado extremo */
    display: block;
}

.ts-nav-text { 
    font-size: 9px; 
    font-weight: 800; 
    margin-top: -1px; /* Subida para máxima visibilidad */
    text-transform: uppercase;
    line-height: 1;
}

/* --- 📱 LÓGICA PARA MÓVILES (Menú Abajo) --- */
@media (max-width: 767px) {
    .ts-secondary-nav {
        bottom: 0;
        height: 62px;
        border-top: 1px solid #E2E8F0;
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.05);
        display: block;
    }
    
    .ts-nav-container { 
        justify-content: space-around; 
        max-width: 100%; 
    }
    
    .ts-nav-item { 
        flex: 1; 
        color: #0F172A;
        padding-top: 4px;
    }

    /* Padding base para paginas normales en móvil */
    body { 
        padding-top: 140px !important; 
        padding-bottom: 70px !important; 
    }

    /* --- AJUSTE TIENDA MÓVIL --- */
    body.archive.post-type-archive-product,
    body.tax-product_cat,
    body.single-product,
    body.ts-is-shop-page {
        padding-top: 0px !important; 
    }

    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .ts-secondary-nav {
            height: calc(62px + env(safe-area-inset-bottom));
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* --- ⚡ ESTILOS ESPECIALES --- */
.ts-item-special .ts-bolt {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7));
}

.ts-cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background: #FFD700;
    color: #0F172A;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 50px;
}

/* ================================================================
   🚀 NUEVO: BOTÓN CENTRAL ÉLITE FLOTANTE (TIENDA CON LOGO)
   ================================================================ */

.ts-nav-item-center {
    position: relative;
    z-index: 10001; /* Lo pone por encima de todo */
}

/* El círculo azul oscuro flotante */
.ts-center-logo-wrapper {
    background-color: #0F172A; /* El azul oscurito premium de ThunderShop */
    width: 64px; /* Tamaño perfecto del círculo */
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15); /* Sombra hacia arriba para dar relieve */
    border: 4px solid #ffffff; /* Borde blanco para cortar con el fondo del menú */
    padding: 8px; /* Espacio interno para que el logo respire */
    margin-top: -32px; /* MAGIA: Esto es lo que lo empuja hacia arriba fuera de la barra */
    transition: transform 0.2s ease;
}

.ts-center-logo-wrapper img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2)); /* Un toquecito de brillo al logo */
}

/* Ajustamos el texto debajo del círculo para que encaje perfecto */
.ts-nav-item-center .ts-nav-text {
    margin-top: 4px; 
    color: #0F172A;
}

/* Efecto de "click" en el celular para que se sienta como una app real */
.ts-nav-item-center:active .ts-center-logo-wrapper {
    transform: scale(0.92);
}