/* Отключить тему: удалите подключение этого файла в views/layouts/main.php */
/* Палитра и плотность как механика auto-style24.ru; откат — один <link>. */

body.theme-autostyle {
    --as-orange: #ff6600;
    --as-orange-dark: #e55a00;
    --as-orange-hover: #cc5200;
    --as-header: #163633;
    --as-header-deep: #102c2a;
    --as-header-mist: #173a44;
    --as-chrome-image: url("/assets/images/theme/chrome-wellness.svg");
    --as-chrome-overlay: linear-gradient(135deg, rgba(16, 44, 42, 0.78) 0%, rgba(22, 54, 51, 0.70) 48%, rgba(18, 42, 54, 0.84) 100%);
    --as-chrome-bg: var(--as-chrome-overlay), var(--as-chrome-image);
    --as-bg: #f8f5f4;
    --as-text: #474342;
    --as-muted: #6b6b6b;
    --as-radius: 20px;
    --as-radius-sm: 10px;
    --as-shadow: 0 10px 34px rgba(0, 0, 0, 0.12);
    --bs-primary: #ff6600;
    --bs-primary-rgb: 255, 102, 0;
    --bs-link-color: #ff6600;
    --bs-link-hover-color: #cc5200;
    --bs-link-color-rgb: 255, 102, 0;
    --kbzhu-gradient: linear-gradient(135deg, #ff6600 0%, #cc5200 100%);
    background-color: var(--as-bg);
    color: var(--as-text);
}

body.theme-autostyle a:not(.btn):not(.nav-link):not(.navbar-brand):not(.card):not(.card-hover):not(.page-link) {
    color: var(--as-orange);
}
body.theme-autostyle a:not(.btn):not(.nav-link):not(.navbar-brand):not(.card):not(.card-hover):not(.page-link):hover {
    color: var(--as-orange-hover);
}

/* —— Header: спокойный wellness-хром (лесной teal), не гаражный чёрный —— */
body.theme-autostyle > header.navbar {
    background-color: var(--as-header) !important;
    background-image: var(--as-chrome-bg) !important;
    background-size: cover !important;
    background-position: center 28% !important;
    background-repeat: no-repeat !important;
    border-bottom: 0 !important;
    box-shadow: 0 4px 18px rgba(16, 44, 42, 0.32);
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}
body.theme-autostyle > header.navbar .navbar-brand,
body.theme-autostyle > header.navbar .nav-link {
    color: #fff !important;
}
body.theme-autostyle > header.navbar .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1;
    min-height: 2.25rem;
    padding: 0 0.95rem;
}
body.theme-autostyle > header.navbar .nav-link:hover {
    color: var(--as-orange) !important;
    background: rgba(255, 102, 0, 0.14);
}
body.theme-autostyle > header.navbar .nav-link.is-current {
    color: #fff !important;
    background: #e8732a;
}
body.theme-autostyle > header.navbar .nav-link.is-current:hover {
    color: #fff !important;
    background: var(--as-orange-hover);
}
body.theme-autostyle > header.navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.35);
}
body.theme-autostyle > header.navbar .navbar-toggler-icon {
    filter: invert(1) grayscale(1);
}
body.theme-autostyle > header.navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 102, 0, 0.35);
}

@media (max-width: 1199.98px) {
    body.theme-autostyle > header.navbar .navbar-collapse {
        flex-basis: 100%;
        margin-top: 0.35rem;
        padding: 0.5rem 0.4rem 0.55rem;
        border-radius: 12px;
        background: rgba(12, 34, 32, 0.5);
    }
    body.theme-autostyle > header.navbar .nav-link {
        margin-bottom: 0.15rem;
        justify-content: flex-start;
    }
}

/* —— Hero: то же семейство оттенков, не чёрная плита —— */
body.theme-autostyle .hero {
    background-color: var(--as-header);
    background-image:
        radial-gradient(ellipse at 80% 18%, rgba(232, 140, 70, 0.12) 0%, transparent 52%),
        radial-gradient(ellipse at 12% 88%, rgba(70, 130, 118, 0.16) 0%, transparent 55%),
        var(--as-chrome-bg);
    background-size: cover;
    background-position: center 42%;
    background-repeat: no-repeat;
    color: #fff;
    padding: 5rem 0 4.25rem;
}
body.theme-autostyle .hero__title {
    font-size: clamp(2rem, 5vw, 3.15rem);
    font-weight: 700;
    line-height: 1.1;
    max-width: 18ch;
}
body.theme-autostyle .hero__text {
    opacity: 0.92;
    max-width: 36rem;
    font-size: clamp(1rem, 2vw, 1.125rem);
    font-weight: 500;
}
body.theme-autostyle .hero__actions {
    margin-top: 1.75rem;
}
body.theme-autostyle .hero .btn {
    min-width: 200px;
    min-height: 52px;
    height: auto;
    padding: 0 1.5rem;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
}
body.theme-autostyle .hero .btn-outline-primary {
    --bs-btn-color: #fff;
    --bs-btn-border-color: #fff;
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: #fff;
    --bs-btn-hover-color: var(--as-orange);
    background: transparent;
    border-width: 2px;
    color: #fff;
}
body.theme-autostyle .hero .btn-outline-primary:hover {
    background: #fff;
    color: var(--as-orange);
}

@media (max-width: 575.98px) {
    body.theme-autostyle .hero {
        padding: 2.75rem 0 2.5rem;
    }
    body.theme-autostyle .hero .btn {
        width: 100%;
        min-width: 0;
    }
}

/* —— Type hierarchy —— */
body.theme-autostyle h1,
body.theme-autostyle .display-6 {
    color: var(--as-text);
    font-weight: 700;
    line-height: 1.15;
}
body.theme-autostyle .hero h1,
body.theme-autostyle .hero .hero__title {
    color: #fff;
}
body.theme-autostyle h2,
body.theme-autostyle .h3.fw-bold,
body.theme-autostyle .h4.fw-bold {
    color: var(--as-text);
    font-weight: 700;
    line-height: 1.2;
}
body.theme-autostyle .page-intro {
    color: var(--as-muted);
    font-size: 1.05rem;
    line-height: 1.55;
}

body.theme-autostyle .section-block--alt {
    background: var(--as-bg);
}

/* —— Buttons: pill, orange; текст по центру (не height+padding Bootstrap) —— */
body.theme-autostyle .btn {
    --bs-btn-padding-y: 0;
    --bs-btn-line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 50px;
    font-weight: 500;
    line-height: 1;
    padding: 0.75rem 1.25rem;
    vertical-align: middle;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
body.theme-autostyle .btn-sm {
    --bs-btn-padding-y: 0;
    min-height: 2.25rem;
    padding: 0.5rem 1rem;
    line-height: 1;
}
body.theme-autostyle .btn-primary {
    --bs-btn-bg: #ff6600;
    --bs-btn-border-color: #ff6600;
    --bs-btn-hover-bg: #cc5200;
    --bs-btn-hover-border-color: #cc5200;
    --bs-btn-active-bg: #cc5200;
    --bs-btn-active-border-color: #cc5200;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
}
body.theme-autostyle .btn-success {
    --bs-btn-bg: #ff6600;
    --bs-btn-border-color: #ff6600;
    --bs-btn-hover-bg: #cc5200;
    --bs-btn-hover-border-color: #cc5200;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
}
body.theme-autostyle .btn-outline-primary {
    --bs-btn-color: #ff6600;
    --bs-btn-border-color: #ff6600;
    --bs-btn-hover-bg: #ff6600;
    --bs-btn-hover-border-color: #ff6600;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #cc5200;
    --bs-btn-active-border-color: #cc5200;
    --bs-btn-active-color: #fff;
    border-width: 2px;
}
body.theme-autostyle .btn-primary:hover,
body.theme-autostyle .btn-success:hover {
    background: var(--as-orange-hover);
    border-color: var(--as-orange-hover);
}

/* —— Cards: photo-forward, 20px, title + meta —— */
body.theme-autostyle .card {
    border: 0;
    border-radius: var(--as-radius);
    box-shadow: 0 2px 12px rgba(22, 22, 22, 0.06);
    overflow: hidden;
    background: #fff;
}
body.theme-autostyle .card-hover {
    border-radius: var(--as-radius);
    box-shadow: 0 2px 12px rgba(22, 22, 22, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.theme-autostyle .card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--as-shadow);
    color: inherit;
}
body.theme-autostyle .card-hover--product {
    border-radius: var(--as-radius);
    box-shadow: 0 2px 12px rgba(22, 22, 22, 0.06);
}
body.theme-autostyle .card-hover--product:hover {
    box-shadow: var(--as-shadow);
}
body.theme-autostyle .card-img-top,
body.theme-autostyle .product-card-img {
    object-fit: cover;
}
body.theme-autostyle .card-hover img.card-img-top,
body.theme-autostyle .card-hover .card-img-top,
body.theme-autostyle .product-card-img {
    height: 200px;
}
body.theme-autostyle .card-hover .product-card-img--md,
body.theme-autostyle .product-card-img--md {
    height: 170px;
}
body.theme-autostyle .card-hover .product-card-img--sm,
body.theme-autostyle .product-card-img--sm {
    height: 120px;
}
body.theme-autostyle .card-hover--product:hover .product-card-img {
    transform: scale(1.04);
}
body.theme-autostyle .card-body h2,
body.theme-autostyle .card-body h3,
body.theme-autostyle .card-section h2,
body.theme-autostyle .card-section h3 {
    color: var(--as-text);
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.4rem;
}
body.theme-autostyle .card-section {
    text-align: left !important;
    padding: 1.35rem 1.35rem 1.2rem !important;
    border-radius: var(--as-radius);
}
body.theme-autostyle .card-section .card-icon {
    font-size: 2rem;
    margin-bottom: 0.65rem;
}
body.theme-autostyle .card-section .text-primary {
    color: var(--as-orange) !important;
}

body.theme-autostyle .card-meta,
body.theme-autostyle .card-hover .text-muted.small {
    color: var(--as-muted);
}

/* Meal / workout plan cards: one meta line under title */
body.theme-autostyle .meal-plan-section .card-body .badge + h3,
body.theme-autostyle .meal-plan-section .card-body h3 {
    font-size: 1.15rem;
}

body.theme-autostyle .meal-plan-card-placeholder {
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.1) 0%, rgba(22, 22, 22, 0.06) 100%);
}

body.theme-autostyle .meal-plan-category-card {
    border-radius: var(--as-radius) !important;
    background: #fff;
    box-shadow: 0 2px 12px rgba(22, 22, 22, 0.06);
}
body.theme-autostyle .meal-plan-category-card--active {
    border-color: var(--as-orange) !important;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.18);
}

body.theme-autostyle .product-detail-img {
    border-radius: var(--as-radius);
    box-shadow: var(--as-shadow);
}

/* —— Brand chips (not macro B/Ж/У) —— */
body.theme-autostyle .badge.bg-primary,
body.theme-autostyle .text-bg-primary {
    background-color: var(--as-orange) !important;
    color: #fff !important;
}

body.theme-autostyle .kbzhu-mini span {
    background: #f3eeec;
    color: var(--as-muted);
}
body.theme-autostyle .kbzhu-table--mini strong {
    color: var(--as-text);
    font-size: 1.05rem;
}

body.theme-autostyle .calc-stat--highlight {
    background: rgba(255, 102, 0, 0.12);
}
body.theme-autostyle .calc-stat__value {
    color: var(--as-text);
}

/* —— Filters / pills (в т.ч. калорийность) —— */
body.theme-autostyle .meal-plan-filter .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #e8e2df;
    background: #fff;
    color: var(--as-text);
    line-height: 1;
    min-height: 2.35rem;
    padding: 0 1rem;
}
body.theme-autostyle .meal-plan-filter .nav-link:hover {
    color: var(--as-orange);
    background: rgba(255, 102, 0, 0.08);
}
body.theme-autostyle .meal-plan-filter .nav-link.active {
    background: var(--as-orange);
    border-color: var(--as-orange);
    color: #fff;
}
body.theme-autostyle .meal-plan-filter .nav-link.active:hover {
    background: var(--as-orange-hover);
    color: #fff;
}

body.theme-autostyle .meal-plan-kcal-filter .form-select:focus {
    border-color: var(--as-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 102, 0, 0.2);
}

/* —— Meal-plan hero: панель сохранена, радиус/тень как у референса —— */
body.theme-autostyle .meal-plan-hero--photo {
    border-radius: var(--as-radius);
    box-shadow: var(--as-shadow);
    min-height: 320px;
}
body.theme-autostyle .meal-plan-hero__panel {
    border-radius: var(--as-radius);
    background: rgba(255, 255, 255, 0.93);
    box-shadow: var(--as-shadow);
}
body.theme-autostyle .meal-plan-hero__panel h1 {
    color: var(--as-text);
}

/* —— Forms / search —— */
body.theme-autostyle .form-control:focus,
body.theme-autostyle .form-select:focus {
    border-color: var(--as-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 102, 0, 0.2);
}
body.theme-autostyle .product-search__dropdown .product-search__item:hover,
body.theme-autostyle .product-search__dropdown .product-search__item:focus,
body.theme-autostyle .product-search__dropdown .product-search__item.active {
    background-color: rgba(255, 102, 0, 0.08);
}
body.theme-autostyle .hint-btn:hover,
body.theme-autostyle .hint-btn:focus-visible {
    color: var(--as-orange);
    border-color: rgba(255, 102, 0, 0.45);
    background: rgba(255, 102, 0, 0.08);
}

/* —— FAQ —— */
body.theme-autostyle .faq-accordion .accordion-item {
    border-radius: var(--as-radius-sm);
    overflow: hidden;
    border-color: #ebe4e1;
}
body.theme-autostyle .faq-accordion .accordion-button:not(.collapsed) {
    background-color: rgba(255, 102, 0, 0.1);
    color: var(--as-orange-dark);
    box-shadow: none;
}
body.theme-autostyle .faq-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 102, 0, 0.2);
}

/* —— Breadcrumbs / misc chrome —— */
body.theme-autostyle .breadcrumb-item a {
    color: var(--as-orange);
}
body.theme-autostyle .text-primary {
    color: var(--as-orange) !important;
}
body.theme-autostyle .article-content.card {
    border-radius: var(--as-radius);
}

body.theme-autostyle .error-page h1 {
    color: var(--as-orange);
}

/* —— Footer: тот же растягивающийся фон, что и у шапки —— */
body.theme-autostyle .footer {
    background-color: var(--as-header) !important;
    background-image: var(--as-chrome-bg) !important;
    background-size: cover !important;
    background-position: center 78% !important;
    background-repeat: no-repeat !important;
    border-top: 0 !important;
    color: rgba(255, 255, 255, 0.85);
}
body.theme-autostyle .footer .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}
body.theme-autostyle .footer a {
    color: #fff;
}
body.theme-autostyle .footer a:hover {
    color: var(--as-orange);
}

@media (max-width: 575.98px) {
    body.theme-autostyle .card-hover img.card-img-top,
    body.theme-autostyle .card-hover .card-img-top,
    body.theme-autostyle .product-card-img {
        height: 150px;
    }
    body.theme-autostyle .card-hover .product-card-img--md,
    body.theme-autostyle .product-card-img--md {
        height: 130px;
    }
    body.theme-autostyle .card-hover .product-card-img--sm,
    body.theme-autostyle .product-card-img--sm {
        height: 100px;
    }
    body.theme-autostyle .meal-plan-hero--photo {
        min-height: 220px;
    }
}
