/* ════════════════════════════════════════════
   AP PUSH NOTIFICATIONS v2 — CSS
   ════════════════════════════════════════════ */

/* ─── Botón en el nav ────────────────────────────────────── */

.ap-push-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    border-left: 1px solid #eee;
    color: rgba(0,0,0,.5);
    font-size: 11px;
    font-weight: 600;
    padding: 0 14px;
    height: 46px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: color .2s;
    float: right;
}

.ap-push-btn:hover   { color: #d71920; }
.ap-push-btn--active { color: #d71920; }

@media (max-width: 768px) {
    .ap-push-btn--nav { display: none; }
}

.ap-push-btn--floating {
    display: flex !important;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: #11346f;
    border: none;
    border-left: none;
    color: #fff;
    padding: 10px 16px;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    font-size: 12px;
    font-weight: 600;
    height: auto;
    float: none;
}

.ap-push-btn--floating:hover { background: #0e2c5e; }

/* ─── Modal overlay ──────────────────────────────────────── */

.ap-push-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .25s ease;
}

.ap-push-modal-overlay--show { opacity: 1; }

/* ─── Modal ──────────────────────────────────────────────── */

.ap-push-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    position: relative;
    transform: translateY(20px);
    transition: transform .25s ease;
    font-family: Arial, Helvetica, sans-serif;
}

.ap-push-modal-overlay--show .ap-push-modal {
    transform: translateY(0);
}

.ap-push-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.ap-push-modal__close:hover { background: #e5e7eb; color: #111; }

/* Header */
.ap-push-modal__header {
    text-align: center;
    padding: 32px 28px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.ap-push-modal__icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.ap-push-modal__header h2 {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    margin: 0 0 8px;
}

.ap-push-modal__header p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Body */
.ap-push-modal__body { padding: 20px 24px; }

/* Opciones principales */
.ap-push-pref-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.ap-push-pref-todas {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.ap-push-pref-todas:has(input:checked) {
    border-color: #11346f;
    background: #f0f4ff;
}

.ap-push-pref-todas input[type="radio"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #11346f;
}

.ap-push-pref-todas__content strong {
    display: block;
    font-size: 14px;
    color: #111;
    margin-bottom: 2px;
}

.ap-push-pref-todas__content span {
    font-size: 12px;
    color: #666;
}

/* Bloque de prefs custom */
.ap-push-prefs-custom { display: none; }

.ap-push-pref-block {
    margin-bottom: 20px;
}

.ap-push-pref-block h4 {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Grid de categorías */
.ap-push-cats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ap-push-pref-cat {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all .15s;
}

.ap-push-pref-cat:has(input:checked) {
    border-color: #11346f;
    background: #f0f4ff;
    color: #11346f;
    font-weight: 600;
}

.ap-push-pref-cat input { margin: 0; accent-color: #11346f; }

/* Keywords */
.ap-push-pref-hint {
    font-size: 12px;
    color: #888;
    margin: 0 0 10px;
    line-height: 1.5;
}

.ap-push-keywords-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
}

.ap-push-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    min-height: 10px;
}

.ap-push-kw-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #11346f;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 20px;
}

.ap-push-kw-tag button {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    font-size: 11px;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.ap-push-kw-tag button:hover { color: #fff; }

.ap-push-keyword-input-row {
    display: flex;
    gap: 8px;
}

.ap-push-keyword-input-row input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.ap-push-keyword-input-row input:focus {
    border-color: #11346f;
    box-shadow: 0 0 0 2px rgba(17,52,111,.1);
}

.ap-push-keyword-input-row button {
    background: #11346f;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background .15s;
}

.ap-push-keyword-input-row button:hover { background: #0e2c5e; }

/* Footer */
.ap-push-modal__footer {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #f0f0f0;
}

.ap-push-modal__confirm {
    background: #11346f;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
    width: 100%;
}

.ap-push-modal__confirm:hover { background: #0e2c5e; }

.ap-push-modal__cancel {
    background: none;
    color: #999;
    border: none;
    padding: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: color .15s;
}

.ap-push-modal__cancel:hover { color: #555; }

/* ─── Toast ──────────────────────────────────────────────── */

.ap-push-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #111;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    z-index: 999999;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    pointer-events: none;
}

.ap-push-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 480px) {
    .ap-push-modal { border-radius: 16px 16px 0 0; }
    .ap-push-modal-overlay { align-items: flex-end; padding: 0; }
    .ap-push-modal-overlay--show .ap-push-modal { transform: translateY(0); }
    .ap-push-cats-grid { grid-template-columns: 1fr 1fr; }
    .ap-push-modal__header { padding: 24px 20px 16px; }
    .ap-push-modal__body { padding: 16px 20px; }
    .ap-push-modal__footer { padding: 12px 20px 20px; }
}

/* ─── Keywords sugeridas ─────────────────────────────────── */

.ap-push-kw-sugeridas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.ap-push-kw-sugerida {
    background: #f0f4ff;
    border: 1.5px dashed #11346f;
    border-radius: 20px;
    color: #11346f;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}

.ap-push-kw-sugerida:hover {
    background: #11346f;
    color: #fff;
    border-style: solid;
}
