.hj-dept-all-count,
.hj-dept-badge {
    user-select: none;
    position: absolute;
    color: #303030;
}
.hj-dept-toggle,
.show-more-btn {
    font-family: Anuphan, sans-serif;
    cursor: pointer;
}
.hj-dept-toggle .department-filter {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 40px 0;
    background: #fff;
}
.department-header {
    margin-top: 4rem;
    margin-bottom: 32px;
}
.department-header h2 {
    font-family: Anuphan, sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #000;
    margin: 0;
}
.department-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-height: 515px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
}
.department-grid.expanded {
    max-height: 2000px;
}
.department-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.department-card:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-0.1px);
}
.department-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f2ff;
    border-radius: 50%;
    color: #0071e3;
}
.department-icon-restaurant {

    background: #fff8e8;
}
.department-icon svg {
    width: 24px;
    height: 24px;
}
.department-content {
    flex: 1;
    min-width: 0;
}
.hj-dept-head,
.show-more-btn {
    align-items: center;
    display: flex;
    visibility: hidden;
}
.department-content h3 {
    font-family: Anuphan, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #303030;
    margin: 0 0 4px;
    line-height: 1.3;
}
.department-content p {
    font-family: Anuphan, sans-serif;
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.3;
}
.show-more-btn {
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    padding: 12px 24px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    transition: 0.2s;
}
.show-more-btn:hover {
    background: #f5f5f5;
    border-color: #b0b0b0;
}
.show-more-btn .btn-icon {
    transition: transform 0.3s;
}
.show-more-btn.expanded .btn-icon {
    transform: rotate(180deg);
}
.hj-dept-browser {
    width: 100%;
    position: relative;
    z-index: 0;
    margin-top: 40px;
}
.hj-dept-head {
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}
.hj-dept-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #303030;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hj-dept-title-icon {
    font-size: 20px;
    line-height: 1;
}
.hj-dept-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, 1fr);
}
.hj-dept-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 16px 68px 16px 16px;
    border: 1px solid #e0e6ea;
    border-radius: 14px;
}
.hj-dept-card:hover {
    border-color: #c2e7ff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.hj-dept-card:active,
.hj-dept-toggle:active {
    transform: translateY(1px);
}
.hj-dept-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.hj-dept-card-text {
    min-width: 0;
}
.hj-dept-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #303030;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hj-dept-card-sub {
    font-size: 13px;
    color: #7a7a73;
    padding-top: 8px;
}
.hj-dept-link {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    text-indent: -9999px;
    overflow: hidden;
}
.hj-dept-card:has(.hj-dept-link:focus-visible) {
    outline: #c2e7ff solid 3px;
    outline-offset: 2px;
}
.hj-dept-card.is-wide {
    grid-column: 1/-1;
}
.hj-dept-card.is-all {
    background: #f1f6ff;
    padding-right: 88px;
}
.hj-dept-card.is-all .hj-dept-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #2e6bff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.hj-dept-all-count {
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 800;
    font-size: 24px;
    line-height: 1;
}
.hj-dept-badge {
    right: 16px;
    top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f3f5f7;
    border: 1px solid #e0e6ea;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}
.hj-dept-card,
.hj-dept-toggle {
    background: #fff;
}
.hj-dept-toggle-wrap {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}
.hj-dept-toggle {
    appearance: none;
    border: 1px solid #c2e7ff;
    color: #303030;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 30px;
    border-radius: 999px;
    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s,
        transform 0.02s;
}
.hj-dept-toggle:hover {
    border-color: #fe7743;
}
.hj-dept-toggle:focus-visible {
    outline: #c2e7ff solid 3px;
    outline-offset: 2px;
}
.hj-dept-grid {
    display: grid !important;
}

@media (max-width: 1200px) {
    .department-grid,
    .hj-dept-grid {
        grid-template-columns: 1fr;
    }
    .department-header h2 {
        font-size: 24px;
    }
    .department-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-height: 400px; 
    }
      .department-grid.expanded {
        max-height: 5000px !important; 
    }
    
    .show-more-btn {
        visibility: visible !important;
        display: flex !important;
        position: relative;
        z-index: 10; 
        touch-action: manipulation; 
        -webkit-tap-highlight-color: rgba(0,0,0,0.1); 
    }
    
    .show-more-btn:active {
        background: #e8e8e8;
        transform: scale(0.98);
    }

    .department-card {
        padding: 16px;
        gap: 14px;
    }
    .department-icon {
        width: 44px;
        height: 44px;
    }
    .department-icon svg {
        width: 22px;
        height: 22px;
    }
    .department-content h3 {
        font-size: 18px;
    }
    .department-content p {
        font-size: 12px;
    }
    .show-more-btn {
        font-size: 14px;
        padding: 11px 20px;
    }
    @media (prefers-reduced-motion: reduce) {
        .hj-dept-card,
        .hj-dept-toggle {
            transition: none !important;
        }
    }
}
