/* Шрифты (Inter / Playfair Display) — положить .woff2 в /static/fonts/.
   Пока файлов нет — браузер фоллбэкнется на system-ui / serif. */
@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Playfair Display';
    src: url('/static/fonts/PlayfairDisplay-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Playfair Display';
    src: url('/static/fonts/PlayfairDisplay-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    --bg: #FBF8F3;
    --accent: #B85C38;
    --accent-soft: #D4A574;
    --text: #2C2A28;
    --muted: #6B655E;
    --danger: #A83232;
    --success: #5C7A3A;
    --radius-card: 14px;
    --radius-input: 8px;
    --shadow: 0 2px 12px rgba(44, 42, 40, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
}
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; }
h1 { font-size: 2.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.75rem; margin: 0 0 .75rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-input);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.card {
    background: white;
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow);
}

.hero { padding: 80px 0; text-align: center; }
.hero p { font-size: 1.25rem; color: var(--muted); max-width: 600px; margin: 0 auto 2rem; }

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 48px 0;
}
@media (max-width: 768px) {
    .steps { grid-template-columns: 1fr; }
}

.input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-input);
    font-size: 1rem;
    font-family: inherit;
}
.input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.label { display: block; margin-bottom: 6px; font-weight: 600; }
.field { margin-bottom: 16px; }
.field-error { color: var(--danger); font-size: 0.875rem; margin-top: 4px; }

/* Workspace / shop layout */
.topnav {
    background: white;
    border-bottom: 1px solid rgba(44, 42, 40, 0.08);
    padding: 12px 0;
    margin-bottom: 32px;
}
.topnav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}
.topnav .crumbs { color: var(--muted); font-size: 0.95rem; }
.topnav .crumbs a { color: var(--accent); text-decoration: none; }
.topnav .crumbs a:hover { text-decoration: underline; }

.shop-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.shop-nav a {
    padding: 8px 16px;
    border-radius: var(--radius-input);
    color: var(--text);
    text-decoration: none;
    background: white;
    border: 1px solid rgba(44, 42, 40, 0.08);
}
.shop-nav a.active { background: var(--accent); color: white; border-color: var(--accent); }

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(44, 42, 40, 0.06);
}
.table th { background: rgba(180, 92, 56, 0.06); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }

.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 0.875rem; }

.muted { color: var(--muted); }
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--muted);
}
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-pending { background: #FFF4D6; color: #8A6A00; }
.badge-active  { background: #D8EBC8; color: #3F5E1F; }
.badge-paused  { background: #E8E4DD; color: #6B655E; }
.badge-deleted { background: #F0DCD8; color: #7A2A2A; }
.pagination { margin-top: 16px; display: flex; gap: 8px; align-items: center; }
.pagination a, .pagination span {
    padding: 6px 12px; border-radius: var(--radius-input); text-decoration: none;
}
.pagination a { background: white; color: var(--accent); border: 1px solid var(--accent); }
.pagination .current { background: var(--accent); color: white; }

/* Workspace: header (заголовок + действие) и табы переключения */
.ws-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.ws-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(44, 42, 40, 0.12);
    margin-bottom: 24px;
}
.ws-tab {
    padding: 10px 20px;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: 600;
    transition: color .15s, border-color .15s;
}
.ws-tab:hover { color: var(--text); }
.ws-tab--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Workspace: сетка карточек магазинов и стиль удалённой карточки */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.shop-card {
    display: block;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    transition: transform .15s, box-shadow .15s;
}
a.shop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(44, 42, 40, 0.12);
}
.shop-card__title {
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.25rem;
}

/* Удалённая карточка — серая, с overlay при hover. position:relative тут,
   чтобы не аффектить активные карточки (был визуальный артефакт). */
.shop-card--deleted {
    position: relative;
    background: #F2EFE9;
    opacity: 0.7;
    filter: grayscale(0.6);
    cursor: default;
}
.shop-card--deleted:hover {
    transform: none;
    box-shadow: var(--shadow);
    opacity: 1;
    filter: grayscale(0);
}
.shop-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(44, 42, 40, 0.92);
    color: white;
    border-radius: var(--radius-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .15s;
    text-align: center;
}
.shop-card__overlay a:not(.btn) { color: var(--accent-soft); }
.shop-card--deleted:hover .shop-card__overlay { opacity: 1; }
