/* ============================================
   ARSENAL — карточка товара и конструктор ланча
   ============================================ */
.single-product .breadcrumbs { margin: 28px 0 36px; }
.product-back { display: inline-block; margin: 0 0 28px; color: #777; font-size: 14px; }

/* Две колонки 50/50: слева фото, справа конструктор ланча или данные товара */
.product-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; }
.product-gallery { position: relative; overflow: hidden; background: #fff; }
@media (min-width: 1200px) {
	.product-gallery { position: sticky; top: 20px; }
}
.product-gallery img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }
.product-gallery--lunch img { aspect-ratio: 1 / 1.02; object-fit: cover; }
.product-badges { position: absolute; top: 16px; left: 16px; }
.product-main { min-width: 0; }
.product-main__title { margin: 0 0 22px; font-size: 34px; line-height: 1.08; }
.product-main__title span { color: #aaa; font-weight: 500; white-space: nowrap; }
.product-main__sub { margin: -8px 0 22px; color: #777; font-size: 16px; line-height: 1.35; }

/* Обычный товар */
.product-purchase { display: flex; align-items: center; gap: 26px; margin-bottom: 34px; }
.product-purchase__price { font-size: 32px; font-weight: 600; white-space: nowrap; }
.product-purchase__price del { color: #aaa; font-size: 18px; }
.product-purchase__price ins { text-decoration: none; }
.product-purchase form.cart { margin: 0 !important; }
.product-purchase .quantity,
.product-purchase .qty { display: none !important; }
.product-purchase .single_add_to_cart_button { min-height: 50px; min-width: 126px; border: 0 !important; border-radius: 999px !important; background: var(--c-accent) !important; color: #fff !important; }

/* Товар с вариантами (размер/объём): выбор — отдельной строкой, цена и кнопка — одной строкой.
   Без этих правил Woo-таблица вариантов «прилипала» к цене и кнопке на десктопе. */
.product-purchase:has(.variations) { flex-wrap: wrap; align-items: center; gap: 10px 26px; }
.product-purchase .variations_form { display: contents; }
.product-purchase .variations { flex: 0 0 100%; order: -1; width: 100%; margin: 0 !important; border: 0; }
.product-purchase .variations tbody { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.product-purchase .variations tr { display: flex; align-items: center; gap: 8px; }
.product-purchase .variations th.label,
.product-purchase .variations td.value { display: block; padding: 0; text-align: left; }
.product-purchase .variations label { margin: 0; color: #555; font-size: 14px; font-weight: 400; }
.product-purchase .variations select { min-height: 38px; padding: 0 30px 0 12px; border: 1px solid var(--c-line-soft, #e3e3e3); border-radius: 10px; background: #fff; font-size: 14px; }
.product-purchase .reset_variations { margin-left: 4px; font-size: 12px; }
.product-purchase .single_variation_wrap { flex: 0 1 auto; display: flex; align-items: center; gap: 16px; order: 0; }
.product-purchase .woocommerce-variation:empty { display: none; }
.product-purchase .woocommerce-variation { font-size: 32px; line-height: 1.15; }
.product-purchase .woocommerce-variation .price { font-size: inherit; font-weight: 600; }
.product-purchase .woocommerce-variation-add-to-cart { display: flex; align-items: center; gap: 12px; margin-left: 0; }
.product-purchase .single_add_to_cart_button { margin-top: 0 !important; margin-left: 0; }
.product-purchase:has(.woocommerce-variation:not(:empty)) .product-purchase__price { display: none; }
.product-detail { margin-top: 24px; }
.product-detail h2 { margin: 0 0 10px; font-size: 16px; }
.product-detail p, .product-detail div { margin: 0; font-size: 14px; line-height: 1.35; }
.product-nutrition { display: flex; gap: 26px; flex-wrap: wrap; }
.product-nutrition span { display: flex; flex-direction: column; gap: 4px; }
.product-nutrition strong { font-size: 15px; }
.product-nutrition small { color: #777; font-size: 11px; }

/* Конструктор ланча */
.lunch-builder { min-width: 0; }
.lunch-builder h2 { margin: 0 0 30px; font-size: 18px; }
.lunch-builder fieldset { padding: 0; margin: 0 0 28px; border: 0; }
.lunch-builder legend { width: 100%; margin-bottom: 14px; font-size: 18px; font-weight: 600; }
.lunch-builder__options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px 24px; }
.lunch-choice { display: grid; grid-template-columns: 72px 1fr; gap: 9px; align-items: start; min-width: 0; cursor: pointer; }
.lunch-choice img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: #eee; }
.lunch-choice__copy { display: flex; flex-direction: column; gap: 5px; font-size: 13px; line-height: 1.15; }
.lunch-choice__copy input,
.lunch-builder__utensils input[type="radio"] { width: 15px; height: 15px; margin: 0 4px 0 0; vertical-align: middle; }
.lunch-choice__copy input[type="radio"]:checked::after,
.lunch-builder__utensils input[type="radio"]:checked::after { width: 5px; height: 5px; }
.lunch-choice__copy small { color: #888; }
.lunch-choice:has(input:checked) img { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.lunch-builder__utensils label { margin-right: 28px; font-size: 14px; }
.lunch-builder__utensils input { accent-color: var(--c-accent); }
.lunch-builder__footer strong { display: block; margin-bottom: 14px; font-size: 32px; }
.lunch-builder__submit { min-width: 126px; border-radius: 999px; }
.lunch-builder__error { min-height: 20px; margin: 8px 0 0; color: #c93535; font-size: 13px; }
.lunch-builder__empty { padding: 22px; border-radius: 16px; background: #f6f6f6; color: #777; }

/* Рекомендации и отзывы */
.product-related-block { margin-top: 120px; }
.product-related-block > h2 { margin: 0 0 48px; text-align: center; font-size: 32px; }
.product-related-block .related { display: block !important; margin: 0; }
.product-related-block .related > h2 { display: none; }
.product-related-block .related ul.products { display: grid !important; width: 100% !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0 !important; }
.product-related-block .related ul.products::before,
.product-related-block .related ul.products::after { display: none !important; }
.single-product .home-reviews { margin-top: 120px; }

/*
 * Переключение desktop → mobile: на 1199px (см. tokens.css и header.css)
 * галерея встаёт над блоком с данными и занимает всю ширину.
 */
@media (max-width: 1199px) {
	.product-wrap { grid-template-columns: 1fr; gap: 28px; }
	.product-gallery, .product-gallery--lunch { position: static; grid-column: 1; width: 100%; max-width: none; }
	.product-main { grid-column: 1; }
	.product-gallery img, .product-gallery--lunch img { aspect-ratio: 16 / 10; object-fit: cover; }
	.product-related-block .related ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.single-product .breadcrumbs { margin-bottom: 24px; }
	.lunch-builder__options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.product-gallery img, .product-gallery--lunch img { aspect-ratio: 4 / 3; }
	.product-related-block .related ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
	.product-back { margin-bottom: 18px; }
	.product-main__title { font-size: 27px; }
	.product-purchase { display: block; margin-bottom: 24px; }
	.product-purchase .single_add_to_cart_button { margin-top: 14px; }
	.lunch-builder__options { grid-template-columns: 1fr; }
	.lunch-choice { grid-template-columns: 64px 1fr; }
	.lunch-choice img { width: 64px; height: 64px; }
	.product-gallery img, .product-gallery--lunch img { aspect-ratio: 1 / 1; }
	.product-related-block { margin-top: 72px; }
	.product-related-block > h2 { font-size: 27px; }
}

/* ============================================
   Модификаторы блюда: выбор соуса/заправки/добавки
   ============================================ */
.ars-modifier { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.ars-modifier__legend { width: 100%; margin: 0 0 10px; padding: 0; font-size: var(--fs-16, 16px); font-weight: 600; line-height: 1.25; }
.ars-modifier__options { display: flex; flex-wrap: wrap; gap: 8px; }
.ars-modifier__option { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.ars-modifier__option input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.ars-modifier__text { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 16px; border: 1px solid var(--c-line-soft, rgba(27, 27, 27, .1)); border-radius: var(--r-pill, 999px); background: #fff; color: var(--c-ink, #1b1b1b); font-size: var(--fs-14, 14px); line-height: 1.2; transition: border-color var(--t-fast, .15s ease), background-color var(--t-fast, .15s ease), color var(--t-fast, .15s ease); }
.ars-modifier__option:hover .ars-modifier__text { border-color: var(--c-accent, #33b893); }
.ars-modifier__option input:checked + .ars-modifier__text { border-color: var(--c-accent, #33b893); background: var(--c-accent, #33b893); color: #fff; }
.ars-modifier__option input:focus-visible + .ars-modifier__text { outline: 2px solid var(--c-accent-ghost, rgba(51, 184, 147, .5)); outline-offset: 2px; }

/* Обычный товар: группа выбора — отдельной строкой над ценой и кнопкой. */
.product-purchase:has(.ars-modifier) { flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.product-purchase:has(.ars-modifier) form.cart { display: contents; }
.product-purchase:has(.ars-modifier) .ars-modifier { flex: 1 1 100%; order: -1; margin-bottom: 0; }
.product-purchase:has(.ars-modifier):has(.woocommerce-variation:not(:empty)) .product-purchase__price { display: block; }

/* Строка модификатора в корзине / дровере / чекауте */
.cart-item__modifier { margin-top: 3px; color: var(--c-body, #717171); font-size: var(--fs-12, 12px); font-weight: 400; line-height: 1.25; }
.cart-drawer__modifier { color: var(--c-body, #717171); font-size: var(--fs-12, 12px); line-height: 1.25; }
.ars-summary__modifier { margin-top: 2px; color: var(--c-body, #717171); font-size: var(--fs-12, 12px); line-height: 1.25; }

@media (max-width: 560px) {
	.ars-modifier { margin-bottom: 16px; }
	.ars-modifier__text { min-height: 36px; padding: 7px 13px; font-size: var(--fs-12, 12px); }
}

