/* ===== OUTER ===== */
.directory-search-block {
    background-color: #EFECE3;
    padding: 75px 0;
}

/* ===== FILTER / SEARCH BAR ===== */
.search-filter-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    gap: 20px;
    flex-wrap: nowrap;
}

.category-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 8px 14px;
    background: transparent;
    border: 1.5px solid #000;
    border-radius: 999px;
    font-family: Arboria;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #000;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.category-pill.active,
.category-pill:hover {
    background: #000;
    color: #fff;
}

/* ===== CATEGORY DROPDOWN (overflow fallback) ===== */
.category-dropdown {
    display: none;
    position: relative;
    flex-shrink: 0;
}

.cat-dd-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: transparent;
    border: 1.5px solid #000;
    border-radius: 999px;
    font-family: Arboria;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #000;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background 0.15s, color 0.15s;
}

.cat-dd-toggle[aria-expanded="true"] {
    background: #000;
    color: #fff;
}

.cat-dd-toggle[aria-expanded="true"] .cat-dd-arrow path {
    fill: #fff;
}

.cat-dd-arrow {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.cat-dd-toggle[aria-expanded="true"] .cat-dd-arrow {
    transform: rotate(180deg);
}

.cat-dd-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #000;
    border-radius: 8px;
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.cat-dd-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cat-dd-item {
    padding: 10px 16px;
    font-family: Arboria;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #000;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.1s, color 0.1s;
}

.cat-dd-item:last-child {
    border-bottom: none;
}

.cat-dd-item:hover,
.cat-dd-item.active {
    background: #000;
    color: #fff;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    padding: 0;
}

#directory-search {
    background: transparent;
    border: none;
    border-bottom: 1px solid #000;
    font-family: Arboria;
    font-size: 16px;
    padding: 4px 0;
    outline: none;
    min-width: 180px;
    color: #000;
}

/* ===== 3-COLUMN LAYOUT ===== */
.directory-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start; /* each column is independently tall */
    width: 100%;
}

.directory-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 50px;
}

/* ===== CARD ===== */
.directory-item {
    width: 100%;
}

.directory-item-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.directory-item-category {
    display: inline-flex;
    border: 1px solid #000;
    padding: 3px 8px;
    font-family: Arboria;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
}

.directory-item-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin-bottom: 14px;
}

.biz-icon-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 88px;
    height: 88px;
    object-fit: contain;
    pointer-events: none;
}

.directory-item-image img:not(.biz-icon-overlay) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Header: name/location on left, arrow on right */
.directory-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #000;
    padding-bottom: 12px;
    cursor: pointer;
}

.directory-item-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.directory-name {
    font-family: Arboria;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
    line-height: 1.2;
}

.directory-location {
    font-family: Arboria;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--Primary-Red, #CB3727);
    line-height: 1.2;
}

/* Arrow */
.directory-item-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.directory-item-toggle svg {
    transition: transform 0.3s ease;
    transform: rotate(180deg); /* up = collapsed */
}

.directory-item.active .directory-item-toggle svg {
    transform: rotate(0deg); /* down = expanded */
}

/* ===== DROPDOWN — smooth height via CSS grid-row trick ===== */
.dir-search-dropdown {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.directory-item.active .dir-search-dropdown {
    grid-template-rows: 1fr;
}

.dir-search-dropdown-inner {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Add padding and bottom border only when open */
.directory-item.active .dir-search-dropdown-inner {
    padding: 18px 0 20px;
    border-bottom: 1px solid #000;
}

.dir-search-about {
    font-family: Arboria;
    font-size: 16px;
    line-height: 1.6;
    color: #000;
}

.dir-search-about p {
    margin: 0;
}

.dir-search-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dir-search-info-label {
    font-family: Arboria;
    font-size: 16px;
    font-weight: 700;
    color: #000;
}

.dir-search-info-value {
    font-family: Arboria;
    font-size: 15px;
    line-height: 1.55;
    color: #333;
}

.dir-search-info-value p {
    margin: 0;
}

.dir-search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}

.dir-search-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    background: var(--Primary-Red, #CB3727);
    color: #fff;
    font-family: Arboria;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.dir-search-btn:hover {
    opacity: 0.85;
    color: #fff;
}

/* ===== NO RESULTS ===== */
.no-results {
    text-align: center;
    font-family: Arboria;
    font-size: 18px;
    color: #666;
    padding: 40px 0;
    width: 100%;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .directory-columns {
        gap: 16px;
    }

    .directory-col {
        gap: 30px;
    }
}

@media (max-width: 640px) {
    .directory-search-block {
        padding: 0;
    }

    .directory-item-categories {
        margin-bottom: 8px;
    }

    .directory-col {
        gap: 48px;
    }

    .search-filter-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 30px;
    }

    .search-box {
        width: 100%;
        order: 2;
    }

    #directory-search {
        width: 100%;
    }

    /* Force mobile dropdown regardless of overflow measurement */
    #category-pills { display: none !important; }
    #category-dropdown {
        display: block !important;
        width: 100%;
        order: 1;
    }

    .cat-dd-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 12px 16px;
        background: #CB3727;
        color: #fff;
        border: 1px solid #fff;
        border-radius: 22px;
        font-family: Arboria;
        font-size: 16px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        cursor: pointer;
        position: relative;
        white-space: nowrap;
    }

    .cat-dd-label {
        flex: 1;
        text-align: center;
    }

    .cat-dd-arrow {
        position: absolute;
        right: 16px;
    }

    .cat-dd-arrow path { fill: #fff; }

    .cat-dd-toggle[aria-expanded="true"] .cat-dd-arrow path { fill: #fff; }

    .cat-dd-menu {
        left: 0;
        right: 0;
        min-width: unset;
    }
}
