/*
 * Описание товара и модальный просмотр фотографий
 * Файл: product-description.css
 */


/* =========================================================
   ОБЩИЙ БЛОК ОПИСАНИЯ
   ========================================================= */

#product_full_desc.product-description {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto 0;
    color: #252525;
    font-size: 17px;
    line-height: 1.65;
    box-sizing: border-box;
}

#product_full_desc,
#product_full_desc * {
    box-sizing: border-box;
}

#product_full_desc .product-description__text,
#product_full_desc .product-description__specs,
#product_full_desc .product-description__order,
#product_full_desc .product-description__gallery {
    margin: 0 0 32px;
}

#product_full_desc .product-description__gallery:last-child,
#product_full_desc > *:last-child {
    margin-bottom: 0;
}


/* =========================================================
   ЗАГОЛОВКИ И ТЕКСТ
   ========================================================= */

#product_full_desc h2 {
    margin: 0 0 16px;
    padding: 0;
    color: #202020;
    font-size: 24px;
    line-height: 1.3;
    font-weight: 700;
}

#product_full_desc h3,
#product_full_desc .product-photos-title {
    position: relative;
    margin: 24px 0 12px;
    padding: 0 0 0 14px;
    color: #252525;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
}

#product_full_desc h3::before,
#product_full_desc .product-photos-title::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 4px;
    border-radius: 4px;
    background: #8057b5;
}

#product_full_desc p {
    margin: 0 0 16px;
    padding: 0;
}

#product_full_desc p:last-child {
    margin-bottom: 0;
}

#product_full_desc strong,
#product_full_desc b {
    font-weight: 600;
}

#product_full_desc a {
    color: #5d328e;
    text-decoration: underline;
}

#product_full_desc a:hover {
    color: #402064;
    text-decoration: none;
}


/* =========================================================
   ХАРАКТЕРИСТИКИ
   ========================================================= */

#product_full_desc .product-specs {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e1e1e1;
    border-radius: 9px;
    background: #ffffff;
}

#product_full_desc .product-specs__item {
    display: flex;
    align-items: flex-start;
    width: 100%;
    margin: 0;
    padding: 13px 18px;
    border-bottom: 1px solid #e8e8e8;
}

#product_full_desc .product-specs__item:last-child {
    border-bottom: 0;
}

#product_full_desc .product-specs__item:nth-child(odd) {
    background: #f7f7f7;
}

#product_full_desc .product-specs dt {
    flex: 0 0 38%;
    max-width: 38%;
    margin: 0;
    padding: 0 18px 0 0;
    color: #4d4d4d;
    font-weight: 600;
    line-height: 1.5;
}

#product_full_desc .product-specs dd {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: #202020;
    line-height: 1.5;
}


/* =========================================================
   БЛОК ЗАКАЗА / ВАЖНОЙ ИНФОРМАЦИИ
   ========================================================= */

#product_full_desc .product-description__order {
    padding: 20px 22px;
    border-left: 4px solid #8057b5;
    border-radius: 0 8px 8px 0;
    background: #f7f3fb;
}

#product_full_desc .product-description__order h2 {
    margin-bottom: 10px;
    font-size: 20px;
}

#product_full_desc .product-description__order p {
    margin-bottom: 10px;
}

#product_full_desc .product-description__order p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   ФОТОГАЛЕРЕЯ
   ========================================================= */

#product_full_desc .product-description__photos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    margin: 0 0 20px;
}

#product_full_desc .product-description__photos:last-child {
    margin-bottom: 0;
}

#product_full_desc .product-description__photos img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #f3f3f3;
    cursor: zoom-in;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

#product_full_desc .product-description__photos img:hover {
    opacity: 0.93;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}


/* Если заголовки Мужская/Женская футболка пока остались ссылками */

#product_full_desc .product-description__gallery > a,
#product_full_desc .product-description__gallery > p > a {
    position: relative;
    display: block;
    margin: 24px 0 12px;
    padding-left: 14px;
    color: #252525;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    text-decoration: none;
}

#product_full_desc .product-description__gallery > a::before,
#product_full_desc .product-description__gallery > p > a::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 4px;
    border-radius: 4px;
    background: #8057b5;
}


/* =========================================================
   МОДАЛЬНОЕ ОКНО
   ========================================================= */

.product-photo-modal {
    position: fixed;
    z-index: 100000;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    display: none;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
    padding: 55px 75px 45px;
    overflow: hidden;
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
}

.product-photo-modal.is-open {
    display: flex;
    opacity: 1;
}

.product-photo-modal__content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

.product-photo-modal__image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;

    object-fit: contain;

    border: 0;
    border-radius: 4px;
    background: transparent;

    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.product-photo-modal__close,
.product-photo-modal__prev,
.product-photo-modal__next {
    position: absolute;
    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;

    background: transparent;
    color: #ffffff;

    font-family: Arial, Helvetica, sans-serif;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;
    text-align: center;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.7);

    opacity: 0.85;
    transition:
        opacity 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.product-photo-modal__close:hover,
.product-photo-modal__prev:hover,
.product-photo-modal__next:hover {
    opacity: 1;
}

.product-photo-modal__close:focus,
.product-photo-modal__prev:focus,
.product-photo-modal__next:focus {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}


/* Кнопка закрытия */

.product-photo-modal__close {
    top: 8px;
    right: 12px;

    width: 48px;
    height: 48px;

    border-radius: 50%;
    font-size: 42px;
}

.product-photo-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.04);
}


/* Стрелки */

.product-photo-modal__prev,
.product-photo-modal__next {
    top: 50%;

    width: 58px;
    height: 82px;
    margin-top: -41px;

    border-radius: 6px;
    font-size: 66px;
}

.product-photo-modal__prev {
    left: 7px;
}

.product-photo-modal__next {
    right: 7px;
}

.product-photo-modal__prev:hover,
.product-photo-modal__next:hover {
    background: rgba(255, 255, 255, 0.12);
}


/* Счётчик */

.product-photo-modal__counter {
    position: absolute;
    right: 0;
    bottom: -32px;
    left: 0;

    min-height: 22px;
    margin: 0;
    padding: 0;

    color: #ffffff;
    font-size: 14px;
    line-height: 22px;
    font-weight: 400;
    text-align: center;

    opacity: 0.9;
}


/* Блокировка прокрутки страницы */

html.product-photo-modal-open,
body.product-photo-modal-open {
    overflow: hidden;
}


/* =========================================================
   ПЛАНШЕТЫ
   ========================================================= */

@media (max-width: 900px) {
    #product_full_desc.product-description {
        font-size: 16px;
    }

    #product_full_desc .product-description__photos {
        gap: 10px;
    }

    .product-photo-modal {
        padding-right: 60px;
        padding-left: 60px;
    }

    .product-photo-modal__prev,
    .product-photo-modal__next {
        width: 48px;
    }
}


/* =========================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ========================================================= */

@media (max-width: 700px) {

    /* Общий блок */

    #product_full_desc.product-description {
        width: 100%;
        max-width: none;
        margin-top: 22px;
        padding: 0;
        font-size: 16px;
        line-height: 1.6;
    }

    #product_full_desc .product-description__text,
    #product_full_desc .product-description__specs,
    #product_full_desc .product-description__order,
    #product_full_desc .product-description__gallery {
        margin-bottom: 24px;
    }


    /* Заголовки */

    #product_full_desc h2 {
        margin-bottom: 13px;
        font-size: 21px;
        line-height: 1.35;
    }

    #product_full_desc h3,
    #product_full_desc .product-photos-title {
        margin: 20px 0 9px;
        padding-left: 12px;
        font-size: 16px;
    }

    #product_full_desc h3::before,
    #product_full_desc .product-photos-title::before {
        width: 3px;
    }

    #product_full_desc p {
        margin-bottom: 15px;
    }


    /* Характеристики */

    #product_full_desc .product-specs {
        border-radius: 8px;
    }

    #product_full_desc .product-specs__item {
        display: flex;
        align-items: flex-start;
        padding: 11px 14px;
    }

    #product_full_desc .product-specs dt {
        flex: 0 0 38%;
        max-width: 38%;
        padding-right: 10px;
        font-size: 14px;
        line-height: 1.45;
    }

    #product_full_desc .product-specs dd {
        flex: 1 1 62%;
        font-size: 15px;
        line-height: 1.45;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }


    /* Блок заказа */

    #product_full_desc .product-description__order {
        padding: 16px 17px;
        border-left-width: 3px;
    }

    #product_full_desc .product-description__order h2 {
        font-size: 19px;
    }


    /* Галерея */

    #product_full_desc .product-description__photos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 17px;
    }

    #product_full_desc .product-description__photos img {
        border-radius: 6px;
    }

    #product_full_desc .product-description__photos img:hover {
        opacity: 1;
        transform: none;
        box-shadow: none;
    }

    #product_full_desc .product-description__gallery > a,
    #product_full_desc .product-description__gallery > p > a {
        margin: 20px 0 9px;
        padding-left: 12px;
        font-size: 16px;
    }

    #product_full_desc .product-description__gallery > a::before,
    #product_full_desc .product-description__gallery > p > a::before {
        width: 3px;
    }


    /* Модальное окно */

    .product-photo-modal {
        padding: 52px 5px 45px;
        background: rgba(0, 0, 0, 0.96);
    }

    .product-photo-modal__content {
        width: 100%;
        height: 100%;
    }

    .product-photo-modal__image {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .product-photo-modal__close {
        top: 3px;
        right: 5px;

        width: 44px;
        height: 44px;

        font-size: 40px;
    }

    .product-photo-modal__prev,
    .product-photo-modal__next {
        top: 50%;

        width: 40px;
        height: 66px;
        margin-top: -33px;

        border-radius: 5px;
        background: rgba(0, 0, 0, 0.28);
        font-size: 52px;
        opacity: 0.9;
    }

    .product-photo-modal__prev {
        left: 1px;
    }

    .product-photo-modal__next {
        right: 1px;
    }

    .product-photo-modal__counter {
        bottom: -31px;
        font-size: 13px;
    }
}


/* =========================================================
   ОЧЕНЬ УЗКИЕ ЭКРАНЫ
   ========================================================= */

@media (max-width: 380px) {
    #product_full_desc.product-description {
        font-size: 15px;
    }

    #product_full_desc .product-specs__item {
        padding: 10px 11px;
    }

    #product_full_desc .product-specs dt {
        flex-basis: 39%;
        max-width: 39%;
        padding-right: 8px;
        font-size: 13px;
    }

    #product_full_desc .product-specs dd {
        flex-basis: 61%;
        font-size: 14px;
    }

    #product_full_desc .product-description__photos {
        gap: 6px;
    }
}


/* =========================================================
   УМЕНЬШЕНИЕ АНИМАЦИИ
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    #product_full_desc .product-description__photos img,
    .product-photo-modal__close,
    .product-photo-modal__prev,
    .product-photo-modal__next {
        transition: none;
    }
}