/* ============================================
   BICONOW — Componentes reutilizáveis
   ============================================ */

/* --- Badges --- */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge-urgent { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.badge-new { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.badge-premium { background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%); color: #a16207; border-color: #fde68a; }
.badge-verified { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge-looking { background: var(--looking-bg); color: var(--looking-text); border-color: var(--border-color); }
.badge-offering { background: var(--offering-bg); color: var(--offering-text); border-color: rgba(106, 153, 105, 0.2); }
.badge-category { background: #f1f5f9; color: var(--dark); border-color: rgba(0, 0, 0, 0.04); }
.badge-active-now { background: #ecfdf5; color: #059669; }
.badge-fast-reply { background: #f0f9ff; color: #0369a1; }
.badge-top-rated { background: #faf5ff; color: #7c3aed; }

/* --- Reputação --- */
.reputation-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #f59e0b;
    font-size: 13px;
    font-weight: 700;
}
.stars i { font-size: 12px; }
.stars-muted { color: var(--text-muted); font-weight: 600; font-size: 12px; margin-left: 4px; }

/* --- Botões --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-input);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(106, 153, 105, 0.25); }
.btn-dark { background: var(--dark); color: white; }
.btn-dark:hover { opacity: 0.92; transform: translateY(-2px); }
.btn-outline {
    background: white;
    color: var(--dark);
    border: 2px solid var(--border-color);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-whatsapp { background: #25d366; color: white; }
.btn-whatsapp:hover { background: #1da851; }
.btn-sm { padding: 10px 16px; font-size: 13px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* --- Cards de serviço (feed) --- */
.service-card {
    background: white;
    border-radius: var(--radius-card);
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
    color: inherit;
}
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-premium);
    border-color: rgba(106, 153, 105, 0.2);
}
.service-card.is-premium {
    border-color: rgba(214, 158, 70, 0.28);
    box-shadow:
        0 12px 30px rgba(23, 32, 51, 0.075),
        0 0 0 1px rgba(214, 158, 70, 0.08);
}
.service-card.is-premium::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(214, 158, 70, 0.1);
}
.service-card__media {
    position: relative;
    height: 140px;
    background: #f1f5f9;
    overflow: hidden;
}
.service-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.service-card:hover .service-card__media img { transform: scale(1.04); }
.service-card__badges-top {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.service-card__badges-top .badge-pill {
    min-height: 26px;
    padding: 5px 9px;
    font-size: 10px;
    letter-spacing: 0.02em;
}
.service-card__distance-pill {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 800;
    color: var(--dark);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.service-card__distance-pill i { color: var(--primary); font-size: 11px; }
.service-card__body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.service-card__info-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 4px 0 14px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
}
.service-card__time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.service-card__mini-pill {
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(23, 32, 51, 0.06);
    background: #f8fafc;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}
.service-card__mini-pill.is-offering {
    background: #eef7f0;
    border-color: rgba(106, 153, 105, 0.16);
    color: var(--primary-dark);
}
.service-card__mini-pill.is-looking {
    background: #f3f6fb;
    color: #40516a;
}
.service-card__mini-pill.is-category {
    background: white;
}
.service-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.service-card__meta .distance { display: flex; align-items: center; gap: 4px; }
.service-card__meta .distance i { color: var(--primary); }
.service-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.service-card__title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--dark);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}
.service-card__desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}
.service-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.service-card__price strong {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}
.service-card__price small {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}
.service-card__cta {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--primary-light);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}
.service-card:hover .service-card__cta {
    background: var(--primary);
    color: white;
}

/* --- Avatar --- */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    background: var(--primary);
    flex-shrink: 0;
    position: relative;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 88px; height: 88px; font-size: 32px; }
.avatar-verified::after {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* --- Notificações dropdown --- */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(360px, calc(100vw - 32px));
    background: white;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-premium);
    border: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 200;
    max-height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.notif-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.notif-dropdown__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notif-dropdown__header h3 { font-size: 16px; font-weight: 800; }
.notif-dropdown__list { overflow-y: auto; flex: 1; }
.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    width: 100%;
    border-left: none;
    border-right: none;
    border-top: none;
    background: white;
    font-family: inherit;
}
.notif-item:hover { background: var(--bg-app); }
.notif-item.unread { background: #fafdfa; }
.notif-item__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.notif-item__icon.interest { background: var(--offering-bg); color: var(--primary); }
.notif-item__icon.message { background: #eff6ff; color: #3b82f6; }
.notif-item__icon.expire { background: #fff7ed; color: #ea580c; }
.notif-item__icon.done { background: #f0fdf4; color: #16a34a; }
.notif-item__body strong { display: block; font-size: 13px; margin-bottom: 2px; color: var(--dark); }
.notif-item__body span { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.notif-item__time { font-size: 10px; color: var(--text-muted); margin-top: 4px; display: block; }

/* --- Busca avançada panel --- */
.search-panel {
    background: white;
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    display: none;
}
.search-panel.open { display: block; animation: slideDown 0.3s ease; }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.search-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.suggestion-chip {
    padding: 8px 14px;
    border-radius: 100px;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.suggestion-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.filter-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.filter-group select,
.filter-group input {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-input);
    border: 2px solid #f1f5f9;
    font-family: var(--font-body);
    font-size: 14px;
    background: #f8fafc;
}

/* --- Estados --- */
.state-empty,
.state-error,
.state-offline {
    text-align: center;
    padding: 48px 24px;
    border-radius: var(--radius-card);
    background: white;
    box-shadow: var(--shadow-sm);
}
.state-empty__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: var(--bg-app);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-muted);
}
.state-empty h3 { font-size: 18px; margin-bottom: 8px; }
.state-empty p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card { height: 320px; border-radius: var(--radius-card); }

/* --- Toast --- */
.toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--dark);
    color: white;
    padding: 14px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-premium);
    animation: toastIn 0.35s ease;
    pointer-events: auto;
}
.toast.success { background: var(--primary-dark); }
.toast.error { background: #dc2626; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Seções premium feed --- */
.section-block { margin-bottom: 40px; }
.section-block__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    gap: 12px;
}
.section-block__head h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.section-block__head p { font-size: 13px; color: var(--text-muted); }
.premium-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.premium-scroll .service-card { min-width: 300px; scroll-snap-align: start; }

/* --- Sticky mobile CTA --- */
.sticky-cta-mobile {
    display: none;
    position: fixed;
    bottom: 88px;
    left: 16px;
    right: 16px;
    z-index: 90;
    gap: 10px;
}
@media (max-width: 767px) {
    .sticky-cta-mobile.is-visible { display: flex; }
}

/* --- Component refinement layer --- */
.badge-pill {
    min-height: 24px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.03em;
}

.btn {
    min-height: 46px;
    border-radius: 14px;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.btn-dark {
    background: linear-gradient(180deg, var(--dark-soft) 0%, var(--dark) 100%);
}

.btn-outline {
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.btn-whatsapp {
    background: linear-gradient(180deg, #2bd66f 0%, #18a957 100%);
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.22);
}

.service-card {
    border-radius: 22px;
    border-color: rgba(23, 32, 51, 0.07);
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.055);
}

.service-card.is-premium {
    border-color: rgba(214, 158, 70, 0.3);
    background: #ffffff;
    box-shadow:
        0 14px 34px rgba(23, 32, 51, 0.075),
        0 0 0 1px rgba(214, 158, 70, 0.08);
}

.service-card.is-premium::before {
    z-index: 2;
    box-shadow: inset 0 0 0 1px rgba(214, 158, 70, 0.13);
}

.service-card.is-premium::after {
    content: none;
}

.service-card.is-premium > * {
    position: relative;
}

.service-card.is-premium:hover {
    border-color: rgba(214, 158, 70, 0.42);
    box-shadow:
        0 18px 44px rgba(23, 32, 51, 0.105),
        0 0 0 1px rgba(214, 158, 70, 0.13);
}

.service-card.is-premium .badge-premium {
    background: rgba(255, 248, 225, 0.95);
    border-color: rgba(214, 158, 70, 0.28);
    color: #8a5a0a;
    box-shadow: 0 5px 14px rgba(23, 32, 51, 0.08);
}

.service-card.is-premium .service-card__media::before {
    content: none;
}

.service-card.is-premium .service-card__badges-top,
.service-card.is-premium .service-card__distance-pill {
    z-index: 2;
}

.service-card.is-premium .service-card__price small {
    color: var(--text-muted);
}

.service-card.is-premium .service-card__cta {
    background: #e9f3ea;
    border: 1px solid rgba(106, 153, 105, 0.16);
    color: var(--primary-dark);
}

.service-card:hover {
    transform: translateY(-4px);
}

.service-card__media {
    height: 164px;
}

.service-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(23, 32, 51, 0.02) 35%, rgba(23, 32, 51, 0.18) 100%);
    pointer-events: none;
}

.service-card__badges-top {
    align-items: flex-start;
    z-index: 2;
}

.service-card__distance-pill {
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.65);
}

.service-card__body {
    padding: 18px;
}

.service-card__meta {
    margin-bottom: 8px;
}

.service-card__title {
    font-size: 18px;
    letter-spacing: -0.02em;
}

.service-card__info-row {
    margin-top: 2px;
    margin-bottom: 14px;
}

.service-card__footer {
    gap: 14px;
}

.service-card__footer > div:first-child {
    min-width: 0;
}

.service-card__price {
    flex-shrink: 0;
    position: relative;
    text-align: right;
}

.service-card__price strong {
    font-size: 23px;
    position: relative;
    z-index: 1;
    line-height: 1.05;
}

.service-card__price small {
    position: relative;
    z-index: 1;
    letter-spacing: 0.03em;
}

.service-card__cta {
    min-height: 42px;
    border-radius: 13px;
    border: 1px solid rgba(106, 153, 105, 0.14);
    color: var(--primary-dark);
    font-weight: 800;
}

.service-card:hover .service-card__cta,
.service-card.is-premium:hover .service-card__cta {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.search-panel,
.state-empty,
.state-error,
.state-offline,
.notif-dropdown,
.review-card,
.profile-mini-card,
.stat-card,
.activity-card,
.notif-card {
    border: 1px solid rgba(23, 32, 51, 0.07);
}

.skeleton-card {
    min-height: 336px;
}

@media (max-width: 520px) {
    .service-card__media {
        height: 150px;
    }

    .service-card__body {
        padding: 16px;
    }

    .service-card__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .service-card__price {
        text-align: left;
    }
}
