.bat-container {
    position: relative;
	text-align: end;
	z-index: 999;
}

.bat-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.2s ease, color 0.2s ease;
	position: relative;
}

.bat-toggle svg {
    width: 30px;
    height: 30px;
}

.bat-toggle:hover {
    transform: scale(1.1);
    color: #b1a276;
}

/* Tooltip personalizado */
.bat-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%; /* arriba del botón */
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: bottom;
    z-index: 100;
}

.bat-toggle:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Form wrapper */
.bat-form-wrapper {
    display: none;
    position: absolute;
    top: 60px;
    right: 0;
	width: min(90vw, 680px);
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 6px;
    padding: 10px;
}

.bat-form-wrapper.active {
    display: block;
	text-align: left;
}

/* Contenedor del input + botón limpiar */
.bat-input-inner {
	position: relative;
    display: block;
    width: 100%;
}

.bat-search-input {
	width: 100%;
    padding: 8px !important;
    border: 1px solid #ccc !important;
    border-radius: 5px !important;
    box-sizing: border-box !important;
    color: #141f33 !important;
    background-color: #feead9 !important;
    font-weight: bold !important;
}

/* Botón limpiar (X) */
.bat-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #141f33;
    cursor: pointer;
    display: none;
}

.bat-clear-btn:hover {
	color: #b1a276 !important;
	background-color: #141f33 !important;
}

.bat-search-input:not(:placeholder-shown) + .bat-clear-btn {
    display: block;
}

.bat-search-results {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
    border: 1px solid #eee;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 4px;
    background: #fff;
}

.bat-search-results li {
    padding: 8px;
    border-bottom: 1px solid #eee;
	line-height: 30px;
    transition: background 0.2s ease;
}

.bat-search-results li:last-child {
    border-bottom: none;
}

.bat-search-results li a {
    text-decoration: none;
    display: block;
    color: inherit;
	position: relative;
	padding-left: 36px;
}

.bat-search-results li:nth-child(odd) {
    background-color: #f9f9f9;
}

.bat-search-results li:nth-child(even) {
    background-color: #fff;
}

.bat-search-results li:hover,
.bat-search-results li.active {
    background-color: #e6f0ff;
    cursor: pointer;
}

.bat-arrow {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    font-size: 16px;
    color: #0073aa;
}

.bat-search-results li:hover .bat-arrow {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
}

.bat-mark {
	background-color: #b1a276;
	color: #fff;
	padding: .1em !important;
}

/* ============================================================= */
/* ✅ PAGINACIÓN: contador + botón "Ver más" + spinner           */
/* ============================================================= */
.bat-footer {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 8px 4px 2px;
}

.bat-counter {
    font-size: 13px;
    color: #141f33;
    font-weight: bold;
}

.bat-more {
    background-color: #141f33;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 14px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.bat-more:hover {
    background-color: #b1a276;
    color: #fff;
    transform: scale(1.03);
}

.bat-more.loading {
    pointer-events: none;
    opacity: 0.9;
}

.bat-more.loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bat-spin 0.6s linear infinite;
}

@keyframes bat-spin {
    to { transform: rotate(360deg); }
}


/* ✅ RESPONSIVE PARA MÓVILES */
@media (max-width: 767px) {
    .bat-container {
        position: relative;
        z-index: 999;
		text-align: left;
    }

    .bat-form-wrapper {
        display: none;
		position: absolute;
        padding: 10px;
        background: #fff;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        flex-direction: column;
    }

    .bat-form-wrapper.active {
        display: flex;
		width: 90vw;
		left: -35px;
    }

    .bat-search-input {
        width: 100%;
        font-size: 16px;
    }

    .bat-search-results {
        margin-top: 8px;
        max-height: 50vh;
        overflow-y: auto;
        border: 1px solid #ddd;
        border-radius: 4px;
        background: #fff;
        position: static;
        width: 100%;
    }

    .bat-footer {
        justify-content: center;
    }
    .bat-more {
        width: 100%;
        justify-content: center;
    }
}
