/* =============================================
   Negocios.css — Modern App Design
   Prefix: neg-
=============================================== */

#tmNegocios {
    max-width: 100%;
    overflow-x: hidden;
}

/* ??????????????????????????????????????????
   BREADCRUMB
?????????????????????????????????????????? */
.neg-breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.neg-bc-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s;
}
.neg-bc-link i { font-size: .7rem; }
.neg-bc-link:hover { color: var(--accent-primary); }
.neg-bc-sep { font-size: .58rem; color: var(--text-muted); opacity: .45; }
.neg-bc-current {
    font-size: .78rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: capitalize;
}

/* ??????????????????????????????????????????
   HEADER
?????????????????????????????????????????? */
.neg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 60%, #075985 100%);
    border-radius: var(--radius-lg);
    padding: 2.2rem 2.2rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.neg-header::before {
    content: '';
    position: absolute;
    width: 340px; height: 340px;
    background: rgba(255,255,255,.055);
    border-radius: 50%;
    top: -130px; right: -90px;
    pointer-events: none;
}
.neg-header::after {
    content: '';
    position: absolute;
    width: 180px; height: 180px;
    background: rgba(255,255,255,.035);
    border-radius: 50%;
    bottom: -55px; left: 28%;
    pointer-events: none;
}

.neg-header-text { position: relative; z-index: 1; }

.neg-header-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.22);
    color: rgba(255,255,255,.92);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .3rem .9rem;
    border-radius: var(--radius-pill);
    margin-bottom: .9rem;
    backdrop-filter: blur(6px);
}
.neg-header-eyebrow i { font-size: .68rem; }

.neg-header-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    color: #fff !important;
    margin: 0 0 .45rem;
    letter-spacing: -.035em;
    line-height: 1;
}
.neg-header-sub {
    font-size: .88rem;
    color: rgba(255,255,255,.7) !important;
    margin: 0;
    line-height: 1.55;
    max-width: 400px;
}

/* Right visual */
.neg-header-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .65rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.neg-header-icon-ring {
    width: 76px; height: 76px;
    background: rgba(255,255,255,.11);
    border: 1.5px solid rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem;
    color: rgba(255,255,255,.88);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.15);
}
.neg-header-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,.11);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: var(--radius-md);
    padding: .45rem 1rem;
    backdrop-filter: blur(8px);
    min-width: 72px;
}
.neg-header-badge-num {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    letter-spacing: -.03em;
}
.neg-header-badge-lbl {
    font-size: .6rem;
    font-weight: 700;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 2px;
}

/* ??????????????????????????????????????????
   TOOLBAR
?????????????????????????????????????????? */
.neg-toolbar {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}
.neg-search-wrap {
    position: relative;
    flex: 1;
    max-width: 440px;
    min-width: 180px;
}
.neg-search-icon {
    position: absolute;
    left: 1rem; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .9rem;
    pointer-events: none;
    transition: color .15s;
}
.neg-search-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-soft);
    border-radius: var(--radius-pill);
    padding: .68rem 2.6rem .68rem 2.5rem;
    font-size: .93rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-shadow: var(--shadow-soft);
}
.neg-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}
.neg-search-wrap:focus-within .neg-search-icon { color: var(--accent-primary); }
.neg-search-input::placeholder { color: var(--text-muted); }
.neg-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.neg-search-clear {
    position: absolute;
    right: .55rem; top: 50%;
    transform: translateY(-50%);
    width: 26px; height: 26px;
    border: none; border-radius: 50%;
    background: var(--bg-surface-2);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: .7rem;
    transition: var(--trans-fast);
}
.neg-search-clear:hover { background: #fee2e2; color: #ef4444; }

.neg-count-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    padding: .52rem 1rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
}
.neg-count-badge i { color: var(--accent-primary); font-size: .74rem; }

/* Token row */
.neg-token-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin-bottom: 1rem;
    animation: neg-fade-in .18s ease;
}
.neg-token {
    display: inline-flex;
    align-items: center;
    background: rgba(14,165,233,.1);
    color: #0284c7;
    border: 1px solid rgba(14,165,233,.25);
    border-radius: var(--radius-pill);
    font-size: .72rem;
    font-weight: 700;
    padding: .18rem .7rem;
}
.neg-token-hint {
    font-size: .72rem;
    color: var(--text-muted);
}

/* ??????????????????????????????????????????
   GRID
?????????????????????????????????????????? */
.neg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

/* ??????????????????????????????????????????
   CARD — entrance + hover
?????????????????????????????????????????? */
@keyframes neg-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes neg-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.neg-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    position: relative;
    animation: neg-card-in .35s ease both;
}

/* Top accent line */
.neg-card::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), #0369a1);
    flex-shrink: 0;
    transition: height .2s ease;
}

.neg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 36px rgba(14,165,233,.13);
    border-color: rgba(14,165,233,.25);
}
.neg-card:hover::before { height: 4px; }

/* ?? Photo container ?? */
.neg-card-photo {
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--bg-surface-2);
    position: relative;
    flex-shrink: 0;
}

/* Branded fallback — always behind the img */
.neg-card-photo-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    z-index: 0;
}
.neg-card-photo-fallback span {
    font-size: 2.8rem;
    font-weight: 900;
    color: #0369a1;
    opacity: .35;
    line-height: 1;
    letter-spacing: -.04em;
    user-select: none;
}

/* The real image — sits on top of fallback */
.neg-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .2s ease;
    z-index: 1;
}
.neg-card:hover .neg-card-img { transform: scale(1.05); }

/* When img fails to load — hide it, fallback shows through */
.neg-card-img.neg-img-error {
    opacity: 0;
    pointer-events: none;
}

/* Subtle gradient overlay */
.neg-card-photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(13,27,42,.15) 0%, transparent 55%);
    pointer-events: none;
    z-index: 2;
}

/* Body */
.neg-card-body {
    padding: .85rem 1rem .7rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.neg-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.neg-card:hover .neg-card-title { color: var(--accent-primary); }

.neg-card-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    font-size: .76rem;
    color: var(--text-muted);
}
.neg-card-rating {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-weight: 700;
    color: #d97706;
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.18);
    border-radius: var(--radius-pill);
    padding: .12rem .55rem;
    font-size: .73rem;
    flex-shrink: 0;
}
.neg-card-rating i { font-size: .65rem; }
.neg-card-dot { opacity: .35; }
.neg-card-addr {
    display: flex;
    align-items: center;
    gap: .25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    font-size: .74rem;
}
.neg-card-addr i { flex-shrink: 0; color: var(--accent-primary); font-size: .65rem; }

/* Footer CTA */
.neg-card-footer {
    padding: .6rem 1rem .8rem;
    border-top: 1px solid var(--border-soft);
}
.neg-card-cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--accent-primary);
    transition: gap .18s ease;
}
.neg-card-cta i { font-size: .7rem; transition: transform .18s ease; }
.neg-card:hover .neg-card-cta { gap: .6rem; }
.neg-card:hover .neg-card-cta i { transform: translateX(3px); }

/* Skeleton */
.neg-card--skeleton {
    pointer-events: none;
    animation: none;
}
.neg-card--skeleton::before { display: none; }
.neg-card-photo.shimmer { aspect-ratio: 3/2; width: 100%; display: block; border-radius: 0; }

/* ??????????????????????????????????????????
   EMPTY STATE
?????????????????????????????????????????? */
.neg-empty {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: .9rem;
    margin-top: .5rem;
    animation: neg-fade-in .25s ease;
}
.neg-empty-icon {
    width: 52px; height: 52px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.neg-empty strong { display: block; color: var(--text-primary); margin-bottom: .25rem; }
.neg-empty p { margin: 0; font-size: .83rem; color: var(--text-muted); }

/* ??????????????????????????????????????????
   DESKTOP ?992px
?????????????????????????????????????????? */
@media (min-width: 992px) {
    .neg-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
}

/* ??????????????????????????????????????????
   MOBILE ?767px
?????????????????????????????????????????? */
@media (max-width: 767.98px) {
    .neg-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem;
        padding: 1.5rem 1.25rem 1.6rem;
    }
    .neg-header-right {
        flex-direction: row;
        align-items: center;
        width: 100%;
        gap: .85rem;
    }
    .neg-header-icon-ring { width: 54px; height: 54px; font-size: 1.35rem; }
    .neg-header-title { font-size: 1.8rem !important; }

    .neg-toolbar { gap: .6rem; margin-bottom: .6rem; }
    .neg-search-wrap { max-width: 100%; min-width: unset; }

    .neg-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }

    .neg-card-title { font-size: .9rem; }
    .neg-card-body { padding: .7rem .8rem .55rem; }
    .neg-card-footer { padding: .5rem .8rem .65rem; }
    .neg-count-badge { font-size: .72rem; padding: .42rem .85rem; }
}

@media (max-width: 400px) {
    .neg-grid { grid-template-columns: 1fr; }
}
