/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    height: 100%; /* Добавлено для sticky footer */
}
body {
    margin: 0;
    min-height: 100%; /* Добавлено для sticky footer */
    display: flex; /* Добавлено для sticky footer */
    flex-direction: column; /* Добавлено для sticky footer */
}
main {
    display: block;
    flex: 1; /* Добавлено для sticky footer */
}
h1 {
    font-size: 2em;
    margin: 0.67em 0;
}
hr {
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    height: 0;
    overflow: visible;
}
pre {
    font-family: monospace, monospace;
    font-size: 1em;
}
a {
    background-color: transparent;
}
abbr[title] {
    border-bottom: none;
    text-decoration: underline;
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
}
b,
strong {
    font-weight: bolder;
}
code,
kbd,
samp {
    font-family: monospace, monospace;
    font-size: 1em;
}
small {
    font-size: 80%;
}
sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}
sub {
    bottom: -0.25em;
}
sup {
    top: -0.5em;
}
img {
    border-style: none;
}
button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
}
button,
input {
    overflow: visible;
}
button,
select {
    text-transform: none;
}
button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
    border-style: none;
    padding: 0;
}
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
    outline: 1px dotted ButtonText;
}
fieldset {
    padding: 0.35em 0.75em 0.625em;
}
legend {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    color: inherit;
    display: table;
    max-width: 100%;
    padding: 0;
    white-space: normal;
}
progress {
    vertical-align: baseline;
}
textarea {
    overflow: auto;
}
[type="checkbox"],
[type="radio"] {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    padding: 0;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
    height: auto;
}
[type="search"] {
    -webkit-appearance: textfield;
    outline-offset: -2px;
}
[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}
::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}
details {
    display: block;
}
summary {
    display: list-item;
}
template {
    display: none;
}
[hidden] {
    display: none;
}
*,
*:before,
*:after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
html {
    font-family: "Rubik", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #545454;
}
@media (max-width: 1023px) {
    html {
        height: 100%;
    }
}
@media (max-width: 1023px) {
    body {
        height: 100%;
    }
}
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
figure,
p,
pre {
    margin: 0;
}
fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}
iframe {
    border: 0;
}
ol,
ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
[tabindex="-1"]:focus {
    outline: none !important;
}
iframe[name=google_conversion_frame] {
    display: none;
}

/* Custom styles */
:root {
    --primary-red: #a64e4e;
    --primary-red-rgb: 166, 78, 78;
    --primary-black: #212529;
    --light-bg: #fdf7f7;
    --white: #ffffff;
    --font-family-base: 'Rubik', sans-serif;
    --bs-link-color-rgb: var(--primary-red-rgb);
    --bs-link-hover-color-rgb: 140, 66, 66;
    --bs-primary: var(--primary-red);
    --bs-primary-rgb: var(--primary-red-rgb);
    --bs-body-color: var(--primary-black);
}
body {
    background-color: var(--light-bg);
    font-family: var(--font-family-base);
    color: var(--primary-black);
}
.btn:focus, .btn:active, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-red-rgb), 0.25) !important;
}
.btn-primary:active, .btn-primary:focus {
     background-color: #8c4242 !important;
     border-color: #8c4242 !important;
}
.btn-outline-primary:active, .btn-outline-primary:focus {
     background-color: var(--primary-red) !important;
     color: var(--white) !important;
     box-shadow: 0 0 0 0.25rem rgba(var(--primary-red-rgb), 0.5) !important;
}
.navbar {
    background-color: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}
.nav-link {
    font-weight: 500;
    transition: color 0.3s;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary-red) !important;
}
.list-group-item.active {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}
.btn-primary {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
}
.btn-primary:hover {
    background-color: #8c4242;
    border-color: #8c4242;
    transform: translateY(-2px);
}
.btn-outline-primary {
     color: var(--primary-red);
     border-color: var(--primary-red);
     font-weight: 500;
     padding: 0.75rem 1.5rem;
     border-radius: 0.5rem;
     transition: all 0.3s;
}
.btn-outline-primary:hover {
     background-color: var(--primary-red);
     color: var(--white);
}
/* Стили для крупного заголовка на страницах */
.display-3 {
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--primary-black);
    position: relative;
    padding-bottom: 15px;
}
.display-3::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-red);
    border-radius: 2px;
}
/* Стили для заголовков второго уровня */
.display-5 {
    font-weight: 700;
    color: var(--primary-black);
}
/* Стили для секции основателей */
.founders-section .card {
    border: none;
    background-color: transparent;
}
.founders-section img {
    border-radius: 50%;
    border: 5px solid var(--primary-red);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.founders-section h3 {
    color: var(--primary-black);
}

/* Стили для таймлайна v2 */
.timeline-v2 {
    position: relative;
    padding: 20px 0;
}
.timeline-v2::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary-red);
    left: 50%;
    margin-left: -2px;
    z-index: 0;
}
.timeline-v2-item {
    margin-bottom: 50px;
    position: relative;
}
.timeline-v2-item:last-child {
    margin-bottom: 0;
}
.timeline-v2-item::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-red);
    border: 3px solid var(--white);
    left: 50%;
    transform: translateX(-50%);
    top: 15px;
    z-index: 1;
}
.timeline-v2-content {
    position: relative;
    background-color: var(--white);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 25px;
    transition: all 0.3s ease;
}
.timeline-v2-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}
.timeline-v2-item.left .timeline-v2-content {
    margin-right: 50%;
    text-align: right;
}
.timeline-v2-item.right .timeline-v2-content {
    margin-left: 50%;
    text-align: left;
}
.timeline-v2-date {
    font-size: 0.9rem;
    color: var(--primary-red);
}
.timeline-v2-content p {
    color: #6c757d;
}

/* Общие стили для карточек */
.card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.rounded-circle {
    border-radius: 50% !important;
}
.vertical-line {
    height: 100%;
    width: 4px;
    background-color: var(--primary-red);
    margin: 0 auto;
}
/* Стили для карточек товаров */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease-in-out;
    background-color: var(--white);
    overflow: hidden; /* Важно для дочерних элементов с border-radius */
}


.card-title {
    font-size: 1.25rem; /* Немного уменьшим для баланса */
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--primary-black);
}
.card-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #6c757d;
    min-height: 4.5rem; /* Задаем минимальную высоту для описания */
}
.card-img-top-wrapper {
    position: relative;
    overflow: hidden;
}
.card-img-top-wrapper img {
    transition: transform 0.5s ease;
}
.card:hover .card-img-top-wrapper img {
    /* transform: scale(1.05); */ /* Отключаем и этот эффект */
}
.rounded-start {
    border-top-left-radius: 1rem !important;
    border-bottom-left-radius: 1rem !important;
}
.rounded-end {
    border-top-right-radius: 1rem !important;
    border-bottom-right-radius: 1rem !important;
}
/* Стиль для тега цены на карточке */
.price-tag {
    border-radius: 0 0 0 1rem;
    font-weight: 600;
}
.card:hover img {
    opacity: 0.9;
}

.list-unstyled li {
    margin-bottom: 0.75rem;
    color: #495057;
}
.list-unstyled li i {
    font-size: 1.2rem;
    vertical-align: middle;
}

.custom-btn-primary {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    font-weight: 600;
    padding: 0.85rem 2rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease-in-out;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.custom-btn-primary:hover {
    background-color: #8c4242;
    border-color: #8c4242;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(var(--primary-red-rgb), 0.3);
}

.footer {
    background-color: var(--primary-black);
    color: var(--white);
    margin-top: auto; /* Добавлено для sticky footer */
}
/* Стили для галереи в админке */
#gallery-preview { min-height: 120px; }
.gallery-item { position: relative; margin: 5px; border: 2px solid transparent; cursor: grab; width: 100px; height: 100px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item.is-main { border-color: #a64e4e; box-shadow: 0 0 5px #a64e4e; }
.gallery-item .remove-img-btn { position: absolute; top: 2px; right: 2px; background-color: rgba(255,255,255,0.7); border-radius: 50%; }

/* Дополнительные стили из newstyle.css, адаптированные */
.t-body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: var(--font-family-base);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 16px;
    padding: 0;
    color: var(--primary-black);
}
.t-body a {
    color: var(--primary-red);
}
.t-body a:hover {
    color: #8c4242;
}

.t-heading {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: var(--font-family-base);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    padding: 0;
    color: var(--primary-black);
}
.t-heading a {
    color: var(--primary-red);
}
.t-heading a:hover {
    color: #8c4242;
}
.t-heading.-size-xxl {
    font-size: 36px;
}
.t-heading.-size-xl {
    font-size: 32px;
}
.t-heading.-size-l {
    font-size: 28px;
}
@media (max-width: 1023px) {
    .t-heading.-responsive-size-l {
        font-size: 24px;
    }
}
.t-heading.-size-m {
    font-size: 24px;
}
.t-heading.-size-s {
    font-size: 20px;
}
.t-heading.-size-xs {
    font-size: 18px;
}
.t-heading.-size-xxs {
    font-size: 14px;
}
.t-heading.-color-dark {
    color: var(--primary-black);
}
.t-heading.-color-light {
    color: var(--white);
}
.t-heading.-weight-normal {
    font-weight: 400;
}
.t-heading.-weight-light {
    font-weight: 300;
}

.e-btn, .e-btn--outline, .e-btn--3d {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    display: inline-block;
    margin: 0;
    border: none;
    border-radius: 0.5rem; /* Адаптировано под Bootstrap */
    font-family: var(--font-family-base);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    background-color: var(--primary-red); /* Основной цвет */
    color: var(--white);
    padding: 0.75rem 1.5rem; /* Адаптировано под Bootstrap */
    font-weight: 500;
    transition: all 0.3s;
}
.e-btn:hover, .e-btn--outline:hover, .e-btn--3d:hover,
.e-btn:focus, .e-btn--outline:focus, .e-btn--3d:focus,
.e-btn:active, .e-btn--outline:active, .e-btn--3d:active {
    text-decoration: none;
    outline: none;
    background-color: #8c4242; /* Более темный красный */
    border-color: #8c4242;
    color: var(--white);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-red-rgb), 0.5) !important;
}
.e-btn--outline {
    background-color: transparent;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
}
.e-btn--outline:hover, .e-btn--outline:focus, .e-btn--outline:active {
    background-color: var(--primary-red);
    color: var(--white);
}

/* Переопределение Bootstrap-классов для соответствия новому дизайну */
.btn-check:focus + .btn-outline-primary, .btn-outline-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-red-rgb), 0.5) !important;
}
.btn-check:checked + .btn-outline-primary, .btn-check:active + .btn-outline-primary, .btn-outline-primary:active, .btn-outline-primary.active, .btn-outline-primary.dropdown-toggle.show {
    color: var(--white);
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-red-rgb), 0.5) !important;
}

.form-control:focus, .form-select:focus {
    border-color: rgba(var(--primary-red-rgb), 0.5);
}

/* Градиент для затемнения нижней части изображений на карточках */
.bg-dark-gradient {
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}
/* Эффект увеличения при наведении на карточку */
.zoom-effect img {
    transition: transform 0.5s ease;
}
.zoom-effect:hover img {
    transform: scale(1.05);
}

/* Улучшенные стили для кнопок сортировки и фильтров */
.btn-outline-primary {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-red);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(var(--primary-red-rgb), 0.2);
}

/* Стиль для кнопки "В корзине", чтобы она была контурной */
.btn-cart-added {
    background-color: transparent !important;
    border-color: var(--primary-red) !important;
    color: var(--primary-red) !important;
    
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
}

.btn-cart-added:hover {
    background-color: var(--primary-red) !important;
    color: var(--white) !important;
}

/* ==========================================================================
   Mobile-First Адаптация
   ========================================================================== */

@media (max-width: 767.98px) {
    
    /* 1. Главная страница: карточки */
    .home-page-cards .card-img-top {
        aspect-ratio: 3 / 2;
    }
    
    /* 2. Гастробоксы: сетка и фильтры */
    #products-page .col-md-6, #products-page .col-lg-4 {
        flex: 0 0 auto;
        width: 50%; /* Два товара в ряд */
    }
    #products-page .card-title {
        font-size: 1rem; /* Уменьшаем шрифт заголовка */
    }
    #products-page .fs-3 {
        font-size: 1.1rem !important; /* Уменьшаем шрифт цены еще раз */
    }
    #products-page .card-footer .d-flex {
        flex-direction: column;
        align-items: center !important;
    }
    #products-page .card-footer .fs-3 {
        margin-bottom: 0.5rem;
    }
    
    /* Скрываем текст "Сортировка" */
    .sort-label-text {
        display: none;
    }

    /* 3. Кейтеринг и Корп. питание: убираем узость */
    .narrow-text-block {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* 4. Аренда: отступы в форме */
    .rent-form-container {
        padding: 1.5rem;
    }

    /* 5. О компании: съехавшие блоки */
    .founders-section img {
        width: 150px; /* Уменьшаем фото основателей */
        height: 150px;
    }

    .timeline-v2::before {
        left: 10px; /* Сдвигаем линию влево */
    }
    .timeline-v2-item::before {
        left: 10px; /* Сдвигаем кружки влево */
    }
    .timeline-v2-item.left .timeline-v2-content,
    .timeline-v2-item.right .timeline-v2-content {
        margin-left: 40px; /* Все блоки справа от линии */
        margin-right: 0;
        text-align: left;
    }

    /* 6. Корзина: адаптивная таблица */
    .cart-table thead {
        display: none; /* Скрываем заголовки */
    }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td {
        display: block;
        width: 100%;
    }
    .cart-table tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 1rem;
    }
    .cart-table td {
        border: none;
        padding: 0.5rem 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .cart-table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 1rem;
    }
    .cart-table .cart-product-info {
        justify-content: flex-start;
    }
    .cart-table .cart-product-info img {
        margin-right: 1rem;
    }
}
