:root {
    --primary: #005eff;
    --primary-light: #eef4ff;
    --secondary: #6c757d;
    --success: #198754;
    --warning: #ffc107;
    --light: #f8f9fa;
    --border: #e2e8f0;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.2s ease;
}

body {
    font-family: 'Inter', sans-serif;
    color: black;
}

.container {
    max-width: 1200px;
    margin: 120px auto;
    padding: 0 24px;
}
.order-panel-mobile {
    display: none;
}
/* Кнопка возврата */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 20px;
    padding: 10px 0;
    transition: var(--transition);
}

    .back-link:hover {
        color: var(--primary);
    }

/* Work Detail */
.work-detail {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    margin-bottom: 48px;
}

.work-content {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--card-shadow);
}

.work-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: black;
    line-height: 1.3;
}

.work-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.badge {
    font-size: 0.875rem;
    border: 1px solid;
    border-radius: 100px;
    padding: 8px 16px;
    font-weight: 500;
}

.badge--type {
    background: var(--primary-light);
    border-color: rgba(67, 97, 238, 0.3);
    color: var(--primary);
}

.badge--subject {
    background: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.3);
    color: var(--success);
}

.badge--fmt {
    background: rgba(108, 117, 125, 0.1);
    border-color: rgba(108, 117, 125, 0.3);
    color: var(--secondary);
}

.work-description {
    margin-bottom: 32px;
    font-size: 1.125rem;
    line-height: 1.7;
    color: black;
}

.work-details {
    margin-bottom: 32px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.875rem;
    color: var(--secondary);
    font-weight: 500;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: black;
}

.preview-section {
    margin-top: 32px;
}

.preview-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: black;
}

.preview-content {
    background: var(--light);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
}
.preview-image {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 16px;
}

.preview-text {
    line-height: 1.7;
    color: black;
}

/* Order Panel */
.order-panel {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--card-shadow);
    height: fit-content;
    position: sticky;
    top: 24px;
}
.benefits-list {
    margin: 24px 0;
    padding-left: 20px;
}

    .benefits-list li {
        margin-bottom: 12px;
        color: black;
    }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: var(--radius);
    border: 2px solid transparent;
    padding: 16px 24px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    width: 100%;
    text-align: center;
}

.btn--primary {
    background: var(--primary);
    color: white;
    margin-bottom: 16px;
}

    .btn--primary:hover {
        background: #0044bf;
        box-shadow: var(--hover-shadow);
    }

.btn--outline {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}

    .btn--outline:hover {
        background: var(--primary-light);
    }

/* Related Works */
.related-works {
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: black;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Адаптивность */
@media (max-width: 968px) {
    .work-detail {
        grid-template-columns: 1fr;
    }

    .order-panel {
        position: static;
    }

    .container {
        padding: 0;
    }

    .back-link {
        margin-left: 24px;
    }
    .order-panel-mobile{
        display:block;
        margin-top:50px;
    }
    .order-panel {
        display: none;
    }
    .cta-panel{
        margin-top:20px
    }
}

@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
    }

    .work-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .work-title {
        font-size: 1.5rem;
    }

    .card__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .actions {
        width: 100%;
    }

    .btn--small {
        flex: 1;
    }
}
/* 1) Базовая защита от горизонтального скролла */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* 2) Корректная модель коробки везде */
*, *::before, *::after {
    box-sizing: border-box;
}

/* 3) Любые flex/grid-дети внутри карточки/контента могут сжиматься */
.work-detail,
.work-content,
.order-panel,
.work-meta,
.preview-content {
    min-width: 0; /* критично для flex/grid, иначе текст выталкивает контейнер */
}

/* 4) Длинные слова/фразы не выталкивают макет */
.work-title,
.work-description,
.detail-value,
.detail-label {
    overflow-wrap: anywhere; /* или word-break: break-word; */
    word-break: break-word;
}

/* 5) Бейджи не ломают строку и не «едут» за край */
.badge {
    max-width: 100%;
    /* два варианта: a) перенос по словам, или b) в одну строку с многоточием */
    /* ВАРИАНТ (a) перенос */
    overflow-wrap: anywhere;
    white-space: normal;
    /* ВАРИАНТ (b) если хочешь однострочные бейджи */
    /* white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; */
}

/* 6) Картинки/иконки резиновые */
img, svg, video, canvas {
    max-width: 100%;
    height: auto;
}

/* 7) На очень узких экранах — чуть меньше внутренних отступов,
      чтобы гарантированно вписываться в 390px */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    /* вместо 0 — даём немного "воздуха" */
    .work-content {
        padding: 24px;
    }

    .order-panel {
        padding: 24px;
    }

    .work-title {
        font-size: 1.5rem;
        line-height: 1.35;
    }
    section.container{
        padding: 0px;

    }
}
/* CTA Panel */
.cta-panel {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--card-shadow);
    height: fit-content;
    position: sticky;
    top: 24px;
    margin-top:40px
}

    .cta-panel h2 {
        font-size: 1.5rem;
        font-weight: 700;
        color: black;
        margin-bottom: 16px;
    }
    .order-panel h2 {
        font-size: 1.5rem;
        font-weight: 700;
        color: black;
        margin-bottom: 20px;
    }
    .cta-panel p {
        color: var(--secondary);
        margin-bottom: 24px;
        line-height: 1.5;
    }

    .cta-panel .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        border-radius: var(--radius);
        border: 2px solid transparent;
        padding: 16px 24px;
        font-weight: 600;
        font-size: 1rem;
        cursor: pointer;
        transition: var(--transition);
        font-family: 'Inter', sans-serif;
        width: 100%;
        text-align: center;
        margin-bottom: 16px;
    }

    .cta-panel .btn--primary {
        background: var(--primary);
        color: white;
    }

        .cta-panel .btn--primary:hover {
            background: #0044bf;
            box-shadow: var(--hover-shadow);
        }

     .benefits-list {
        margin: 24px 0;
        padding-left: 20px;
        list-style: disc;
    }

        .cta-panel .benefits-list li {
            margin-bottom: 12px;
            color: black;
            position: relative;
        }