/* ============================================================
   ICA Nav Widget – Frontend Styles
   ============================================================ */

.ica-nav-widget {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    font-family: inherit;
    background: #fff;
    max-width: 320px;
}

/* Header vàng */
.ica-nav-widget-header {
    background: #c8a000;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    text-transform: uppercase;
}

/* Toolbar (icons hành động) */
.ica-nav-widget-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    min-height: 38px;
}

.ica-nav-toolbar-left,
.ica-nav-toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ica-nav-back-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #444;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.ica-nav-back-btn:hover {
    background: #f5f5f5;
    color: #000;
}

.ica-nav-tool-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 16px;
    transition: background 0.15s;
}

.ica-nav-tool-btn:hover {
    background: #f0f0f0;
}

/* Container slide 2 view */
.ica-nav-slider-wrap {
    position: relative;
    overflow: hidden;
    /* Height được set bởi JS để khớp với view đang hiển thị */
    transition: height 0.3s ease;
}

/* Cả 2 view đều absolute – JS quản lý height wrapper */
.ica-nav-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Main view: mặc định hiển thị */
.ica-nav-main-view {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Sub view: ẩn bên phải */
.ica-nav-sub-view {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* Khi đang ở sub view */
.ica-nav-widget.show-sub .ica-nav-main-view {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.ica-nav-widget.show-sub .ica-nav-sub-view {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Cuộn nếu nhiều items */
.ica-nav-scroll {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.ica-nav-scroll::-webkit-scrollbar {
    width: 5px;
}

.ica-nav-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* ---- Mục "All" ---- */
.ica-nav-all-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}

.ica-nav-all-row:hover {
    background: #fafafa;
}

/* ---- Mục chính ---- */
.ica-nav-main-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.ica-nav-main-item:last-child {
    border-bottom: none;
}

.ica-nav-main-item:hover {
    background: #fafafa;
}

/* Icon tag màu */
.ica-nav-tag-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ica-nav-tag-icon svg {
    width: 18px;
    height: 18px;
}

/* Tên mục chính */
.ica-nav-main-label {
    flex: 1;
    font-size: 13.5px;
    font-weight: 600;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Số lượng mục phụ */
.ica-nav-count-badge {
    background: #f0f0f0;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 7px;
    flex-shrink: 0;
}

/* Mũi tên phải */
.ica-nav-arrow {
    color: #aaa;
    font-size: 14px;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.ica-nav-main-item:hover .ica-nav-arrow {
    transform: translateX(3px);
    color: #666;
}

/* ---- Sub-items view ---- */
.ica-nav-sub-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13.5px;
    color: #333;
    text-decoration: none;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s;
}

.ica-nav-sub-item:last-child {
    border-bottom: none;
}

.ica-nav-sub-item:hover {
    background: #f7f7f7;
    color: #c8a000;
}
