/* Explain: Styles for the merchant's item availability panel. */
/* لوحة فتح وغلق الأصناف داخل لوحة التاجر */
.mch-avail {
    overflow: hidden;
}
.mch-avail-sub {
    margin: 0.4rem 0 0;
    max-width: 34rem;
    font-size: 0.86rem;
    line-height: 1.8;
    color: var(--text-muted);
}
.mch-avail-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.mch-avail-head-actions .mk-btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.83rem;
}
.mch-avail-head-actions .mk-btn:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}
.mch-avail-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.15rem;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}
.mch-avail-search {
    flex: 1 1 13rem;
    min-width: 10rem;
    padding: 0.55rem 0.8rem;
}
.mch-avail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.mch-avail-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    font-size: 0.79rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}
.mch-avail-stat b {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--text-color);
}
.mch-avail-stat i {
    font-size: 0.7rem;
}
.mch-avail-stat-open i {
    color: var(--primary-color);
}
.mch-avail-stat-closed i {
    color: #dc2626;
}
.mch-avail-list {
    display: flex;
    flex-direction: column;
    max-height: 26rem;
    overflow-y: auto;
}
.mch-avail-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}
.mch-avail-row:last-child {
    border-bottom: 0;
}
.mch-avail-row:hover {
    background: var(--surface-color);
}
.mch-avail-row.is-closed {
    background: #fffaf3;
}
.mch-avail-row.is-closed:hover {
    background: #fff4e5;
}
.mch-avail-thumb {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    border-radius: 0.7rem;
    overflow: hidden;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--border-color);
    font-size: 1rem;
}
.mch-avail-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mch-avail-info {
    flex: 1;
    min-width: 0;
}
.mch-avail-name {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-color);
    overflow-wrap: anywhere;
}
.mch-avail-meta {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}
.mch-avail-dot {
    margin: 0 0.35rem;
}
.mch-avail-state {
    flex-shrink: 0;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}
.mch-avail-row.is-closed .mch-avail-state {
    color: #b45309;
}

/* مفتاح الفتح والغلق */
.mch-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-height: 2.6rem;
    padding: 0.35rem 0.8rem 0.35rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mch-switch:hover {
    border-color: var(--primary-color);
    color: var(--primary-hover);
}
.mch-switch:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}
.mch-switch[disabled] {
    opacity: 0.6;
    cursor: default;
}
.mch-switch-track {
    position: relative;
    display: block;
    width: 2.2rem;
    height: 1.25rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.2s ease;
}
.mch-switch-thumb {
    position: absolute;
    top: 0.16rem;
    inset-inline-start: 0.16rem;
    width: 0.93rem;
    height: 0.93rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(13, 27, 36, 0.35);
    transition: transform 0.22s ease;
}
.mch-switch.is-on {
    border-color: var(--primary-color);
    background: var(--primary-soft);
    color: var(--primary-hover);
}
.mch-switch.is-on .mch-switch-track {
    background: var(--primary-color);
}
.mch-switch.is-on .mch-switch-thumb {
    transform: translateX(-0.95rem);
}
html[dir="ltr"] .mch-switch.is-on .mch-switch-thumb {
    transform: translateX(0.95rem);
}
.mch-switch-text {
    white-space: nowrap;
}

/* الحالة الفارغة */
.mch-avail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.25rem 1.25rem;
    text-align: center;
}
.mch-avail-empty-ico {
    display: grid;
    place-items: center;
    width: 3.4rem;
    height: 3.4rem;
    margin-bottom: 0.9rem;
    border-radius: 1rem;
    background: var(--primary-soft);
    color: var(--primary-color);
    font-size: 1.4rem;
}
.mch-avail-empty-title {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-color);
}
.mch-avail-empty-text {
    margin: 0.5rem auto 0;
    max-width: 26rem;
    font-size: 0.9rem;
    line-height: 1.85;
    color: var(--text-muted);
}
.mch-avail-empty .mk-btn {
    margin-top: 1rem;
}

/* الموبايل */
@media (max-width: 639px) {
    .mch-avail-head-actions {
        width: 100%;
    }
    .mch-avail-head-actions .mk-btn {
        flex: 1;
        min-height: 2.6rem;
    }
    .mch-avail-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.8rem 0.95rem;
    }
    .mch-avail-search {
        width: 100%;
    }
    .mch-avail-stats {
        justify-content: space-between;
    }
    .mch-avail-list {
        max-height: none;
    }
    .mch-avail-row {
        flex-wrap: wrap;
        gap: 0.5rem 0.65rem;
        padding: 0.8rem 0.95rem;
    }
    .mch-avail-thumb {
        width: 2.6rem;
        height: 2.6rem;
    }
    .mch-avail-info {
        flex: 1 1 60%;
    }
    .mch-avail-state {
        display: none;
    }
    .mch-switch {
        margin-inline-start: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mch-switch,
    .mch-switch-thumb,
    .mch-switch-track,
    .mch-avail-row {
        transition: none;
    }
}