/* =====================================================
        DIR OVERLAY STYLES — full-screen directory takeover
    ====================================================== */

/* FULL-SCREEN OVERLAY */
.dir-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 0.55s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
}

.dir-overlay.open {
    pointer-events: all;
    clip-path: circle(150% at 50% 50%);
}

/* Directory header */
.dir-header {
    background: #121f33;
    padding: 14px 16px 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dir-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dir-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dir-logo-mark {
    width: 34px;
    height: 34px;
    background: #1b2e4b;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dir-logo-mark img {
    width: 20px;
    height: 20px;
}

.dir-brand-txt h2 {
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    line-height: 1.1;
    margin: 0;
}

.dir-brand-txt span {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.dir-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: background 0.18s, transform 0.18s;
    flex-shrink: 0;
}

.dir-close:hover {
    background: rgba(224, 48, 32, 0.3);
    transform: rotate(90deg);
}

/* Chapter filter chips */
.filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
    display: none;
}

.chip {
    flex-shrink: 0;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.18s;
    white-space: nowrap;
}

.chip.active {
    background: #e03020;
    color: #fff;
    border-color: #e03020;
}

.chip.inactive {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Search bar */
.dir-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 8px 12px;
    gap: 8px;
    transition: border-color 0.2s;
}

.dir-search:focus-within {
    border-color: #e03020;
}

.dir-search svg {
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.dir-search input {
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.88rem;
    width: 100%;
}

.dir-search input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

/* Main list area */
.dir-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #f4f6f9;
}

.dir-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0 80px;
    -webkit-overflow-scrolling: touch;
}

.dir-list::-webkit-scrollbar {
    display: none;
}

/* Results bar */
.results-bar {
    padding: 8px 14px 4px;
    font-size: 0.72rem;
    color: #6b7a8d;
    font-weight: 600;
}

.results-bar .total {
    color: #1b2e4b;
}

/* Letter header */
.letter-header {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 8px 14px 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f4f6f9;
}

.lh-letter {
    font-weight: 800;
    font-size: 0.8rem;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1b2e4b;
    color: #fff;
    flex-shrink: 0;
}

.lh-line {
    flex: 1;
    height: 1px;
    background: #e0e6ef;
}

.lh-count {
    font-size: 0.65rem;
    color: #6b7a8d;
    font-weight: 600;
}

/* Biz card */
.biz-card {
    margin: 3px calc(38px + 8px) 3px 46px;
    background: #fff;
    border: 1px solid #e0e6ef;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    animation: cardIn 0.26s ease both;
    position: relative;
    overflow: hidden;
}

.biz-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #e03020;
    transform: scaleY(0);
    transition: transform 0.18s;
    transform-origin: center;
}

.biz-card:active::before,
.biz-card:hover::before {
    transform: scaleY(1);
}

.biz-card:active,
.biz-card:hover {
    transform: translateX(3px);
    box-shadow: 0 3px 14px rgba(27, 46, 75, 0.1);
    border-color: rgba(224, 48, 32, 0.25);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.biz-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.biz-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    background: #f4f6f9;
    border: 1px solid #e0e6ef;
    flex-shrink: 0;
}

.biz-info {
    flex: 1;
    min-width: 0;
}

.biz-name {
    font-weight: 700;
    font-size: 0.8rem;
    color: #1b2e4b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.biz-sector {
    font-size: 0.68rem;
    color: #6b7a8d;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.biz-cap {
    font-size: 0.6rem;
    padding: 2px 7px;
    border-radius: 8px;
    background: #1b2e4b;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 70px;
}

.biz-cap-desktop,
.biz-cap-mobile {
    text-transform: uppercase;
}

@media (max-width: 575px) {
    .biz-card {
        align-items: flex-start;
    }

    .biz-logo,
    .biz-logo-img {
        margin-top: 3px;
    }

    .biz-cap-mobile {
        display: inline-block !important;
    }

    .biz-cap-desktop {
        display: none !important;
    }

    .biz-cap {
        background-color: rgb(105, 115, 131);
        padding: 4px 7px 3px;
    }
}

/* Alpha index */
.alpha-index {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 4px 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.alpha-index::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(244, 246, 249, 0.93);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 1px solid #e0e6ef;
}

.alpha-letter {
    position: relative;
    z-index: 1;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.62rem;
    color: #b0bcc8;
    border-radius: 5px;
    transition: all 0.12s;
    cursor: pointer;
}

.alpha-letter.has-items {
    color: #1b2e4b;
}

.alpha-letter.active {
    background: #1b2e4b;
    color: #fff;
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(27, 46, 75, 0.25);
}

.alpha-letter.empty {
    color: #dde3ec;
    font-size: 0.48rem;
}

/* Bubble */
.dir-bubble {
    position: fixed;
    right: calc(38px + 12px);
    width: 56px;
    height: 56px;
    background: #1b2e4b;
    border: 2px solid #e03020;
    border-radius: 50% 50% 50% 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.6rem;
    color: #e03020;
    box-shadow: 0 6px 20px rgba(27, 46, 75, 0.35);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.5) translateX(14px);
    transition: opacity 0.14s, transform 0.14s;
    z-index: 10001;
}

.dir-bubble.visible {
    opacity: 1;
    transform: scale(1) translateX(0);
}

/* Detail sheet */
.det-panel {
    position: fixed;
    inset: 0;
    z-index: 10002;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s;
}

.det-panel.open {
    pointer-events: all;
    opacity: 1;
}

.det-overlay {
    position: absolute;
    inset: 0;
    background: rgba(18, 31, 51, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.det-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 18px 20px 40px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
    border-top: 3px solid #e03020;
}

.det-panel.open .det-sheet {
    transform: translateY(0);
}

.det-handle {
    width: 36px;
    height: 4px;
    background: #e0e6ef;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.det-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 30px;
    height: 30px;
    background: #f4f6f9;
    border: 1px solid #e0e6ef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7a8d;
    font-size: 0.85rem;
    font-weight: 700;
}

.det-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.det-logo {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}

.det-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: #1b2e4b;
    line-height: 1.2;
    margin-bottom: 3px;
}

.det-sector {
    font-size: 0.75rem;
    color: #6b7a8d;
}

.det-cap {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: #1b2e4b;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
}

.det-divider {
    height: 1px;
    background: #e0e6ef;
    margin: 14px 0;
}

.det-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    color: #444;
    margin-bottom: 9px;
}

.det-row svg {
    flex-shrink: 0;
    color: #e03020;
    margin-top: 1px;
}

.det-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.det-btn {
    flex: 1;
    padding: 11px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.14s, opacity 0.14s;
}

.det-btn:active {
    transform: scale(0.96);
}

.det-btn.primary {
    background: #1b2e4b;
    color: #fff;
}

.det-btn.profile {
    background: #e03020;
    color: #fff;
}

/* Empty state */
.dir-empty {
    display: none;
    text-align: center;
    padding: 50px 20px;
    color: #6b7a8d;
}

.dir-empty p {
    font-size: 0.88rem;
}

.dir-empty small {
    font-size: 0.72rem;
    color: #b0bcc8;
}

/* END DIR OVERLAY STYLES */