/* common.css */

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.a {
    color: var(--accent);
    text-decoration: none
}

.a:hover {
    text-decoration: underline
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    color: var(--text);
    cursor: pointer;
    background: color-mix(in srgb, var(--accent) 20%, transparent);
}
.btn.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:hover {
    background: color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--text);
}

.badge {
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 3px 8px;
    border-radius: 999px
}

.h1 {
    font-size: 22px;
    margin: 0 0 10px;
    color: var(--text);
}

.h2 {
    font-size: 16px;
    margin: 0 0 8px;
    color: var(--muted)
}

.input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(0, 0, 0, .18);
    color: var(--text)
}

hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    margin: 14px 0;
    color: var(--text);
}

.product {
    display: flex;
    gap: 12px
}

.product img {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, .10)
}

.price {
    font-weight: 700
}

.small {
    font-size: 12px;
    color: var(--muted)
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    top: 10%;
    right: 30%;
    padding: 4px 10px;
    font-size: 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.scroll-hint.show {
    opacity: 1;
    transform: translateX(0);
}

.scroll-hint.show {
    border-color: var(--accent);
}

/* Prevent text selection while dragging table rows */
.sortable-chosen,
.sortable-drag {
    user-select: none;
    -webkit-user-select: none;
    /* Safari */
    -ms-user-select: none;
    /* Old Edge */
}

/* Tree container */
.cat-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 6px;
}

/* Each node */
.cat-node {
    border-radius: 10px;
    margin: 4px 0;
    border: 1px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 20%);
    color: var(--text);
}


.cat-node:has(> .cat-row .in-active-badge),
.cat-node:has(> .cat-row .not-published-badge) {
    opacity: 0.5;
}


.cat-node:has(.in-active-badge),
.cat-node:has(.not-published-badge) {
    display: none !important;
}

.cat-node:has(.in-active-badge.show),
.cat-node:has(.not-published-badge.show) {
    display: block !important;
    /* opacity: 0%; */
}

.in-active-badge.show,
.not-published-badge.show {
    display: inline-block !important;
}

/* cat-tree min width for large screens */
@media (min-width: 1024px) {
    .cat-tree {
        min-width: 600px;
    }
}

/* Row */
.cat-row {
    /* display: grid; */
    /* grid-template-columns: 24px 1fr 90px; */
    /* display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 12px; */
}

/* .cat-row .badges:has(.in-active-badge) {
    display: none !important;
} */


/* Handle */
.cat-handle {
    cursor: grab;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
}

/* Children container (indent) */
.cat-children {
    padding: 0 4px 10px 22px;
    /* margin-left: 12px; */
    border-left: 1px dashed rgba(255, 255, 255, .12);
}

/* .cat-children margin left only if screen lg. */
@media (min-width: 1024px) {
    .cat-children {
        margin-left: 12px;
    }
}

/* default: hide */
.cat-icon {
    display: none;
}

/* show icon if this cat-node has at least one child cat-node */
.cat-node:has(> .cat-children > .cat-node)>.cat-row>.d-flex>.cat-icon {
    display: block;
}

.in-active-badge,
.not-published-badge {
    background: var(--accent);
    border: var(--text);
    color: var(--text);
    font-weight: 100;
}


/* Prevent text selection while dragging */
.sortable-chosen,
.sortable-drag {
    user-select: none;
    -webkit-user-select: none;
}