/* BNI Peticiones — mobile-first note taking */

.bni-peticiones-app {
    --pet-red: #c8102e;
    --pet-red-dark: #9a0c22;
    --pet-ink: #1a1a1a;
    --pet-muted: #5c5c5c;
    --pet-line: #e6e6e6;
    --pet-bg: #f7f5f2;
    --pet-surface: #ffffff;
    --pet-font: "Source Sans 3", "Montserrat", system-ui, sans-serif;
    --pet-display: "Montserrat", system-ui, sans-serif;
    min-height: 70vh;
    background:
        radial-gradient(ellipse 120% 80% at 10% -20%, rgba(200, 16, 46, 0.08), transparent 55%),
        linear-gradient(180deg, #fff 0%, var(--pet-bg) 40%);
    color: var(--pet-ink);
    font-family: var(--pet-font);
}

.bni-section-nav {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.5rem 1rem 0.75rem;
}

.bni-nav-link {
    font-family: var(--pet-display);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pet-muted);
    text-decoration: none;
    padding: 0.4rem 0.9rem;
    border-bottom: 2px solid transparent;
}

.bni-nav-link.is-active {
    color: var(--pet-red);
    border-bottom-color: var(--pet-red);
}

.pet-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--pet-line);
    padding: 0.75rem 1rem 0.5rem;
}

.pet-header-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pet-logo {
    width: 48px;
    height: auto;
}

.pet-kicker {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pet-red);
    font-family: var(--pet-display);
}

.pet-header-text h1 {
    margin: 0;
    font-family: var(--pet-display);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.15;
}

.pet-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.pet-week-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pet-muted);
}

.pet-week-select {
    flex: 1;
    min-width: 140px;
    border: 1px solid var(--pet-line);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.95rem;
    background: var(--pet-surface);
}

.pet-btn {
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    font-family: var(--pet-display);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.pet-btn-primary {
    background: var(--pet-red);
    color: #fff;
}

.pet-btn-primary:active {
    background: var(--pet-red-dark);
}

.pet-btn-ghost {
    background: transparent;
    color: var(--pet-ink);
    border: 1px solid var(--pet-line);
}

.pet-save-status {
    min-height: 1.2em;
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--pet-muted);
}

.pet-save-status[data-kind="ok"] {
    color: #1b7a3d;
}

.pet-save-status[data-kind="error"] {
    color: var(--pet-red);
}

.pet-save-status[data-kind="pending"] {
    color: #8a6d00;
}

.pet-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 0.5rem 0.75rem 5rem;
}

.pet-members-list {
    display: flex;
    flex-direction: column;
}

.pet-member-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    background: var(--pet-surface);
    border-bottom: 1px solid var(--pet-line);
    padding: 0.35rem 0.35rem 0.35rem 0.15rem;
}

.pet-member-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.5rem 0.35rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pet-member-row.is-done .pet-member-name {
    text-decoration: line-through;
    opacity: 0.75;
}

.pet-done-check {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--pet-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.25rem;
    flex-shrink: 0;
}

.pet-done-check input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--pet-red);
}

.pet-editor-note-wrap {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0.5rem 1rem;
    min-height: 0;
}

.pet-editor-note-wrap .pet-editor-note {
    margin: 0;
    flex: 1;
}

.pet-suggest-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0 0;
}

.pet-suggest-item {
    border: 1px solid var(--pet-line);
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.pet-suggest-item:active {
    background: #f0eeeb;
    border-color: var(--pet-red);
}

.pet-summary-actions-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: var(--pet-surface);
    border-bottom: 1px solid var(--pet-line);
    flex-wrap: wrap;
}

.pet-btn-wa {
    background: #25d366;
    color: #fff;
    flex: 1;
}

.pet-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pet-done-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #1b7a3d;
    background: #e7f6ec;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
}

.pet-summary-item.is-done h3 {
    opacity: 0.7;
}

/* Hide Odoo website chrome gaps / white strip on peticiones */
body.bni-peticiones-page #wrap,
body.bni-peticiones-page .oe_structure {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

body.bni-peticiones-page footer.o_footer,
body.bni-peticiones-page .o_footer_copyright,
body.bni-peticiones-page .o_brand_promotion,
body.bni-share-page footer.o_footer,
body.bni-share-page .o_footer_copyright,
body.bni-share-page .o_brand_promotion,
body:has(.pet-share-page) footer.o_footer,
body:has(.pet-share-page) .o_footer_copyright,
body:has(.pet-share-page) .o_brand_promotion,
body.pet-editor-open footer,
body.pet-summary-open footer {
    display: none !important;
}

.bni-brand-footer {
    text-align: center;
    padding: 1.25rem 1rem 1.75rem;
    font-size: 0.9rem;
    color: #5a5a5a;
    background: #fff;
    border-top: 1px solid #eee;
}

.bni-brand-footer p {
    margin: 0;
}

.bni-brand-footer a {
    color: #C8102E;
    font-weight: 700;
    text-decoration: none;
}

.bni-brand-footer a:hover {
    text-decoration: underline;
}

body.bni-peticiones-page {
    background: var(--pet-bg, #f7f5f2);
}

body.bni-peticiones-page main.pet-main {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

.pet-summary,
.pet-editor {
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
}


.pet-member-row.has-note .pet-member-preview {
    color: var(--pet-ink);
}

.pet-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #ead9dc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pet-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pet-avatar-initials {
    font-family: var(--pet-display);
    font-weight: 800;
    color: var(--pet-red);
    font-size: 0.95rem;
}

.pet-member-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pet-member-name {
    font-family: var(--pet-display);
    font-weight: 700;
    font-size: 1rem;
}

.pet-member-preview {
    font-size: 0.88rem;
    color: var(--pet-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-member-chevron {
    font-size: 1.4rem;
    color: #bbb;
    line-height: 1;
}

.pet-empty {
    text-align: center;
    color: var(--pet-muted);
    padding: 2rem 1rem;
}

/* Editor full-screen */
.pet-editor,
.pet-summary {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--pet-bg);
    display: flex;
    flex-direction: column;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
        env(safe-area-inset-left);
}

.pet-editor[hidden],
.pet-summary[hidden] {
    display: none !important;
}

.pet-editor-bar,
.pet-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: var(--pet-surface);
    border-bottom: 1px solid var(--pet-line);
}

.pet-summary-bar h2 {
    margin: 0;
    font-family: var(--pet-display);
    font-size: 1.1rem;
    font-weight: 800;
}

.pet-summary-actions {
    display: flex;
    gap: 0.4rem;
}

.pet-editor-member {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0.5rem;
}

.pet-editor-member h2 {
    margin: 0;
    font-family: var(--pet-display);
    font-size: 1.25rem;
    font-weight: 800;
}

.pet-specialty {
    margin: 0.15rem 0 0;
    color: var(--pet-muted);
    font-size: 0.9rem;
}

.pet-editor-note {
    flex: 1;
    margin: 0.5rem 1rem;
    border: 1px solid var(--pet-line);
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.15rem;
    line-height: 1.45;
    font-family: var(--pet-font);
    resize: none;
    background: var(--pet-surface);
    color: var(--pet-ink);
}

.pet-editor-note:focus {
    outline: 2px solid rgba(200, 16, 46, 0.35);
    border-color: var(--pet-red);
}

.pet-editor-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1.25rem;
}

.pet-summary-body {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

.pet-summary-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--pet-line);
}

.pet-summary-item h3 {
    margin: 0;
    font-family: var(--pet-display);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--pet-red);
}

.pet-summary-note {
    margin: 0.45rem 0 0;
    font-size: 1.05rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.pet-share-meta {
    margin: 0.25rem 0 0;
    color: var(--pet-muted);
    font-size: 0.9rem;
}

.pet-share-body {
    padding-bottom: 3rem;
}

body.pet-editor-open,
body.pet-summary-open {
    overflow: hidden;
}

/* Nav also on sorteo header */
.sorteo-bni-app .bni-section-nav {
    padding-bottom: 0.25rem;
}

@media (min-width: 768px) {
    .pet-header,
    .pet-main {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
    }

    .pet-editor,
    .pet-summary {
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        max-width: 640px;
        box-shadow: 0 0 0 1px var(--pet-line);
    }
}
