/* Shared interaction states: toasts, timelines, onboarding, gallery, drawers, tables */

.toast-stack {
    position: fixed;
    right: 16px;
    bottom: 88px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(360px, calc(100vw - 24px));
}
.toast-item {
    background: white;
    border: 1px solid var(--color-line);
    border-left: 4px solid var(--brand-burgundy);
    border-radius: var(--vy-radius-sm);
    padding: 12px 14px;
    box-shadow: var(--vy-shadow);
    font-size: 0.95rem;
}
.toast-item.is-error { border-left-color: var(--color-danger); }
.toast-item.is-warning { border-left-color: var(--color-warning); }
.toast-item.is-success { border-left-color: var(--color-success); }

.demo-banner {
    background: var(--brand-rose);
    color: var(--brand-wine-dark);
    font-size: 0.84rem;
    font-weight: 700;
    padding: 8px 16px;
    text-align: center;
    border-bottom: 1px solid var(--color-line);
}

.skeleton {
    background: linear-gradient(90deg, #efe8f2 25%, #f8f4fa 50%, #efe8f2 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: 8px;
    min-height: 14px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
    position: relative;
    padding: 0 0 16px 28px;
    border-left: 2px solid var(--color-line);
    margin-left: 8px;
}
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e4dce8;
    border: 2px solid white;
}
.timeline li.is-done::before { background: var(--brand-burgundy); }
.timeline li.is-current::before { background: var(--brand-purple); }

.onboard-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.onboard-steps a, .onboard-steps span {
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid var(--color-line);
    background: white;
    text-decoration: none;
    color: var(--color-ink);
    font-size: 0.9rem;
    font-weight: 700;
}
.onboard-steps .is-done { background: var(--brand-rose); border-color: #e0c9d2; color: var(--brand-burgundy); }
.onboard-steps .is-current { background: var(--brand-burgundy); color: white; border-color: var(--brand-burgundy); }

.thumb-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb-row button {
    width: 64px;
    height: 64px;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    background: transparent;
}
.thumb-row button.is-active { border-color: var(--brand-burgundy); }
.thumb-row .studio { min-height: 64px; }

.suggest-status { padding: 8px 10px; color: var(--color-muted); font-size: 0.9rem; }

.progress-bar {
    height: 8px;
    background: #e4dce8;
    border-radius: 99px;
    overflow: hidden;
    margin: 8px 0 16px;
}
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-burgundy), var(--brand-purple)); }

.table-scroll { overflow-x: auto; }
.mobile-cards { display: none; }

.checkout-sticky {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 26;
    background: white;
    border-top: 1px solid var(--color-line);
    box-shadow: 0 -8px 24px rgba(74, 21, 40, 0.06);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}

.btn.is-busy { opacity: 0.7; pointer-events: none; }
.btn.is-busy::after { content: "…"; }

.cat-drawer .dept-block { margin-bottom: 16px; }
.cat-drawer .dept-block h2 { font-size: 1rem; margin-bottom: 6px; }
.cat-drawer .dept-block h2 a { color: var(--color-ink); text-decoration: none; }
.cat-drawer a { display: block; padding: 8px 10px; text-decoration: none; color: var(--color-ink); border-radius: 8px; }
.cat-drawer a:hover { background: var(--brand-rose); color: var(--brand-burgundy); }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.inline-form { display: inline; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filter-bar label { margin-top: 0; }
.filter-bar input, .filter-bar select { max-width: 220px; }
.kv { display: grid; gap: 8px; }
.kv > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--color-line); }
.kv dt { color: var(--color-muted); font-weight: 700; }
.kv dd { margin: 0; }
.specs-list { margin-top: 8px; }
.media-list { display: grid; gap: 10px; margin-bottom: 12px; }
.media-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.media-preview { width: 64px; }
.product-form .panel { margin-bottom: 16px; }
.sticky-actions {
    position: sticky;
    bottom: 12px;
    background: rgba(255, 255, 255, 0.96);
    padding: 12px;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    box-shadow: var(--vy-shadow);
    z-index: 5;
}
.skeleton-card { background: white; border: 1px solid var(--color-line); border-radius: 12px; padding: 12px; }
.skeleton-thumb { min-height: 140px; margin-bottom: 10px; }
.skeleton-line { min-height: 12px; margin-bottom: 8px; }
.skeleton-line.short { width: 55%; }

.address-card { padding: 16px; margin-bottom: 12px; }
.address-card.is-default { border-color: var(--brand-burgundy); box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.08); }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.row-actions select { width: auto; min-width: 180px; }
.section-head .form-actions { margin-top: 0; }
.coupon-form { max-width: 560px; }
.coupon-code-field { display: flex; gap: 8px; align-items: center; }
.coupon-code-field input { max-width: 240px; }
.category-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: step; }
.category-steps li { background: white; border: 1px solid var(--color-line); border-radius: 12px; padding: 14px 16px; }
.category-steps strong { display: block; margin-bottom: 4px; }
.category-steps span { color: var(--color-muted, #5c6570); font-size: 0.92rem; }
.category-card h2 { margin: 0; }
.category-list { list-style: none; margin: 8px 0 0; padding: 0; }
.category-list.nested { margin: 0 0 8px 22px; }
.category-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--color-line); }
.banner-form { max-width: 760px; }
.banner-form-preview { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin-bottom: 8px; }
.banner-admin-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: center; }
.banner-admin-card img { width: 100%; height: 120px; object-fit: cover; border-radius: 12px; background: #f6eef2; }
.banner-admin-card h2 { font-size: 1.15rem; margin: 0 0 4px; }

@media (max-width: 991px) {
    .checkout-sticky { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    body:has(.checkout-sticky) { padding-bottom: 76px; }
    body:has(.checkout-sticky) .bottom-nav { display: none; }
    .category-steps { grid-template-columns: 1fr; }
    .banner-admin-card { grid-template-columns: 1fr; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .kv > div { grid-template-columns: 1fr; }
    .data-table.mobile-stack thead { display: none; }
    .data-table.mobile-stack,
    .data-table.mobile-stack tbody { display: block; }
    .data-table.mobile-stack tr {
        display: block;
        border: 1px solid var(--color-line);
        border-radius: 12px;
        margin-bottom: 10px;
        background: white;
        padding: 8px;
    }
    .data-table.mobile-stack td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border: 0;
        padding: 6px 8px;
    }
    .data-table.mobile-stack td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--color-muted);
    }
    .shell-top {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 20;
        background: rgba(250, 248, 252, 0.94);
        backdrop-filter: blur(12px);
        margin: -16px -16px 16px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--color-line);
    }
    .shell-top-title { font-family: var(--font-display); font-weight: 600; }
}

@media (max-width: 420px) {
    .filter-bar input, .filter-bar select { max-width: 100%; width: 100%; }
    .sticky-actions { bottom: 64px; }
}
