/* Страницы товаров (vstandart, vduo, vtrio, vjournal, vlayflat, vpur,
   vjournalpur, vdbl, vlgt): подключается из самих статей. */

/* === Вся страница товара === */

:root {
    --primary: #2563eb;
    --bg: #f8fafc;
    --text: #1e293b;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 10px;
    line-height: 1.5;
}

*, ::after, ::before {
    box-sizing: border-box;
}

/* === Колонки: слайдер слева, описание и цена справа === */

.infoprod {
    display: flex;
    flex-direction: row;
    align-items: stretch; /* колонки одинаковой высоты */
    justify-content: space-between;
    width: 100%;
}

/* flex-колонка, чтобы у кнопок работал margin-top: auto */
.leftinfoprod {
    display: flex;
    flex-direction: column;
    flex: 0 0 50%;
    min-width: 0; /* позволяет сжиматься без поломки */
    padding-right: 20px;
}

.rightinfoprod {
    flex: 0 0 50%;
    min-width: 0;
    padding: 0 10px;
}

.rightinfoprods li {
    display: list-item;
    list-style: disc;
    margin-left: 10px;
}

.grinfleft {
    margin-top: 0;
    margin-bottom: 10px;
}

.slider-wrapper {
    max-width: 100%;
    margin: revert-rule;
}

/* === Цена в правой колонке === */

.price {
    font-size: 30px;
    font-weight: bold;
    text-align: end;
}

.price p {
    display: inline-block;
    margin: 0;
    color: white;
    text-align: center;
    white-space: nowrap;
}

.price .price-prefix,
.price #priceontop-value {
    display: inline;
    vertical-align: middle;
    color: white;
}

.price b {
    color: white;
    font-size: 30px;
    text-align: center;
}

/* === Кнопки под слайдером === */

.newbtnsl {
    margin-top: auto; /* прижимает блок к низу колонки */
    margin-bottom: 40px;
    width: 100%;
    display: flex;
    gap: 12px;
    padding-top: 24px;
}

.btn-row-item {
    flex: 1; /* равные доли ширины */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0; /* разрешает перенос текста и сжатие */
    padding: 10px 8px;
    background: #536e81;
    color: white;
    text-align: center;
    line-height: 1.4;
    border-radius: 10px;
    text-decoration: none;
}

.btn-row-item:hover {
    background: #42586a;
    transition: background 0.2s;
}

/* === Калькулятор (окно fancybox #calc) === */

.calc-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* :where() не добавляет веса селектору, поэтому .label-accent
   по-прежнему перекрывает общие стили label */
:where(.calc-container) h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-align: center;
    color: #0f172a;
}

:where(.calc-container) label {
    display: block;
    width: 60%;
    padding: 10px;
    margin-bottom: 3px;
    font-size: 0.8rem;
    font-weight: 400;
    color: #475569;
}

.label-accent {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 3px;
    color: #0f172a;
}

:where(.calc-container) select,
:where(.calc-container) input {
    width: 100%;
    padding: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.2s;
}

:where(.calc-container) input {
    font-weight: bold;
    text-align: end;
}

:where(.calc-container) select:focus,
:where(.calc-container) input:focus {
    outline: none;
    border-color: var(--primary);
}

.field-group {
    margin-bottom: 8px;
}

.description {
    margin-top: 10px;
    padding: 12px;
    font-size: 0.7rem;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 8px;
}

.price-card {
    margin-top: 30px;
    padding: 25px;
    background: #536e81;
    color: white;
    text-align: center;
    border-radius: 12px;
}

.price-label {
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: white;
    opacity: 0.9;
}

.price-value,
.price-value span {
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
}

/* === Адаптив === */

@media (max-width: 992px) {
    .infoprod {
        flex-direction: column; /* колонки одна под другой */
    }

    .leftinfoprod,
    .rightinfoprod {
        flex: none;
        width: 100%;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 30px;
    }

    .newbtnsl {
        margin-top: 16px;
        flex-wrap: wrap;
    }

    .btn-row-item {
        min-width: calc(33.333% - 8px); /* 3 в ряд на планшете */
    }
}

@media (max-width: 768px) {
    .price p {
        white-space: normal;
        word-break: break-word;
    }

    .btn-row-item {
        min-width: calc(50% - 6px); /* 2 в ряд на телефоне */
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .btn-row-item {
        min-width: 100%; /* 1 в ряд на узких экранах */
    }
}
