/* ===== Modern product card styles ===== */

/* --- base (was inline in product.tpl) --- */
.btn.btn-danger {
    background-color: #E74C3C;
    color: #fff;
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    border-radius: 3px;
    padding: 10px 0;
}
.button-messangers {
    width: 30%;
    background: #94280d;
    color: #fff;
    padding: 4px;
    display: block;
    float: left;
    border: 1px solid #fff;
    text-align: center;
    text-decoration: none;
}
.mobiles { display: none; }
@media screen and (max-width: 1024px) {
    .desktoper { display: none; }
    .mobiles { display: inline-block; }
    .user-detail-action { margin-top: 30px; }
}

/* Viber: дубль ссылок — правило по #product, чтобы работало при любом кеше шаблона / без .product-modern */
#product .right_product_page .button-messangers.mobiles {
    display: none !important;
}
@media screen and (max-width: 1024px) {
    #product .right_product_page .button-messangers.desktoper {
        display: none !important;
    }
    #product .right_product_page .button-messangers.mobiles {
        display: inline-block !important;
    }
}

.wrapper_product_page.product-modern {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.wrapper_product_page.product-modern .left_product_page,
.wrapper_product_page.product-modern .right_product_page {
    width: 100%;
    min-width: 0;
}

/* Правая колонка: без float от .col-sm-3, иначе узкий грид + колонка Bootstrap дают съезжание блоков */
.wrapper_product_page.product-modern .right_product_page {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.wrapper_product_page.product-modern .right_product_page #column-right {
    float: none !important;
    width: 100% !important;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
}

.wrapper_product_page.product-modern .left_product_page_t {
    margin: 0 0 16px;
    font-family: HelveticaNeueCyrBlack;
    font-size: 28px;
    line-height: 1.25;
    color: #2C3D51;
    text-transform: none;
}

.wrapper_product_page.product-modern .product_info_page_g {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    box-sizing: border-box;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(44, 61, 81, 0.10);
    padding: 20px;
    gap: 20px;
}

.wrapper_product_page.product-modern .thamb_images_product {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 100%;
}

.wrapper_product_page.product-modern .product_info_y {
    flex: 1 1 280px;
    min-width: 0;
    max-width: 100%;
    margin-left: 0;
    box-sizing: border-box;
}

/* Галерея: один слайд на экран, без полосы превью (как на motorland) */
.wrapper_product_page.product-modern .product-gallery-slider.carousel_image_thumb {
    margin-top: 0;
    max-width: 100%;
    position: relative;
    border-radius: 12px;
    overflow: visible;
    background: #f4f6f8;
    border: 1px solid #e6ecf1;
}

.wrapper_product_page.product-modern .product-gallery-slider.slick-dotted.slick-slider {
    margin-bottom: 0;
}

.wrapper_product_page.product-modern .product-gallery-slide-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    max-height: min(72vh, 560px);
}

.wrapper_product_page.product-modern .product-gallery-slide .MagicZoom {
    display: block;
    width: 100%;
    text-align: center;
    cursor: pointer;
}

.wrapper_product_page.product-modern .product-gallery-slide .MagicZoom img {
    width: 100%;
    max-height: min(72vh, 560px);
    height: auto;
    object-fit: contain;
    object-position: center;
    display: inline-block;
    vertical-align: middle;
    border-radius: 0;
    box-sizing: border-box;
}

.wrapper_product_page.product-modern .product-gallery-slider .slick-list {
    border-radius: 12px;
    overflow: hidden;
    cursor: grab;
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
}

.wrapper_product_page.product-modern .product-gallery-slider.slick-slider.slick-slider-dragging .slick-list {
    cursor: grabbing;
}

/* MagicZoom ставит touch-action: pan-y — блокирует горизонтальный свайп Slick */
.wrapper_product_page.product-modern .product-gallery-slider .MagicZoom,
.wrapper_product_page.product-modern .product-gallery-slider .mz-figure,
.wrapper_product_page.product-modern .product-gallery-slider .MagicZoom img,
.wrapper_product_page.product-modern .product-gallery-slider .mz-figure img {
    touch-action: pan-x pan-y !important;
    -ms-touch-action: pan-x pan-y !important;
}

.wrapper_product_page.product-modern .product-gallery-slider .slick-track {
    display: flex;
    align-items: center;
}

.wrapper_product_page.product-modern .product-gallery-slide {
    outline: none;
}

/* Стрелки слайдера */
.wrapper_product_page.product-modern .product-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(44, 61, 81, 0.88);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, opacity 0.2s;
}

.wrapper_product_page.product-modern .product-gallery-arrow:hover {
    background: rgba(44, 61, 81, 1);
}

.wrapper_product_page.product-modern .product-gallery-arrow:focus {
    outline: 2px solid #fbb005;
    outline-offset: 2px;
}

.wrapper_product_page.product-modern .product-gallery-slider .product-gallery-prev {
    left: 10px;
}

.wrapper_product_page.product-modern .product-gallery-slider .product-gallery-next {
    right: 10px;
}

.wrapper_product_page.product-modern .product-gallery-arrow:before {
    display: block;
    line-height: 42px;
    font-size: 22px;
    font-weight: bold;
}

.wrapper_product_page.product-modern .product-gallery-prev:before {
    content: '\2039';
}

.wrapper_product_page.product-modern .product-gallery-next:before {
    content: '\203A';
}

.wrapper_product_page.product-modern .product-gallery-arrow.slick-disabled {
    opacity: 0.25;
    pointer-events: none;
}

/* Точки (dots) под слайдером */
.wrapper_product_page.product-modern .product-gallery-slider .slick-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -20px;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 8px;
    z-index: 4;
    line-height: 0;
}

.wrapper_product_page.product-modern .product-gallery-slider .slick-dots li {
    margin: 0;
    padding: 0;
    width: auto;
    height: auto;
}

.wrapper_product_page.product-modern .product-gallery-slider .slick-dots li button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 2px solid #1C7ED6;
    border-radius: 50%;
    background: transparent;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s, background 0.2s, transform 0.2s;
}

.wrapper_product_page.product-modern .product-gallery-slider .slick-dots li button:hover,
.wrapper_product_page.product-modern .product-gallery-slider .slick-dots li button:focus {
    opacity: 0.85;
    outline: none;
}

.wrapper_product_page.product-modern .product-gallery-slider .slick-dots li.slick-active button {
    opacity: 1;
    background: #1C7ED6;
    transform: scale(1.15);
}

.wrapper_product_page.product-modern .product-gallery-slider .slick-dots li button:before {
    display: none;
}

@media (max-width: 768px) {
    .wrapper_product_page.product-modern .product-gallery-slide-inner {
        min-height: 220px;
        max-height: min(65vh, 480px);
    }

    .wrapper_product_page.product-modern .product-gallery-slide .MagicZoom img {
        max-height: min(65vh, 480px);
    }

    .wrapper_product_page.product-modern .product-gallery-arrow {
        width: 38px;
        height: 38px;
    }

    .wrapper_product_page.product-modern .product-gallery-arrow:before {
        line-height: 38px;
        font-size: 20px;
    }
}


.wrapper_product_page.product-modern .product_info_y ul {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
}

.wrapper_product_page.product-modern .product_info_y ul li {
    border-bottom: 1px solid #e8edf2;
    padding: 7px 0;
}

.wrapper_product_page.product-modern .product_info_y ul li:last-child {
    border-bottom: 0;
}

.wrapper_product_page.product-modern .product_info_y ul li span:first-child {
    color: #7d8791;
}

.wrapper_product_page.product-modern .product_info_y ul li span:last-child {
    color: #2C3D51;
    font-family: HelveticaNeueCyrBold;
}

.wrapper_product_page.product-modern .price_product_add {
    margin-top: 14px;
    background: #fff;
    border: 1px solid #e6ecf1;
    border-radius: 10px;
    padding: 14px;
}

.wrapper_product_page.product-modern .price_product_add1 {
    font-size: 26px;
    line-height: 1.2;
    color: #2C3D51;
    font-family: HelveticaNeueCyrBlack;
}

.wrapper_product_page.product-modern .btn_add_carte {
    border-radius: 8px;
    border: 0;
    background: #fbb005;
    color: #2C3D51;
    font-family: HelveticaNeueCyrBold;
    font-size: 15px;
    padding: 12px 16px;
    transition: background .2s;
}

.wrapper_product_page.product-modern .btn_add_carte:hover {
    background: #e0a000;
}

.wrapper_product_page.product-modern .product_this_desc {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(44,61,81,0.08);
    padding: 18px 20px;
}

.wrapper_product_page.product-modern .product_share {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e6ecf1;
    padding: 14px 16px;
}

.wrapper_product_page.product-modern .user-detail-action,
.wrapper_product_page.product-modern .right_product_page .block_white,
.wrapper_product_page.product-modern .right_product_page #column-right .block_white {
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(44,61,81,0.08);
    padding: 14px;
    margin-bottom: 16px;
    max-width: 100%;
}

.wrapper_product_page.product-modern .right_product_page .block_white_t {
    margin-bottom: 10px;
    color: #2C3D51;
}

.wrapper_product_page.product-modern .user-detail-action .ytrewqq {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.wrapper_product_page.product-modern .btn.btn-danger.btn-phone {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    text-align: center;
    background: #2C3D51;
    border: 0;
    border-radius: 8px;
    padding: 11px 10px;
    font-family: HelveticaNeueCyrBold;
}

.wrapper_product_page.product-modern .btn.btn-danger.btn-phone:hover {
    background: #1f2d3e;
}

/* Мессенджеры: WhatsApp/Telegram — одна ссылка; Viber — две (mobiles / desktoper), видимость только через media */
.wrapper_product_page.product-modern .button-messangers {
    float: none;
    width: auto;
    border-radius: 14px;
    background: #edf3f7;
    border: 1px solid #d9e3ea;
    color: #2C3D51;
    padding: 4px 10px;
    margin: 4px 2px 0;
    font-size: 12px;
    display: inline-block;
}

.wrapper_product_page.product-modern .button-messangers.mobiles {
    display: none;
}

@media screen and (max-width: 1024px) {
    .wrapper_product_page.product-modern .button-messangers.desktoper {
        display: none;
    }

    .wrapper_product_page.product-modern .button-messangers.mobiles {
        display: inline-block;
    }
}

.wrapper_product_page.product-modern .button-messangers:hover {
    background: #e2ebf2;
    text-decoration: none;
}

.wrapper_product_page.product-modern .seller-info p {
    margin: 8px 0 0;
    color: #2C3D51;
}

.wrapper_product_page.product-modern .right_product_page .block_white_text {
    color: #2C3D51;
    line-height: 1.6;
}

.wrapper_product_page.product-modern .right_product_page .block_white_text a {
    color: #1c7ed6;
    font-family: HelveticaNeueCyrBold;
}

@media (max-width: 1200px) {
    .wrapper_product_page.product-modern {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .wrapper_product_page.product-modern .product_info_page_g {
        flex-direction: column;
    }

    .wrapper_product_page.product-modern .product_info_y {
        width: 100%;
        margin-top: 8px;
    }

    .wrapper_product_page.product-modern .thamb_images_product {
        flex: 1 1 auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .wrapper_product_page.product-modern .left_product_page_t {
        font-size: 22px;
    }
}
