/* loc_frov — палитра и типографика в эстетике Claude/Anthropic.
   Тёплый ivory-фон, графитовый текст, терракотовый акцент, serif-заголовки. */

:root {
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

    --bg: #F7F6F1;
    --surface: #FFFFFF;
    --surface-2: #F2F0E9;
    --text: #1F1E1B;
    --text-muted: #6B6862;
    --border: #E6E2D8;

    --accent: #C96442;
    --accent-hover: #B5532F;
    --accent-soft: #F4E4DC;

    --info-bg: #ECF0F1;
    --info-border: #D5DEE0;
    --success-bg: #E8F0E6;
    --success-border: #CADcc6;
    --error-bg: #F7E6E2;
    --error-border: #E9C9C0;
    --danger: #B5532F;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(31, 30, 27, .04), 0 2px 10px rgba(31, 30, 27, .05);
    --shadow-hover: 0 2px 4px rgba(31, 30, 27, .06), 0 6px 20px rgba(31, 30, 27, .08);
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    max-width: 680px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 4rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* --- Типографика --- */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.01em;
    margin: 1.5rem 0 .75rem;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: .5rem 0; }
small { color: var(--text-muted); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* --- Шапка --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .85rem;
    margin-bottom: 1.25rem;
}
header a { color: var(--text); }
header a:hover { text-decoration: none; color: var(--accent); }
header strong { font-size: 1.2rem; letter-spacing: -.01em; }
header nav { font-size: .92rem; color: var(--text-muted); }
header nav a { color: var(--accent); }

/* --- Карточки --- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin: .85rem 0;
    box-shadow: var(--shadow);
    transition: box-shadow .15s ease, transform .15s ease;
}
/* Сетка ассортимента: 1 колонка на телефоне, 2–3 по ширине экрана */
.offerings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .85rem;
}
.offerings-grid .card { margin: 0; }

/* --- Карточка товара --- */
.product-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow-hover); }

.product-media { position: relative; }
.product-media img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    margin: 0;
    border-radius: 0;
    max-height: none;
}
.product-media-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    font-size: 2.6rem;
    background: var(--surface-2);
}
.product-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: .8rem 1rem 1rem;
}
.product-name { font-size: 1.08rem; margin: 0 0 .2rem; }
.product-desc {
    color: var(--text-muted);
    font-size: .88rem;
    margin: .1rem 0 .4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-limit { font-size: .78rem; color: var(--text-muted); margin: .15rem 0 .2rem; }

/* Нижняя панель: цена слева, степпер справа */
.product-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding-top: .7rem;
    border-top: 1px solid var(--border);
}
.product-price { display: flex; align-items: baseline; gap: .12rem; }
.price-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.02em;
    line-height: 1;
}
.price-cur { font-size: .95rem; font-weight: 600; color: var(--text); }
.price-unit { color: var(--text-muted); font-size: .82rem; margin-left: .15rem; }

.card h2 { margin-top: .15rem; }
.card h2 a { color: var(--text); }
.card h2 a:hover { color: var(--accent); text-decoration: none; }
.card img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: .6rem;
}

/* --- Сообщения / алерты --- */
.msg {
    padding: .7rem .9rem;
    border-radius: var(--radius-sm);
    margin: .75rem 0;
    border: 1px solid transparent;
    font-size: .95rem;
}
.msg.info    { background: var(--info-bg);    border-color: var(--info-border); }
.msg.success { background: var(--success-bg); border-color: var(--success-border); }
.msg.error   { background: var(--error-bg);   border-color: var(--error-border); color: var(--danger); }

/* --- Кнопки --- */
button,
.btn {
    font: inherit;
    font-weight: 550;
    cursor: pointer;
    padding: .6rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    transition: background .15s ease, border-color .15s ease, opacity .15s ease;
    line-height: 1.2;
}
button:hover,
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { opacity: .4; cursor: not-allowed; }

/* Кнопка-ссылка: убираем подчёркивание и наследуем вид кнопки */
a:has(> button) { text-decoration: none; display: inline-block; }
a > button { display: inline-block; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border); }

.btn-danger {
    background: var(--surface);
    color: var(--danger);
    border-color: var(--error-border);
}
.btn-danger:hover { background: var(--error-bg); border-color: var(--danger); }

/* --- Поля ввода --- */
input, select, textarea {
    font: inherit;
    width: 100%;
    max-width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
}
input[type="checkbox"] { width: auto; margin-right: .4rem; vertical-align: middle; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
label { font-size: .95rem; color: var(--text-muted); }

/* --- Списки позиций --- */
ul { padding-left: 1.2rem; }
.card ul { margin: .5rem 0; }
.card li { margin: .2rem 0; }

/* --- Единый степпер количества (штучное и весовое — одинаково) --- */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .65rem;
}
.product-foot .qty-stepper { margin-top: 0; }
.qty-stepper .qty-btn {
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border-radius: 999px;
    font-size: 1.2rem;
    line-height: 1;
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.qty-stepper .qty-btn:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.qty-stepper .qty-input {
    width: 2.9rem;
    height: 2.2rem;
    padding: 0 .2rem;
    text-align: center;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    -moz-appearance: textfield;
    appearance: textfield;
}
.qty-stepper.is-weight .qty-input { width: 3.3rem; }
.qty-stepper .qty-input::-webkit-outer-spin-button,
.qty-stepper .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper .qty-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.qty-stepper .unit { color: var(--text-muted); font-size: .85rem; flex: 0 0 auto; }

/* Компактный вариант (строка корзины) */
.qty-stepper--sm { gap: .3rem; margin-top: 0; }
.qty-stepper--sm .qty-btn { width: 1.85rem; height: 1.85rem; font-size: 1.05rem; }
.qty-stepper--sm .qty-input { width: 2.4rem; height: 1.85rem; }
.qty-stepper--sm.is-weight .qty-input { width: 2.9rem; }
.qty-stepper--sm .unit { font-size: .8rem; }

/* Редактируемые строки корзины */
.cart-lines { list-style: none; padding: 0; margin: .5rem 0 .75rem; }
.cart-line {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
}
.cart-line:last-child { border-bottom: none; }
.cart-line-name { flex: 1 1 auto; min-width: 0; }
.cart-line-total { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cart-line-ctl { flex: 0 0 auto; }
.cart-remove {
    background: transparent;
    border: none;
    color: var(--muted, #9a9a9a);
    font-size: 1.3rem;
    line-height: 1;
    padding: 0 .15rem;
    cursor: pointer;
}
.cart-remove:hover { color: var(--accent); }

/* --- Корзина --- */
#cart-summary h3 { margin-top: 0; display: flex; align-items: center; gap: .4rem; }

/* --- Лендинг / интро на главной --- */
.intro { margin: 0 0 1rem; }
.intro > summary {
    display: block;
    width: fit-content;
    margin: 0 0 .5rem auto;   /* margin-left:auto → пилюля прижата вправо */
    list-style: none;
    cursor: pointer;
    padding: .35rem .85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: .88rem;
    user-select: none;
    transition: border-color .15s ease, color .15s ease;
}
.intro > summary::-webkit-details-marker { display: none; }
.intro > summary:hover { border-color: var(--accent); color: var(--accent); }
.intro[open] > summary { color: var(--accent); border-color: var(--accent-soft); }
.intro[open] .when-closed,
.intro:not([open]) .when-open { display: none; }

.hero { margin: .5rem 0 1.5rem; }
.hero h1 { font-size: 2rem; margin: .5rem 0 .4rem; }
.hero .lede { font-size: 1.12rem; color: var(--text-muted); max-width: 34rem; }

.features {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 .5rem;
    display: grid;
    gap: .75rem;
}
@media (min-width: 560px) { .features { grid-template-columns: 1fr 1fr; } }
.features li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    box-shadow: var(--shadow);
    margin: 0;
}
.features b { display: block; margin-bottom: .2rem; font-size: 1.02rem; }
.features span { color: var(--text-muted); font-size: .92rem; }

.steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 1rem 0 1.75rem;
    display: grid;
    gap: .7rem;
}
.steps li { position: relative; padding-left: 2.6rem; line-height: 1.5; }
.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: -.05rem;
    width: 1.8rem;
    height: 1.8rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-weight: 600;
    font-size: .92rem;
}
