/* ==========================================================================
   Modern SaaS Design System (Extending Tailwind)
   ========================================================================== */

:root {
    /* Цветовые переменные (Tokens) - легко менять тему во всем проекте */
    --color-bg-app: #f9fafb;
    --color-border: #e2e8f0;
    --radius-base: 0.5rem;   /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --shadow-subtle: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* 1. Глобальный сброс и тонкие настройки */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg-app);
    color: #1f2937;
}

/* 2. Современный скроллбар (SaaS стандарт) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 3. Современные компоненты (в дополнение к Tailwind) */

/* Эффект "стеклянной" или легкой карточки */
.saas-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
}

/* Плавный переход для всех интерактивных элементов */
a, button, input {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Улучшенный вид инпутов (дополняет tailwind классы) */
input:focus {
    outline: none;
    border-color: #4f46e5; /* Indigo-600 */
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* "Премиальное" подчеркивание для ссылок */
.link-modern {
    position: relative;
    text-decoration: none;
}
.link-modern::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: currentColor;
    transform: scaleX(0);
    transition: transform 0.2s ease-in-out;
}
.link-modern:hover::after {
    transform: scaleX(1);
}

/* Помощник для таблиц (если используешь таблицы) */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table-modern th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

[data-theme="dark"] {
    --color-bg-app: #111827;
    --color-border: #334155;
}

.site-shell {
    min-height: 100vh;
    background: #f8fafc;
    color: #172033;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] .site-shell {
    color: #e5e7eb;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr minmax(180px, 280px) auto;
    gap: 16px;
    align-items: center;
    padding: 16px clamp(16px, 4vw, 48px);
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--color-border);
}

[data-theme="dark"] .site-header {
    background: #0f172a;
}

.brand-mark {
    font-weight: 800;
    color: inherit;
    text-decoration: none;
    letter-spacing: 0;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: #475569;
}

.site-nav a,
.site-footer a,
.section-heading a {
    color: inherit;
    text-decoration: none;
}

.site-search input,
.filter-panel input,
.filter-panel select,
.booking-form input,
.booking-form textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 12px;
    background: white;
    color: #111827;
}

.site-actions,
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid #4f46e5;
    background: #4f46e5;
    color: white;
    padding: 0 16px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-subtle);
}

.button-secondary,
.icon-button {
    background: white;
    color: #3730a3;
    border-color: var(--color-border);
}

.button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.hero-section,
.content-band,
.page-heading,
.catalog-layout,
.lot-detail,
.form-page,
.success-page,
.info-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero-section {
    padding: 48px 0 28px;
}

.hero-copy {
    max-width: 820px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: white;
    padding: clamp(24px, 5vw, 44px);
    box-shadow: var(--shadow-subtle);
}

.eyebrow {
    color: #4f46e5;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .08em;
}

.hero-copy h1,
.page-heading h1,
.lot-detail h1,
.form-page h1,
.success-page h1,
.info-page h1 {
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.05;
    margin: 10px 0 16px;
}

.content-band {
    padding: 36px 0;
}

.muted-band {
    border-top: 1px solid var(--color-border);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.section-heading h2 {
    font-size: 24px;
    font-weight: 800;
}

.lot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.lot-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

[data-theme="dark"] .lot-card,
[data-theme="dark"] .filter-panel,
[data-theme="dark"] .detail-panel,
[data-theme="dark"] .gallery-panel,
[data-theme="dark"] .booking-form,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .success-page,
[data-theme="dark"] .info-page {
    background: #1f2937;
}

.lot-card a {
    display: grid;
    gap: 8px;
    padding: 12px;
    color: inherit;
    text-decoration: none;
}

.lot-card h3 {
    font-size: 16px;
    font-weight: 800;
}

.lot-card p {
    color: #64748b;
    font-size: 14px;
}

.lot-image {
    display: grid;
    place-items: center;
    min-height: 150px;
    border-radius: 6px;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 900;
}

.lot-image.large {
    min-height: 420px;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    padding-bottom: 48px;
}

.page-heading {
    padding: 34px 0 22px;
}

.filter-panel,
.detail-panel,
.gallery-panel,
.booking-form,
.empty-state,
.success-page,
.info-page {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: white;
    padding: 18px;
    box-shadow: var(--shadow-subtle);
}

.filter-panel,
.booking-form {
    display: grid;
    gap: 12px;
    align-self: start;
}

.lot-detail {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 520px);
    gap: 24px;
    padding: 32px 0 56px;
}

.price-line {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 18px;
}

.detail-list {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 16px;
    margin: 18px 0;
}

.detail-list dt {
    color: #64748b;
}

.booking-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.booking-form .wide,
.booking-form .consent,
.booking-form button {
    grid-column: 1 / -1;
}

.booking-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.booking-form textarea {
    min-height: 100px;
}

.alert-error {
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    padding: 12px;
    margin-bottom: 12px;
}

.pagination {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.pagination a {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.pagination a.active {
    background: #4f46e5;
    color: white;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 24px;
    border-top: 1px solid var(--color-border);
}

@media (max-width: 900px) {
    .site-header,
    .catalog-layout,
    .lot-detail,
    .booking-form {
        grid-template-columns: 1fr;
    }

    .site-actions {
        justify-content: flex-start;
    }
}
