/* Ofertas en tu Barrio — Popup de ubicación (frontend) */

.oetbub-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}
.oetbub-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.oetbub-modal-box {
    position: relative;
    width: 92%;
    max-width: 460px;
    margin: 8vh auto 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    animation: oetbub-pop 0.25s cubic-bezier(0.16,1,0.3,1);
}
@keyframes oetbub-pop {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.oetbub-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    background: none; border: none;
    font-size: 26px; line-height: 1;
    color: #9aa4b2; cursor: pointer;
    z-index: 2;
}
.oetbub-modal-close:hover { color: #4b5563; }

.oetbub-modal-head {
    text-align: center;
    padding: 30px 26px 10px;
}
.oetbub-modal-emoji { font-size: 40px; margin-bottom: 6px; }
.oetbub-modal-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #14342a;
    font-weight: 700;
}
.oetbub-modal-head p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.oetbub-modal-body { padding: 12px 26px 6px; }

.oetbub-detect-btn {
    width: 100%;
    padding: 13px;
    background: #1f7a44;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.oetbub-detect-btn:hover { background: #145c32; }
.oetbub-detect-btn:disabled { opacity: 0.6; cursor: default; }
.oetbub-detect-icon { font-size: 17px; }

.oetbub-detect-msg {
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
    min-height: 18px;
}
.oetbub-detect-msg.ok { color: #1f7a44; }
.oetbub-detect-msg.err { color: #c0392b; }

.oetbub-divider {
    text-align: center;
    margin: 18px 0 14px;
    position: relative;
    color: #9aa4b2;
    font-size: 12px;
}
.oetbub-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px; background: #e5e7eb;
    z-index: 0;
}
.oetbub-divider span {
    position: relative;
    background: #fff;
    padding: 0 12px;
    z-index: 1;
}

.oetbub-field { margin-bottom: 14px; position: relative; }
.oetbub-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}
.oetbub-optional { color: #9aa4b2; font-weight: 400; }

.oetbub-field select,
.oetbub-field input[type="text"] {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
}
.oetbub-field select:focus,
.oetbub-field input[type="text"]:focus {
    border-color: #1f7a44;
    outline: none;
    box-shadow: 0 0 0 3px rgba(31,122,68,0.1);
}
.oetbub-field input:disabled,
.oetbub-field select:disabled { background: #f3f4f6; color: #9aa4b2; }

/* Autocompletado */
.oetbub-autocomplete {
    display: none;
    position: absolute;
    z-index: 5;
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
}
.oetbub-ac-item {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}
.oetbub-ac-item:last-child { border-bottom: none; }
.oetbub-ac-item:hover { background: #e8f5ee; color: #1f7a44; }
.oetbub-ac-empty { padding: 10px 14px; color: #9aa4b2; font-size: 13px; }

/* Chip de localidad seleccionada */
.oetbub-selected-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #e8f5ee;
    border: 1.5px solid #1f7a44;
    border-radius: 9px;
    font-size: 14px;
    color: #14342a;
    font-weight: 500;
}
.oetbub-chip-clear {
    background: none; border: none;
    color: #1f7a44; font-size: 18px; cursor: pointer; line-height: 1;
}

.oetbub-modal-foot { padding: 8px 26px 26px; }
.oetbub-confirm-btn {
    width: 100%;
    padding: 14px;
    background: #1f7a44;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.oetbub-confirm-btn:hover:not(:disabled) { background: #145c32; transform: translateY(-1px); }
.oetbub-confirm-btn:disabled { background: #cbd5e1; cursor: default; }

/* Botón trigger para reabrir (shortcode) */
.oetbub-zone-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    background: #e8f5ee;
    color: #14342a;
    border: 1px solid #1f7a44;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.oetbub-zone-trigger:hover { background: #1f7a44; color: #fff; }
.oetbub-zone-icon { font-size: 15px; }

@media (max-width: 480px) {
    .oetbub-modal-box { margin-top: 4vh; width: 94%; }
    .oetbub-modal-head { padding: 24px 20px 8px; }
    .oetbub-modal-body { padding: 10px 20px 4px; }
    .oetbub-modal-foot { padding: 8px 20px 20px; }
}

/* ===== Badge flotante "Cambiar ubicación" (pestaña lateral) ===== */
.oetbub-badge {
    position: fixed;
    z-index: 99998;
    display: flex;
    align-items: stretch;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
}

/* La pestaña (flecha) */
.oetbub-badge-tab {
    background: #1f7a44;
    color: #fff;
    border: none;
    cursor: pointer;
    width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    padding: 0;
    transition: background 0.2s;
}
.oetbub-badge-tab:hover { background: #145c32; }
.oetbub-badge-arrow { line-height: 1; transition: transform 0.3s; }

/* Panel que se despliega */
.oetbub-badge-panel {
    background: #fff;
    box-shadow: 0 6px 24px rgba(15,23,42,0.18);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 210px;
}
.oetbub-badge-current {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #14342a;
    font-weight: 600;
    line-height: 1.3;
}
.oetbub-badge-pin { flex-shrink: 0; }
.oetbub-badge-change {
    background: #1f7a44;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}
.oetbub-badge-change:hover { background: #145c32; }

/* --- Posición IZQUIERDA --- */
.oetbub-badge--left {
    left: 0;
    flex-direction: row;
    border-radius: 0 10px 10px 0;
}
.oetbub-badge--left .oetbub-badge-tab { border-radius: 0 10px 10px 0; order: 2; }
.oetbub-badge--left .oetbub-badge-panel { border-radius: 0 10px 10px 0; order: 1; }
/* Oculto: el panel se esconde a la izquierda, queda solo la flecha */
.oetbub-badge--left {
    transform: translateX(-210px);
}
.oetbub-badge--left.oetbub-badge--open {
    transform: translateX(0);
}
.oetbub-badge--left .oetbub-badge-arrow { }
.oetbub-badge--left.oetbub-badge--open .oetbub-badge-arrow { transform: rotate(180deg); }

/* --- Posición DERECHA --- */
.oetbub-badge--right {
    right: 0;
    flex-direction: row;
    border-radius: 10px 0 0 10px;
}
.oetbub-badge--right .oetbub-badge-tab { border-radius: 10px 0 0 10px; order: 1; }
.oetbub-badge--right .oetbub-badge-panel { border-radius: 10px 0 0 10px; order: 2; }
.oetbub-badge--right {
    transform: translateX(210px);
}
.oetbub-badge--right.oetbub-badge--open {
    transform: translateX(0);
}
.oetbub-badge--right.oetbub-badge--open .oetbub-badge-arrow { transform: rotate(180deg); }

/* Mobile: panel un poco más chico */
@media (max-width: 480px) {
    .oetbub-badge-panel { width: 180px; }
    .oetbub-badge--left { transform: translateX(-180px); }
    .oetbub-badge--right { transform: translateX(180px); }
    .oetbub-badge--left.oetbub-badge--open,
    .oetbub-badge--right.oetbub-badge--open { transform: translateX(0); }
}
