/* PetApp - Pet Land - Mobile First */
:root {
    --primary: #E87722;
    --primary-light: #F4943E;
    --primary-pale: #FFF3E8;
    --dark: #1A1A1A;
    --bg: #f8f9fa;
    --white: #ffffff;
    --text: #1A1A1A;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --danger: #e63946;
    --warning: #f4a261;
    --success: #E87722;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    /* Keep old vars as aliases for components that still reference them */
    --green: #E87722;
    --green-light: #F4943E;
    --green-pale: #FFF3E8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Top Banner PetApp ─── */
.petapp-top-banner {
    background: linear-gradient(135deg, var(--primary) 0%, #D06A1F 100%);
    width: 100%;
    z-index: 50;
}
.petapp-top-banner a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    flex-wrap: wrap;
}
.petapp-top-banner-icon {
    font-size: 1.5rem;
}
.petapp-top-banner-text {
    flex: 1;
    min-width: 0;
}
.petapp-top-banner-cta {
    background: rgba(255,255,255,0.2);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}
.petapp-top-banner a:hover .petapp-top-banner-cta {
    background: rgba(255,255,255,0.35);
}

/* ─── Planes Page ─── */
.planes-hero {
    text-align: center;
    padding: 2rem 0 1.5rem;
}
.planes-hero-logo {
    height: 240px;
    width: auto;
    margin-bottom: 1rem;
}
.planes-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}
.planes-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}
.plan-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border: 2px solid var(--border);
}
.plan-card.plan-premium {
    border-color: var(--primary);
    position: relative;
}
.plan-card.plan-premium::before {
    content: 'MAS POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.2rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.plan-card h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0.75rem 0;
}
.plan-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}
.plan-features {
    list-style: none;
    margin: 1rem 0;
}
.plan-features li {
    padding: 0.4rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 1rem;
}
.plan-features li::before {
    content: '\2713';
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
}
.plan-features li.plan-feature-disabled::before {
    content: '\2717';
    color: var(--text-muted);
}
.plan-features li.plan-feature-disabled {
    color: var(--text-muted);
    text-decoration: line-through;
}
.plan-btn {
    display: block;
    text-align: center;
    padding: 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 1rem;
}
.plan-btn-free {
    background: var(--bg);
    color: var(--dark);
    border: 2px solid var(--border);
}
.plan-btn-premium {
    background: var(--primary);
    color: var(--white);
}
.planes-download {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
}
.planes-download h2 {
    margin-bottom: 0.5rem;
}
.planes-download p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.planes-ebook-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-pale);
    color: var(--primary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 0.5rem;
}
.planes-sucursales {
    background: var(--dark);
    color: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0 2rem;
    text-align: center;
}
.planes-sucursales h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}
.planes-sucursales p {
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

/* ─── App Header with Logo ─── */
.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    text-align: center;
    z-index: 30;
}
.app-header a { display: inline-block; }
.header-logo {
    height: 44px;
    width: auto;
    display: block;
    margin: 0 auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 18px;
    min-height: 100vh;
    padding-bottom: 80px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 576px;
    margin: 0 auto;
    padding: 1rem;
}

/* ─── Typography (50% bigger base) ─── */
h1 { font-size: 2rem; font-weight: 700; color: var(--dark); }
h2 { font-size: 1.5rem; font-weight: 600; color: var(--dark); }
h3 { font-size: 1.25rem; font-weight: 600; }
.text-muted { color: var(--text-muted); font-size: 1rem; }
.subtitle { color: var(--text-muted); font-size: 1.1rem; margin-top: 0.25rem; }

/* ─── Auth Pages ─── */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem 2rem;
    min-height: 80vh;
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.logo-circle {
    width: 80px; height: 80px;
    background: var(--green-pale);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
}
.logo-img {
    width: 120px; height: 120px;
    object-fit: contain;
    margin: 0 auto 1rem;
    display: block;
}
.logo-img-full {
    width: 220px;
    object-fit: contain;
    margin: 0 auto 0.5rem;
    display: block;
}
.auth-form { width: 100%; max-width: 360px; }
.auth-footer { margin-top: 1.5rem; font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.auth-footer a { color: var(--green); }

/* ─── Forms ─── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.35rem; color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

input[type="text"], input[type="tel"], input[type="email"], input[type="number"],
input[type="date"], input[type="password"], select, textarea {
    width: 100%;
    padding: 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    background: var(--white);
    transition: border-color 0.2s;
    -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.phone-input {
    display: flex;
    align-items: center;
    gap: 0;
}
.phone-prefix {
    padding: 0.85rem;
    background: var(--primary-pale);
    border: 1.5px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}
.phone-input input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.checkbox-group { display: flex; align-items: center; }
.checkbox-label {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.9rem; cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--green); }

.form-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

/* ─── OTP ─── */
.otp-inputs {
    display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem;
}
.otp-digit {
    width: 48px; height: 56px;
    text-align: center; font-size: 1.5rem; font-weight: 700;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
}
.otp-digit:focus { border-color: var(--green); }

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.85rem 1.5rem;
    border: none; border-radius: var(--radius-sm);
    font-size: 1.1rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-light); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.95rem; }

.error-msg {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fce4ec;
    color: var(--danger);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

/* ─── Page Header ─── */
.page-header { margin-bottom: 1.25rem; }
.back-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* ─── Pet Grid (Home) ─── */
.pet-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.pet-card {
    display: flex; align-items: center;
    background: var(--white);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    text-decoration: none; color: inherit;
    transition: transform 0.15s;
}
.pet-card:active { transform: scale(0.98); }
.pet-photo {
    width: 64px; height: 64px;
    border-radius: 50%; overflow: hidden;
    flex-shrink: 0; margin-right: 0.75rem;
}
.pet-photo img { width: 100%; height: 100%; object-fit: cover; }
.pet-photo-placeholder {
    width: 100%; height: 100%;
    background: var(--green-pale);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
}
.pet-photo-placeholder.large { font-size: 3rem; width: 100px; height: 100px; border-radius: 50%; }
.pet-info { flex: 1; }
.pet-info h3 { margin-bottom: 0.25rem; }
.pet-weight { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }
.pet-arrow { font-size: 1.5rem; color: var(--text-muted); padding-left: 0.5rem; }

/* ─── Tags ─── */
.pet-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pet-tags.centered { justify-content: center; margin-top: 0.5rem; }
.tag {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--primary-pale);
    color: var(--primary);
}
.tag-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.tag-success { background: var(--primary-pale); color: var(--primary); }
.tag-warning { background: #fff3cd; color: #856404; }
.tag-danger { background: #fce4ec; color: var(--danger); }
.tag-sm { font-size: 0.7rem; padding: 0.15rem 0.5rem; }

/* ─── Profile Button ─── */
.profile-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary-pale);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    text-decoration: none;
    flex-shrink: 0;
}
.input-disabled {
    background: #f0f0f0;
    color: var(--text-muted);
}

/* ─── Premium Banner (Home) ─── */
.premium-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--dark), #333);
    color: var(--white);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.15s;
}
.premium-banner:active { transform: scale(0.98); }
.premium-banner-active { opacity: 0.85; }
.premium-banner-badge {
    background: var(--primary);
    color: var(--white);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.premium-banner-text { flex: 1; font-size: 0.95rem; font-weight: 600; }
.premium-banner-price { color: var(--primary); font-weight: 800; font-size: 0.9rem; flex-shrink: 0; }

/* ─── FAB ─── */
.fab {
    position: fixed;
    bottom: 90px; right: 20px;
    width: 60px; height: 60px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 300;
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    z-index: 10;
    transition: transform 0.2s;
}
.fab:active { transform: scale(0.9); }

/* ─── Pet Hero ─── */
.pet-hero {
    text-align: center;
    padding: 1rem 0 1.5rem;
    position: relative;
}
.pet-edit-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.15s, color 0.15s;
    z-index: 2;
}
.pet-edit-btn:hover, .pet-edit-btn:active {
    transform: rotate(60deg);
    background: var(--primary);
    color: #fff;
}
.pet-hero-photo {
    position: relative;
    width: 100px; height: 100px;
    border-radius: 50%; overflow: visible;
    margin: 0 auto 0.75rem;
}
.pet-hero-photo > img,
.pet-hero-photo > .pet-photo-placeholder {
    width: 100px; height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    display: block;
    object-fit: cover;
}
.pet-photo-camera {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 2px solid #fff;
    pointer-events: none;
}
.pet-hero-weight { font-size: 1.3rem; color: var(--primary); font-weight: 600; margin-top: 0.5rem; }

/* ─── Alerts (vacunas pendientes) ─── */
.alert-list { display: flex; flex-direction: column; gap: 0.5rem; }
.alert-item {
    display: flex; align-items: flex-start; gap: 0.6rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid;
}
.alert-danger { background: #fff5f5; border-color: var(--danger); }
.alert-info { background: #f0f7ff; border-color: #4a90d9; }
.alert-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; }
.alert-info-text { display: flex; flex-direction: column; gap: 0.15rem; }

/* ─── Plan details ─── */
.plan-details { margin-top: 0.5rem; }
.plan-details summary {
    cursor: pointer; color: var(--green); font-weight: 500; font-size: 0.9rem;
    padding: 0.5rem 0;
}
.plan-table { padding: 0.5rem 0; }
.plan-row {
    display: flex; flex-direction: column; gap: 0.25rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.plan-row:last-child { border-bottom: none; }
.plan-doses { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.25rem; }

/* ─── AI Assistant Button ─── */
.ai-assistant-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--dark), #333);
    color: var(--primary);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.15s;
}
.ai-assistant-btn:active { transform: scale(0.97); }
.ai-assistant-btn span { font-size: 1.3rem; }

/* ─── Tabs ─── */
.tab-bar {
    display: flex; gap: 0;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}
.tab {
    flex: 1;
    padding: 0.65rem 0.5rem;
    border: none; background: none;
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-pale); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Sections ─── */
.section { margin-bottom: 1.5rem; }
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.75rem;
}

/* ─── Record List ─── */
.record-list { display: flex; flex-direction: column; gap: 0.5rem; }
.record-item {
    display: flex; align-items: center; gap: 0.75rem;
    background: var(--white);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.record-icon { font-size: 1.3rem; }
.record-info { display: flex; flex-direction: column; gap: 0.2rem; }
.record-info strong { font-size: 0.9rem; }

/* ─── Food Card ─── */
.food-card {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.food-card h3 { margin-bottom: 0.75rem; }
.food-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; margin-bottom: 0.5rem; }
.stat { text-align: center; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }

/* ─── AI Results ─── */
.ai-result {
    background: var(--white);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
}
.ai-header { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 0.5rem; }
.ai-report { font-size: 0.85rem; line-height: 1.5; color: var(--text); }

/* ─── Photo Upload ─── */
.photo-upload {
    margin-bottom: 1rem; cursor: pointer;
}
.photo-preview {
    width: 120px; height: 120px;
    border-radius: 50%;
    background: var(--green-pale);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    margin: 0 auto;
    overflow: hidden;
    border: 2px dashed var(--green);
    transition: border-color 0.2s;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-icon { font-size: 1.5rem; }
.photo-preview span { font-size: 0.75rem; color: var(--green); margin-top: 0.25rem; }

/* ─── Modals ─── */
.modal {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    align-items: flex-end;
    justify-content: center;
}
.modal.show { display: flex; }
.modal-content {
    background: var(--white);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem;
}
.modal-close {
    background: none; border: none;
    font-size: 1.5rem; color: var(--text-muted);
    cursor: pointer; padding: 0.25rem;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h2 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.empty-state p { color: var(--text-muted); }

/* ─── Bottom Nav ─── */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    z-index: 50;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none; color: var(--text-muted);
    padding: 0.25rem 1rem;
    transition: color 0.2s;
    font-size: 0.75rem;
}
.nav-item.active { color: var(--primary); }
.nav-icon { font-size: 1.5rem; margin-bottom: 0.1rem; }

/* ─── Match Page ─── */
.match-container { position: relative; height: 420px; margin-bottom: 1rem; }
.match-card {
    position: absolute; top: 0; left: 0; right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: transform 0.3s;
}
.match-card img { width: 100%; height: 280px; object-fit: cover; }
.match-card-info { padding: 1rem; }
.match-photo-wrap { position: relative; }
.sex-badge {
    position: absolute;
    top: 12px; right: 12px;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    border: 2px solid #fff;
    z-index: 2;
    line-height: 1;
}
.sex-male { background: #2196F3; }
.sex-female { background: #E91E63; }
.match-actions {
    display: flex; justify-content: center; gap: 2rem;
}
.match-btn {
    width: 60px; height: 60px;
    border-radius: 50%; border: 2px solid var(--border);
    background: var(--white);
    font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.match-btn:active { transform: scale(0.9); }
.match-btn.like { border-color: var(--danger); color: var(--danger); }
.match-btn.pass { border-color: var(--text-muted); }

/* ─── Purchases ─── */
.purchase-item {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 0.5rem;
}
.purchase-item h3 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.purchase-total { font-weight: 700; color: var(--primary); }

/* ─── Match Results ─── */
.match-result-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--white);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.75rem;
    transition: transform 0.15s;
}
.match-result-card:active { transform: scale(0.98); }
.match-result-photos {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.match-result-photo {
    width: 48px; height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-pale);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.match-result-photo img { width: 100%; height: 100%; object-fit: cover; }
.match-result-heart { color: var(--danger); font-size: 1rem; }
.match-result-info { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.match-result-action { flex-shrink: 0; }

/* ─── Chat header ─── */
.chat-header-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--white);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
}
.chat-header-photo {
    width: 50px; height: 50px;
    border-radius: 50%; overflow: hidden;
    flex-shrink: 0;
}
.chat-header-photo img { width: 100%; height: 100%; object-fit: cover; }
.chat-header-info h2 { font-size: 1.2rem; }
.chat-time {
    display: block;
    font-size: 0.65rem;
    color: rgba(0,0,0,0.4);
    text-align: right;
    margin-top: 0.2rem;
}

/* ─── Points Card ─── */
.points-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--dark), #333);
    color: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
}
.points-icon { font-size: 2.5rem; }
.points-info { display: flex; flex-direction: column; }
.points-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.points-label { font-size: 1rem; color: #ccc; }

/* ─── Toast ─── */
.toast {
    position: fixed;
    top: 1rem; left: 50%; transform: translateX(-50%);
    background: var(--text);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-size: 0.85rem;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

/* ─── Contact Buttons (WhatsApp + Tienda) ─── */
.contact-bar {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}
.contact-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.15s;
    text-align: center;
}
.contact-btn:active { transform: scale(0.97); }
.contact-btn-wa {
    background: #25D366;
    color: var(--white);
}
.contact-btn-shop {
    background: var(--dark);
    color: var(--primary);
}
.contact-btn-call {
    background: var(--primary);
    color: var(--white);
}
.contact-btn span { font-size: 1.2rem; }

/* ─── Chat (Asistente IA) ─── */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 180px;
    max-height: calc(100vh - 200px);
}
.chat-msg { display: flex; margin-bottom: 0.75rem; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot { justify-content: flex-start; }
.chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.chat-msg.user .chat-bubble {
    background: var(--green);
    color: var(--white);
    border-bottom-right-radius: 4px;
}
.chat-msg.bot .chat-bubble {
    background: var(--white);
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
}
.chat-bubble.typing {
    color: var(--text-muted);
    font-style: italic;
}
.chat-input-bar {
    position: fixed;
    bottom: 70px; left: 0; right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 0.5rem 1rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    z-index: 40;
}
.chat-quick-links {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    justify-content: center;
}
.chat-link {
    padding: 0.35rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.chat-link-wa { background: #25D366; color: var(--white); }
.chat-link-shop { background: var(--dark); color: var(--primary); }
.chat-link-stop { background: var(--danger); color: var(--white); animation: pulse 1s infinite; }
.chat-img { max-width: 200px; width: 100%; border-radius: 12px; display: block; margin-bottom: 0.35rem; }
.chat-remaining {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.chat-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
}
.chat-input-row input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    font-size: 0.95rem;
}
.btn-mic, .btn-send {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.btn-mic {
    background: var(--green-pale);
    color: var(--green);
}
.btn-mic.recording {
    background: var(--danger);
    color: var(--white);
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.btn-send {
    background: var(--green);
    color: var(--white);
}
.voice-status {
    text-align: center;
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.25rem;
    animation: pulse 1.5s infinite;
}

/* ─── Premium Page ─── */
.premium-hero {
    text-align: center;
    padding: 1.5rem 0 1rem;
}
.premium-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), #D4650A);
    color: var(--white);
    padding: 0.3rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}
.premium-price { margin-top: 0.5rem; }
.price-amount { font-size: 2.5rem; font-weight: 800; color: var(--dark); }
.price-period { font-size: 1.2rem; color: var(--text-muted); }

.premium-active-card {
    display: flex; align-items: center; gap: 0.75rem;
    background: #e8f5e9; border-radius: var(--radius);
    padding: 1rem; margin: 1rem 0;
}
.premium-active-icon { font-size: 1.5rem; }

.discount-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}
.discount-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
}
.discount-badge {
    position: absolute;
    top: -8px; right: -4px;
    background: var(--danger);
    color: var(--white);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
}
.discount-icon { font-size: 1.8rem; margin: 0.5rem 0 0.25rem; }
.discount-card h3 { font-size: 0.85rem; line-height: 1.3; }
.discount-card .text-muted { font-size: 0.75rem; }

.benefits-list { display: flex; flex-direction: column; gap: 0.4rem; }
.benefit-item {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1rem;
}
.benefit-check { color: var(--primary); font-weight: 800; font-size: 1.1rem; }

.savings-card {
    background: var(--primary-pale);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
}
.savings-card h3 { margin-bottom: 0.75rem; }
.savings-row {
    display: flex; justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.95rem;
}
.savings-amount { color: var(--danger); font-weight: 600; }
.savings-total {
    display: flex; justify-content: space-between;
    padding: 0.5rem 0 0;
    margin-top: 0.3rem;
    border-top: 2px solid var(--primary);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--danger);
}

/* ─── Responsive ─── */
@media (min-width: 600px) {
    .container { padding: 1.5rem; }
    body { padding-bottom: 0; }
    .bottom-nav { display: none; }
}

/* ─── Banner instalar PWA ─────────────────────────────────── */
.install-banner {
    position: fixed;
    left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 1200;
    margin: 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.65rem 0.75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    animation: installUp 0.3s ease;
}
@keyframes installUp { from { transform: translateY(120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.install-banner-icon { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.install-banner-text { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.install-banner-text strong { font-size: 0.95rem; color: var(--text); }
.install-banner-text span { font-size: 0.78rem; color: var(--text-muted); }
.install-banner-btn {
    background: var(--primary); color: #fff; border: none;
    border-radius: 999px; padding: 0.5rem 1.1rem; font-weight: 700;
    font-size: 0.9rem; cursor: pointer; flex-shrink: 0;
}
.install-banner-btn:active { transform: scale(0.96); }
.install-banner-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 0.25rem; flex-shrink: 0;
}

/* iOS install hint */
.ios-install {
    position: fixed; inset: 0; z-index: 1300;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: flex-end; justify-content: center;
    padding: 0 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
}
.ios-install-card {
    position: relative; background: var(--white); border-radius: 18px;
    padding: 1.5rem 1.25rem 1.25rem; max-width: 420px; width: 100%;
    text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.ios-install-icon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 0.5rem; }
.ios-install-card strong { display: block; font-size: 1.05rem; margin-bottom: 0.4rem; color: var(--text); }
.ios-install-card p { font-size: 0.92rem; color: var(--text-muted); margin: 0; }
.ios-install-card b { color: var(--text); }
.ios-share { display: inline-block; color: var(--primary); font-weight: 700; }
.ios-install-close {
    position: absolute; top: 0.5rem; right: 0.75rem;
    background: none; border: none; font-size: 1.6rem; line-height: 1;
    color: var(--text-muted); cursor: pointer;
}

/* ─── Minitienda / calesita de recompra ───────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 1.25rem 0 0.6rem; }
.section-head h2 { margin: 0; }
.carousel {
    display: flex; gap: 0.75rem; overflow-x: auto; padding: 0.25rem 0.1rem 0.6rem;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { height: 0; }
.carousel-card {
    flex: 0 0 150px; scroll-snap-align: start;
    background: var(--white); border: 1px solid var(--border); border-radius: 14px;
    padding: 0.6rem; display: flex; flex-direction: column;
    transition: border-color .15s, box-shadow .15s;
}
.carousel-card.in-cart { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-pale); }
.carousel-img {
    width: 100%; aspect-ratio: 1/1; border-radius: 10px; margin-bottom: 0.5rem;
    background: var(--primary-pale) center/contain no-repeat;
}
.carousel-name {
    font-size: 0.82rem; line-height: 1.2; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2rem; margin-bottom: 0.25rem;
}
.carousel-price { font-weight: 800; color: var(--primary); margin-bottom: 0.5rem; }
.qty-ctrl { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.qty-btn {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--white); font-size: 1.3rem; line-height: 1; color: var(--primary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.qty-btn:active { transform: scale(0.92); }
.qty-val { font-weight: 700; min-width: 1.5rem; text-align: center; }

/* Carrito flotante */
.cart-bar {
    position: fixed; left: 0.75rem; right: 0.75rem;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 0.5rem);
    z-index: 1100; display: flex; align-items: center; justify-content: space-between;
    background: var(--primary); color: #fff; border-radius: 14px;
    padding: 0.7rem 1rem; box-shadow: 0 8px 24px rgba(232,119,34,0.4);
    animation: installUp .25s ease;
}
.cart-bar-info { font-size: 0.9rem; }
.cart-bar-info strong { margin-left: 0.5rem; font-size: 1.05rem; }
.cart-bar-btn {
    background: #fff; color: var(--primary); border: none; border-radius: 999px;
    padding: 0.55rem 1.1rem; font-weight: 800; font-size: 0.9rem; cursor: pointer;
}
.cart-bar-btn:active { transform: scale(0.96); }

/* ─── Facturas y comprobantes ─────────────────────────────── */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tab {
    flex: 1; padding: 0.6rem; border: 1px solid var(--border); background: var(--white);
    border-radius: 10px; font-weight: 700; color: var(--text-muted); cursor: pointer;
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.doc-item {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    background: var(--white); border: 1px solid var(--border); border-radius: 12px;
    padding: 0.8rem 0.9rem; margin-bottom: 0.6rem;
}
.doc-main { min-width: 0; flex: 1; }
.doc-name { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.doc-sub { font-size: 0.82rem; }
.doc-right { text-align: right; flex-shrink: 0; }
.doc-amount { font-weight: 800; color: var(--text); }
.doc-dl { font-size: 0.82rem; color: var(--primary); font-weight: 700; white-space: nowrap; }
.badge { font-size: 0.7rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 999px; }
.badge-success { background: #e6f4ea; color: #1e7e34; }
.badge-danger { background: #fde8ea; color: var(--danger); }
.badge-warning { background: #fff3e0; color: #b66a00; }
.badge-muted { background: #eee; color: var(--text-muted); }

/* 4 ítems en bottom-nav */
.bottom-nav { justify-content: space-around; }

/* ─── Alerta recompra de alimento (home) ──────────────────── */
.food-alert {
    display: flex; align-items: center; gap: 0.75rem;
    background: var(--primary-pale); border: 1px solid var(--primary-light);
    border-radius: 14px; padding: 0.8rem 0.9rem; margin-bottom: 0.85rem;
    text-decoration: none; color: var(--text);
}
.food-alert-urgent { background: #fde8ea; border-color: var(--danger); }
.food-alert-icon { font-size: 1.5rem; flex-shrink: 0; }
.food-alert-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.food-alert-text strong { font-size: 0.92rem; }
.food-alert-text span { font-size: 0.8rem; color: var(--text-muted); }
.food-alert-cta { font-weight: 800; color: var(--primary); white-space: nowrap; font-size: 0.85rem; }
.food-alert-urgent .food-alert-cta { color: var(--danger); }

/* ─── Cross-sell 15% OFF ──────────────────────────────────── */
.xsell-badge {
    background: var(--danger); color: #fff; font-size: 0.72rem; font-weight: 800;
    padding: 0.2rem 0.6rem; border-radius: 999px;
}
.xsell-card {
    display: flex; align-items: center; gap: 0.75rem;
    background: var(--white); border: 1px dashed var(--primary);
    border-radius: 14px; padding: 0.6rem 0.75rem; margin-bottom: 0.6rem;
}
.xsell-img {
    width: 54px; height: 54px; border-radius: 10px; flex-shrink: 0;
    background: var(--primary-pale) center/contain no-repeat;
}
.xsell-info { flex: 1; min-width: 0; }
.xsell-name {
    font-size: 0.85rem; line-height: 1.2; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.xsell-prices { display: flex; align-items: baseline; gap: 0.45rem; margin-top: 0.2rem; }
.xsell-old { text-decoration: line-through; color: var(--text-muted); font-size: 0.8rem; }
.xsell-new { font-weight: 800; color: var(--danger); }
.xsell-off {
    background: #fde8ea; color: var(--danger); font-size: 0.7rem; font-weight: 800;
    padding: 0.1rem 0.4rem; border-radius: 6px;
}
.xsell-add {
    background: var(--primary); color: #fff; border: none; border-radius: 999px;
    padding: 0.5rem 0.9rem; font-weight: 800; font-size: 0.85rem; cursor: pointer; flex-shrink: 0;
}
.xsell-add:active { transform: scale(0.95); }

/* ─── Login: resumen de planes ────────────────────────────── */
.login-plans-title { margin-top: 1.25rem; font-weight: 800; font-size: 0.95rem; color: var(--text); text-align: center; }
.login-plans { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.login-plan {
    flex: 1; background: var(--white); border: 1px solid var(--border);
    border-radius: 14px; padding: 0.8rem 0.7rem; display: flex; flex-direction: column; gap: 0.15rem;
}
.login-plan-premium { border-color: var(--primary); background: var(--primary-pale); }
.login-plan-name { font-weight: 800; font-size: 0.9rem; color: var(--text); }
.login-plan-price { font-weight: 800; color: var(--primary); font-size: 1.05rem; }
.login-plan-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.25; }
.login-plan { cursor: pointer; position: relative; transition: box-shadow .15s ease, transform .1s ease; -webkit-tap-highlight-color: transparent; }
.login-plan:active { transform: scale(0.98); }
.login-plan-check {
    position: absolute; top: -8px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
    background: var(--primary); color: #fff; font-size: 0.8rem; font-weight: 800;
    display: none; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.login-plan.selected { box-shadow: 0 0 0 2px var(--primary); }
.login-plan.selected .login-plan-check { display: flex; }
.auth-footer a { color: var(--primary); font-weight: 700; }

/* ─── Mi cuenta: local, puntos, premios, tickets, biblioteca ── */
.btn-outline { background: var(--white); color: var(--primary); border: 2px solid var(--primary); }
.btn-wa { background: #25D366; color: #fff; display: flex; align-items: center;
          justify-content: center; gap: 0.5rem; }
.btn-wa:hover { background: #1FAF52; }

.branch-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px;
               padding: 0.9rem; margin-bottom: 1rem; }
.branch-card-head { display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.75rem; }
.branch-card-pin { font-size: 1.3rem; }
.branch-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.branch-card-body span { font-size: 0.82rem; }
.branch-card-hours { font-size: 0.75rem !important; }
.branch-card-change { color: var(--primary); font-weight: 700; font-size: 0.85rem; flex: 0 0 auto; }

.acc-section { margin-bottom: 1.5rem; }
.section-link { color: var(--primary); font-weight: 700; font-size: 0.85rem; }

.points-hero { background: linear-gradient(135deg, #E87722, #C85F12); color: #fff;
               border-radius: 18px; padding: 1.1rem; }
.points-hero-top { display: flex; align-items: baseline; justify-content: space-between; }
.points-hero-label { font-size: 0.85rem; opacity: 0.9; }
.points-hero-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.points-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.28); margin: 0.7rem 0 0.5rem; }
.points-bar-fill { height: 100%; border-radius: 4px; background: #fff; transition: width .4s ease; }
.points-hero-next { color: rgba(255,255,255,.95) !important; font-size: 0.85rem; }
.points-card-code { margin-top: 0.6rem; font-size: 0.78rem; background: rgba(0,0,0,.15);
                    border-radius: 10px; padding: 0.45rem 0.6rem; }

.rewards-note { background: var(--primary-pale); border: 1px solid var(--primary);
                border-radius: 12px; padding: 0.6rem 0.75rem; font-size: 0.85rem;
                font-weight: 700; color: var(--primary); margin-bottom: 0.7rem; }
.rewards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.reward-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px;
               padding: 0.5rem; text-align: center; position: relative; }
.reward-card.reward-ok { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-pale); }
.reward-img { height: 68px; background-size: contain; background-repeat: no-repeat;
              background-position: center; margin-bottom: 0.35rem; }
.reward-name { font-size: 0.72rem; line-height: 1.2; height: 2.4em; overflow: hidden; }
.reward-pts { font-size: 0.8rem; font-weight: 800; color: var(--primary); margin-top: 0.25rem; }
.reward-badge { display: block; font-size: 0.68rem; font-weight: 800; color: #fff;
                background: var(--primary); border-radius: 8px; padding: 0.15rem; margin-top: 0.25rem; }
.reward-missing { display: block; font-size: 0.66rem; color: var(--text-muted); margin-top: 0.25rem; }

.ticket { background: var(--white); border: 1px solid var(--border); border-radius: 14px;
          margin-bottom: 0.55rem; overflow: hidden; }
.ticket-head { display: flex; align-items: center; gap: 0.6rem; width: 100%; background: none;
               border: 0; padding: 0.75rem 0.85rem; text-align: left; cursor: pointer; }
.ticket-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ticket-main span { font-size: 0.78rem; }
.ticket-total { font-weight: 800; color: var(--primary); }
.ticket-arrow { color: var(--text-muted); transition: transform .15s ease; }
.ticket-head.open .ticket-arrow { transform: rotate(90deg); }
.ticket-lines { border-top: 1px solid var(--border); padding: 0.5rem 0.85rem 0.75rem; }
.ticket-line { display: flex; justify-content: space-between; gap: 0.75rem;
               font-size: 0.82rem; padding: 0.22rem 0; }
.ticket-disc { color: var(--primary); font-weight: 800; font-size: 0.72rem; }

.lib-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.lib-book { border-radius: 12px; padding: 0.85rem; color: #fff; display: flex;
            flex-direction: column; gap: 0.25rem; min-height: 120px; }
.lib-title { font-weight: 800; font-size: 0.9rem; line-height: 1.2; }
.lib-brand { font-size: 0.7rem; opacity: 0.85; flex: 1; }
.lib-cta { font-size: 0.78rem; font-weight: 700; }
.lib-c1 { background: linear-gradient(135deg, #E87722, #B34700); }
.lib-c2 { background: linear-gradient(135deg, #3A7D5C, #1F4D38); }
.lib-c3 { background: linear-gradient(135deg, #4A5FA5, #26356B); }
.lib-c4 { background: linear-gradient(135deg, #8A4B8F, #532A57); }

.data-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px;
             padding: 0.35rem 0.85rem; }
.data-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0;
            border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.data-row:last-child { border-bottom: 0; }
.data-row span { color: var(--text-muted); }

/* ─── Barra inferior con 5 ítems ──────────────────────────── */
.nav-item { padding: 0.25rem 0.35rem; font-size: 0.68rem; flex: 1; min-width: 0; }
.nav-icon { position: relative; display: inline-block; }
.nav-label { white-space: nowrap; }
.nav-dot {
    position: absolute; top: -2px; right: -10px; min-width: 17px; height: 17px;
    border-radius: 9px; background: var(--primary); color: #fff;
    font-size: 0.62rem; font-weight: 800; line-height: 17px; text-align: center;
    padding: 0 3px; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* ─── Regalos ─────────────────────────────────────────────── */
.gift-box-big { font-size: 4.5rem; line-height: 1; margin-bottom: 0.5rem; }
.gift-loading, .gift-empty { text-align: center; padding: 2rem 1rem; }
.gift-empty h2 { margin: 0.25rem 0 0.5rem; font-size: 1.15rem; }
.gift-count { text-align: center; color: var(--text-muted); font-size: 0.88rem;
              margin-bottom: 0.9rem; }
.gift-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px;
             padding: 0.95rem; margin-bottom: 0.75rem; }
.gift-card-bday { border-color: var(--primary); background: var(--primary-pale); }
.gift-card-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.gift-card-icon { font-size: 1.8rem; line-height: 1; }
.gift-card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gift-card-title strong { font-size: 1.02rem; line-height: 1.25; }
.gift-valid { font-size: 0.75rem; color: var(--text-muted); }
.gift-pet-photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
                  flex: 0 0 auto; }
.gift-desc { margin: 0.55rem 0 0; font-size: 0.92rem; }
.gift-cond { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--text-muted); }
.gift-code { margin-top: 0.6rem; background: var(--white); border: 1px dashed var(--primary);
             border-radius: 10px; padding: 0.45rem 0.6rem; font-size: 0.85rem;
             text-align: center; letter-spacing: .02em; }

/* ─── PetMatch rediseñado ─────────────────────────────────── */
.signup-card { background: var(--white); border: 1px solid var(--border);
               border-radius: 16px; padding: 1rem; margin-bottom: 1rem; }
.signup-card h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.signup-card textarea { width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--border);
                        border-radius: 10px; font-family: inherit; font-size: 0.95rem; }
.goal-options { display: grid; gap: 0.55rem; margin-top: 0.85rem; }
.goal-opt { display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left;
            background: var(--white); border: 2px solid var(--border); border-radius: 14px;
            padding: 0.75rem 0.85rem; cursor: pointer; }
.goal-opt.sel { border-color: var(--primary); background: var(--primary-pale); }
.goal-emoji { font-size: 1.5rem; }
.goal-body { flex: 1; display: flex; flex-direction: column; }
.goal-label { font-weight: 800; }
.goal-sub { font-size: 0.8rem; color: var(--text-muted); }
.goal-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border);
              color: #fff; font-size: 0.78rem; display: flex; align-items: center;
              justify-content: center; flex: 0 0 auto; }
.goal-opt.sel .goal-check { background: var(--primary); border-color: var(--primary); }
.goal-chip { display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--primary);
             background: var(--primary-pale); border-radius: 8px; padding: 0.12rem 0.45rem;
             margin-top: 0.3rem; }
.my-goal-bar { display: flex; align-items: center; justify-content: space-between;
               gap: 0.5rem; background: var(--primary-pale); border-radius: 12px;
               padding: 0.55rem 0.75rem; font-size: 0.88rem; margin-bottom: 0.8rem; }
.link-btn { background: none; border: 0; color: var(--primary); font-weight: 700;
            cursor: pointer; font-size: 0.85rem; }
.tab-count { font-size: 0.7rem; font-weight: 800; color: var(--primary); }

.feed-grid { display: grid; gap: 0.75rem; }
.feed-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px;
             overflow: hidden; display: flex; }
.feed-photo { width: 118px; height: 100%; min-height: 150px; object-fit: cover; flex: 0 0 118px; }
.feed-body { padding: 0.7rem 0.8rem; flex: 1; min-width: 0; }
.feed-body h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.feed-bio { font-size: 0.82rem; margin: 0.35rem 0 0; }
.feed-owner { font-size: 0.78rem; margin: 0.35rem 0 0.5rem; }
.btn-sent { background: var(--text-muted) !important; }

.req-card, .friend-card { display: flex; gap: 0.75rem; background: var(--white);
                          border: 1px solid var(--border); border-radius: 14px;
                          padding: 0.75rem; margin-bottom: 0.6rem; align-items: center; }
.req-photo { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; flex: 0 0 62px;
             display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.req-body { flex: 1; min-width: 0; }
.req-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.req-actions .btn { flex: 1; }

.pet-photo { position: relative; }
.pet-msg-badge { position: absolute; top: 6px; right: 6px; min-width: 24px; height: 24px;
                 border-radius: 12px; background: var(--primary); color: #fff;
                 font-size: 0.78rem; font-weight: 800; line-height: 24px; text-align: center;
                 padding: 0 5px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.match-alert { display: flex; align-items: center; gap: 0.7rem; background: var(--primary-pale);
               border: 1px solid var(--primary); border-radius: 14px; padding: 0.7rem 0.8rem;
               margin-bottom: 0.75rem; color: var(--text); }
.match-alert-icon { font-size: 1.4rem; }

/* Barra superior en modo "volver" (pagina de planes) */
.petapp-top-banner-volver .petapp-top-banner-text { text-align: center; padding-right: 5rem; }
/* Locales listados en la pagina de planes */
.planes-suc { border-top: 1px solid rgba(255,255,255,.18); padding: .85rem 0 .2rem; }
.planes-suc:first-of-type { border-top: 0; }
.planes-suc-nombre { font-weight: 700; color: var(--primary); margin-bottom: .25rem; }
.planes-suc-dato { font-size: .9rem; opacity: .92; margin-bottom: .2rem; }
.planes-suc-wa { display: inline-block; margin-top: .35rem; font-size: .85rem; font-weight: 600;
                 color: var(--white); background: rgba(255,255,255,.16); border-radius: 20px;
                 padding: .3rem .8rem; text-decoration: none; }

/* ─── Globito de avisos en el header ─────────────────────── */
.app-header { position: relative; }
.header-bell {
    position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%);
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-pale); text-decoration: none;
}
.header-bell-icon { font-size: 1.35rem; line-height: 1; }
.header-bell-badge {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
    border-radius: 9px; background: var(--danger); color: #fff;
    font-size: 0.64rem; font-weight: 800; line-height: 18px; text-align: center;
    padding: 0 4px; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* ─── Avisos (pantalla del globito) ──────────────────────── */
.notif-card { display: flex; gap: 0.6rem; align-items: flex-start;
    background: var(--white); border: 1px solid var(--border); border-radius: 16px;
    padding: 0.9rem; margin-bottom: 0.7rem; color: var(--text); text-decoration: none; }
.notif-unseen { border-color: var(--primary); background: var(--primary-pale); }
.notif-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.notif-body { flex: 1; min-width: 0; }
.notif-body strong { font-size: 0.98rem; line-height: 1.25; display: block; }
.notif-body p { margin: 0.2rem 0 0; font-size: 0.88rem; color: var(--text-muted); }
.notif-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.notif-date { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.notif-arrow { font-weight: 800; color: var(--primary); font-size: 1.1rem; line-height: 1; }

/* ─── Biblioteca como pantalla propia ────────────────────── */
.lib-grid-page .lib-book { min-height: 118px; }

/* ─── Barra inferior con 6 ítems: un toque más compacta ──── */
.nav-item { padding: 0.25rem 0.1rem; font-size: 0.64rem; }
