/* Убран старый фикс overflow-x так как он вызывал побочные эффекты */

/* Стили для хлебных крошек внутри товара */
#product-product .breadcrumb {
    display: block !important;
    visibility: visible !important;
    background: transparent;
    padding: 10px 0 8px 0;
    margin: 10px 0 20px 0;
    list-style: none;
    border-radius: 4px;
}

#product-product .breadcrumb li {
    display: inline-block;
    margin-right: 2px;
    color: #666;
}

#product-product .breadcrumb li:not(:last-child):after {
    content: "/";
    margin-left: 4px;
}

#product-product .breadcrumb li:not(:last-child):hover {
    text-decoration: none;
}

#product-product .breadcrumb li:last-child {
    color: #333;
    font-weight: 500;
}

#product-product .breadcrumb a {
    color: #212735;
    text-decoration: none;
    transition: color 0.2s ease;
}

#product-product .breadcrumb a:hover {
    color: #0b57d0;
    text-decoration: none;
}

/* Изолированные стили галереи для OpenCart */
/* Галерея контейнер - оптимизация для планшетов */
.oc-gallery-container {
    width: 100%;
    max-width: 600px;
    /* Увеличено для планшетов */
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.oc-main-swiper {
    width: 100%;
    overflow: hidden;
}

.oc-main-swiper .swiper-wrapper {
    width: 100%;
}

.oc-main-swiper .swiper-slide {
    width: 100% !important;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Контейнер с относительным позиционированием */
.oc-gallery-wrapper {
    position: relative;
    width: 100%;
}

.h-20 {
    height: 3rem;
}

.pt-6 {
    padding-top: 0.5rem;
}

.mb-5 {
    margin-bottom: 1rem;
}

/* Пагинация связанных товаров */
.related-products-pagination {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-top: 16px !important;
    transform: translate3d(0, 0, 0) !important;
    z-index: 10 !important;
}

.related-products-pagination .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background-color: #555555;
    border-radius: 50%;
    opacity: 0.5;
    margin: 0 3px;
    transition: all 0.2s ease;
}

.related-products-pagination .swiper-pagination-bullet-active {
    background-color: #121212;
    opacity: 1;
    transform: scale(1.2);
}

@media (min-width: 768px) {
    .oc-gallery-container {
        max-width: 500px;
        /* Соответствует ширине слайда */
    }
}

@media (min-width: 992px) {
    .oc-gallery-container {
        max-width: 560px;
        /* Десктоп */
    }
}

/* Главный слайдер */
.oc-main-swiper {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.oc-main-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.oc-main-swiper .swiper-slide img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

/* Планшеты - изображения соответствуют контейнеру */
@media (max-width: 991px) and (min-width: 768px) {
    .oc-main-swiper .swiper-slide {
        width: 100% !important;
        height: 500px !important;
        max-width: 100% !important;
        max-height: 500px !important;
    }

    .oc-main-swiper .swiper-slide img {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
    }
}

/* Мобильные - слайдер включен */
@media (max-width: 767px) {
    .oc-main-swiper .swiper-slide {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        aspect-ratio: 1 / 1;
        min-height: 300px;
    }

    .oc-main-swiper .swiper-slide img {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
    }
}

@media (max-width: 480px) {
    .oc-main-swiper .swiper-slide {
        min-height: 250px;
    }
}

/* Убираем слайдер только на десктопе - показываем только первое изображение */
@media (min-width: 992px) {
    .oc-main-swiper .swiper-wrapper {
        transform: none !important;
        transition: none !important;
    }

    .oc-main-swiper .swiper-slide {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    .oc-main-swiper .swiper-slide:not(:first-child) {
        display: none !important;
    }

    .oc-mobile-pagination {
        display: none !important;
    }
}

.oc-main-swiper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Пагинация (Пилюля на мобильных) */
.oc-mobile-pagination {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-top: 16px !important;
    transform: translate3d(0, 0, 0) !important;
    z-index: 10 !important;
}

@media (min-width: 992px) {
    .oc-mobile-pagination {
        display: none !important;
    }
}

.oc-mobile-pagination .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background-color: #555555;
    border-radius: 50%;
    opacity: 0.5;
    margin: 0 3px !important;
    transition: all 0.2s ease;
}

.oc-mobile-pagination .swiper-pagination-bullet-active {
    background-color: #121212;
    opacity: 1;
    transform: scale(1.2);
}

/* Сетка миниатюр (Десктоп) */
.oc-thumbs-grid {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

@media (min-width: 992px) {
    .oc-thumbs-grid {
        display: grid;
    }
}

/* Изображения связанных товаров */
.related-products-swiper .swiper-slide img,
.related-products-wrapper:not(.lg\\:hidden) img {
    width: 300px !important;
    height: 300px !important;
    max-width: 300px !important;
    max-height: 300px !important;
    object-fit: contain !important;
}

/* Исправление растягивания одного товара */
@media (max-width: 1023px) {
    .related-products-wrapper .grid.grid-cols-1 {
        justify-content: center;
    }

    .related-products-wrapper .grid.grid-cols-1>* {
        max-width: 320px;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .related-products-wrapper .grid.grid-cols-1>* {
        max-width: 280px;
    }
}

@media (max-width: 640px) {
    .related-products-swiper .swiper-slide img {
        width: 280px !important;
        height: 280px !important;
        max-width: 280px !important;
        max-height: 280px !important;
    }
}

@media (max-width: 480px) {
    .related-products-swiper .swiper-slide img {
        width: 240px !important;
        height: 240px !important;
        max-width: 240px !important;
        max-height: 240px !important;
    }
}

.oc-thumb-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
    background-color: transparent;
    opacity: 1;
    /* Убрали прозрачность */
    transition: all 0.2s ease;
}

.oc-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

/* Устаревшие правила .row и .col-md-6 удалены для совместимости с Tailwind */

/* Правила min-height и sticky удалены, используются нативные стили и JS */


/* Адаптивность для планшетов - горизонтальная галерея */
@media (max-width: 991px) {

    /* Галерея на планшетах - горизонтальная */
    #product-product .oc-gallery-container {
        margin-bottom: 20px;
    }

    #product-product .oc-main-swiper img {
        object-fit: contain;
        width: 100%;
    }

    /* Заголовок на планшетах */
    #product-product h1 {
        font-size: 24px;
        margin-top: 20px;
    }

    /* Цена на планшетах */
    #product-product h2 {
        font-size: 22px;
    }

    /* Вкладки на планшетах */
    #product-product .nav-tabs>li {
        float: none;
        display: block;
        margin-bottom: 5px;
    }

    #product-product .nav-tabs>li>a {
        margin-right: 0;
        border-radius: 4px;
        display: block;
        text-align: center;
    }

    #product-product .tab-content {
        margin-top: 20px;
    }
}

/* Для маленьких мобильных устройств */
@media (max-width: 767px) {
    #product-product {
        padding: 0 15px;
    }

    /* Стили для таблиц теперь управляются через .tbl-scroll (см. ниже) */

    /* Заголовки на мобильных */
    #product-product h1 {
        font-size: 20px;
        line-height: 1.3;
    }

    /* Таблица атрибутов на мобильных */
    #product-product .table {
        font-size: 14px;
    }

    #product-product .table td {
        padding: 8px;
    }

    /* Форма отзыва на мобильных */
    #product-product .form-group {
        margin-bottom: 15px;
    }

    /* Стили #button-cart удалены для использования Tailwind-классов в шаблоне */


}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    /* Отступы галереи нормализованы */

    #product-product h1 {
        font-size: 18px;
    }

    #product-product h2 {
        font-size: 20px;
    }

    /* Список характеристик на мобильных */
    #product-product .list-unstyled {
        font-size: 14px;
    }

    /* Опции товара на мобильных */
    #product-product .form-group label {
        font-size: 14px;
        margin-bottom: 5px;
    }

    #product-product .form-control {
        font-size: 16px;
        /* Увеличиваем для iOS */
        padding: 12px;
    }
}

/* Для сверхмаленьких экранов */
@media (max-width: 360px) {}

/* Конец блока стилей кнопок */

.oc-thumb-item.is-active {
    opacity: 1;
}

/* Убираем прозрачность со всех миниатюр глобально */
.oc-thumb-item {
    opacity: 1 !important;
}

.oc-thumb-item:hover {
    opacity: 1 !important;
}

/* ========== СТИЛИ ДЛЯ ХЛЕБНЫХ КРОШЕК (ПРИОРИТЕТНЫЕ) ========== */

/* Контейнер хлебной крошки - абсолютное позиционирование */
.breadcrumb-container {
    display: flex !important;
    visibility: visible !important;
    position: absolute !important;
    top: 15px !important;
    left: 15px !important;
    z-index: 40 !important;
    margin-left: 15px !important;
    max-width: calc(100vw - 200px) !important;
    /* Адаптивная ширина с учетом переключателя языков */
    overflow: hidden !important;
}

/* Скрыть на мобильных */
@media (max-width: 1023px) {
    .breadcrumb-container {
        display: none !important;
    }
}

/* Показать на десктопе */
@media (min-width: 1024px) {
    .breadcrumb-container {
        display: flex !important;
    }
}

/* Адаптивная ширина для разных размеров экрана */
@media (min-width: 1024px) and (max-width: 1280px) {
    .breadcrumb-container {
        max-width: calc(100vw - 180px) !important;
    }
}

@media (min-width: 1280px) and (max-width: 1536px) {
    .breadcrumb-container {
        max-width: calc(100vw - 200px) !important;
    }
}

@media (min-width: 1536px) {
    .breadcrumb-container {
        max-width: 1200px !important;
        /* Ограничение максимальной ширины на больших экранах */
    }
}

/* Список хлебной крошки */
.breadcrumb-container .breadcrumb {
    display: flex !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #4B5563 !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    flex-wrap: wrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Элементы списка */
.breadcrumb-container .breadcrumb li {
    display: inline-block !important;
    margin-right: 0.5rem !important;
    color: inherit !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Разделители */
.breadcrumb-container .breadcrumb li:not(:last-child):not(:first-child) {
    color: #9CA3AF !important;
}

/* Последний элемент (текущая страница) */
.breadcrumb-container .breadcrumb li:last-child {
    color: #111827 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 300px !important;
}

/* Ссылки */
.breadcrumb-container .breadcrumb a {
    color: #212735 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 200px !important;
}

.breadcrumb-container .breadcrumb a:hover {
    color: #0b57d0 !important;
}

@media (min-width: 1024px) {
    .product-col-sticky {
        position: sticky;
        align-self: start;
        transition: top 0.15s ease;
    }
}

/* Уменьшаем отступ между галереей и информацией на мобильных и планшетах */
@media (max-width: 1023px) {
    #product-product .grid.grid-cols-1.lg\:grid-cols-2 {
        gap: 1rem;
        /* Уменьшаем с 2rem до 1rem (16px) */
    }
}

@media (max-width: 767px) {
    #product-product .grid.grid-cols-1.lg\:grid-cols-2 {
        gap: 0.5rem;
        /* Еще меньше на мобильных (8px) */
    }
}

@media (max-width: 480px) {
    #product-product .grid.grid-cols-1.lg\:grid-cols-2 {
        gap: 0.25rem;
        /* Минимальный отступ на маленьких мобильных (4px) */
    }
}

/* Приятное оформление таблиц в описании (ГЛОБАЛЬНО) */
.user-content table {
    width: 100% !important;
    border: none !important;
    margin-bottom: 20px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.user-content table thead th {
    font-weight: bold !important;
    text-align: left !important;
    border: none !important;
    padding: 10px 15px 10px 30px !important;
    background: #EDEDED !important;
    font-size: 16px !important;
    border-top: 1px solid #ddd !important;
}

.user-content table tr th:first-child,
.user-content table tr td:first-child {
    border-left: 1px solid #ddd !important;
}

.user-content table tr th:last-child,
.user-content table tr td:last-child {
    border-right: 1px solid #ddd !important;
}

.user-content table thead tr th:first-child {
    border-radius: 20px 0 0 0 !important;
}

.user-content table thead tr th:last-child {
    border-radius: 0 20px 0 0 !important;
}

/* Рамки и скругления сверху для таблиц БЕЗ thead (где tbody - первый ребенок) */
.user-content table tbody:first-child tr:first-child td {
    border-top: 1px solid #ddd !important;
}

.user-content table tbody:first-child tr:first-child td:first-child {
    border-radius: 20px 0 0 0 !important;
}

.user-content table tbody:first-child tr:first-child td:last-child {
    border-radius: 0 20px 0 0 !important;
}

.user-content table tbody td {
    text-align: left !important;
    border: none !important;
    padding: 10px 15px 10px 30px !important;
    font-size: 16px !important;
    vertical-align: top !important;
}

.user-content table tbody tr:nth-child(even) {
    background: #F8F8F8 !important;
}

.user-content table tbody tr:hover td {
    background: #eaeaea !important;
}

.user-content table tbody tr:last-child td {
    border-bottom: 1px solid #ddd !important;
}

.user-content table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 20px !important;
}

.user-content table tbody tr:last-child td:last-child {
    border-radius: 0 0 20px 0 !important;
}

.user-content table table {
    border: none !important;
    margin-bottom: 0 !important;
}

/* Списки внутри пользовательского контента (описание товара) */
.user-content ul,
.user-content ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.user-content ul {
    list-style: disc outside;
}

.user-content ol {
    list-style: decimal outside;
}

.user-content ul ul {
    list-style: circle outside;
}

.user-content ul ul ul {
    list-style: square outside;
}

.user-content li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.user-content li:last-child {
    margin-bottom: 0;
}

.user-content p {
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.user-content p:last-child {
    margin-bottom: 0;
}


