/* Product.css - стили для страницы продукта */

/* ========== КНОПКА "ПОКАЗАТЬ ПОДРОБНОСТИ" ========== */
/* Добавьте эти стили в product.css */

/* Контейнер кнопки */
#show-details-button-container {
    margin-top: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Стили кнопки "Показать подробности" - как ссылка "Подробнее" на главной */
.show-details-button {
    color: var(--primary_color, #3F0B81);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.25rem; /* Такой же размер как у product-details-link */
    transition: color 0.3s ease;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: inline-block;
}

.show-details-button:hover {
    color: var(--primary_color_active, #580BE4);
    text-decoration: none;
    background: none;
}

.show-details-button:active {
    color: var(--primary_color_active, #580BE4);
}

.show-details-button:focus {
    outline: none;
    color: var(--primary_color_active, #580BE4);
}

/* Анимация появления/скрытия */
#show-details-button-container {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптация для планшетов */
@media (max-width: 991px) {
    .show-details-button {
        font-size: 1.1rem;
        padding: 0.4rem 0;
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    #show-details-button-container {
        margin-top: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .show-details-button {
        font-size: 1.05rem;
        padding: 0.4rem 0;
    }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
    .show-details-button {
        font-size: 1rem;
        padding: 0.3rem 0;
    }
}


/* ========== STICKY BUY BAR СТИЛИ ========== */
/* Добавьте эти стили в ваш product.css или super.css */

.sticky-buy-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1030; /* Выше навбара Bootstrap */
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Активное состояние - когда панель видима */
.sticky-buy-bar.visible {
    transform: translateY(0);
}

/* Контент внутри sticky панели */
.sticky-buy-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Информация о товаре в sticky панели */
.sticky-product-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0; /* Позволяет тексту обрезаться */
}

/* Название товара в sticky панели */
.sticky-product-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

/* Цена в sticky панели */
.sticky-product-price {
    font-size: 1.25rem;
    font-weight: 400;
    color: #000;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Кнопка КУПИТЬ в sticky панели */
.sticky-buy-button {
    background-image: linear-gradient(135deg, #7B2CFF, #580BE4);
    border: none;
    border-radius: 50px;
    box-shadow: 0 3px 10px rgba(88, 11, 228, 0.3);
    color: white !important;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.75rem 4.5rem;  /* Значительно увеличили горизонтальный padding */
    font-size: 1.2rem;        /* Увеличили шрифт */
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: 180px;         /* Увеличили минимальную ширину */
}

.sticky-buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 11, 228, 0.4);
    background-image: linear-gradient(135deg, #8B3CFF, #680CE4);
    color: white !important;
}

.sticky-buy-button:active,
.sticky-buy-button:focus {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(88, 11, 228, 0.3);
    background-image: linear-gradient(135deg, #6A3BFF, #4D0AC2);
    color: white !important;
    outline: none;
}

/* Адаптация для планшетов */
@media (max-width: 991px) {
    .sticky-product-name {
        font-size: 1.15rem;
        max-width: 300px;
    }

    .sticky-product-price {
        font-size: 1.15rem;
    }

    .sticky-buy-button {
        font-size: 1.1rem;
        padding: 0.65rem 3.5rem;  /* Пропорционально увеличенная ширина */
        min-width: 160px;
    }
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .sticky-buy-bar {
        padding: 0.5rem 0;
    }

    .sticky-buy-content {
        gap: 0.75rem;
    }

    .sticky-product-info {
        gap: 1rem;
    }

    .sticky-product-name {
        font-size: 1rem;
        max-width: 150px;
    }

    .sticky-product-price {
        font-size: 1rem;
    }

    .sticky-buy-button {
        font-size: 1rem;
        padding: 0.55rem 3rem;  /* Широкая кнопка даже на мобильных */
        letter-spacing: 1px;
        min-width: 140px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
    .sticky-product-name {
        font-size: 0.95rem;
        max-width: 120px;
    }

    .sticky-product-price {
        font-size: 0.95rem;
    }

    .sticky-buy-button {
        font-size: 0.95rem;
        padding: 0.5rem 2.5rem;  /* Сохраняем заметную ширину */
        min-width: 120px;
        letter-spacing: 0.8px;
    }
}

/* Добавляем отступ сверху для body когда sticky панель видима */
body.sticky-bar-active {
    padding-top: 70px;
    transition: padding-top 0.3s ease-in-out;
}

@media (max-width: 768px) {
    body.sticky-bar-active {
        padding-top: 60px;
    }
}



/* ========== СТИЛИ ДЛЯ ЗАГОЛОВКА И ПОДЗАГОЛОВКА ТОВАРА ========== */
.product-header {
    margin-bottom: 2rem;
}

/* Когда есть подзаголовок, уменьшаем отступ основного заголовка */
.product-header .product-title {
    margin-bottom: 0.5rem;
}

/* Подзаголовок товара на странице продукта - минималистичный стиль */
.product-subtitle {
    display: block;
    font-size: 1.8rem;
    font-weight: 300;
    color: #6c757d; /* Серый цвет */
    font-style: normal; /* Без курсива */
    text-transform: none; /* Оставляем как есть в базе */
    letter-spacing: 1px;
    opacity: 1;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Адаптация для планшетов */
@media (max-width: 991px) {
    .product-subtitle {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .product-header {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .product-subtitle {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
}

/* Состояние обработки кнопки с градиентным переходом */
.btn-buy-now.processing,
.buy-style-button.processing {
    cursor: wait !important;
    animation: gradientShift 2s ease-in-out infinite !important;
    background-size: 200% 200% !important;
    background-image: linear-gradient(
        135deg,
        #7B2CFF 0%,
        #9d6aff 25%,
        #580BE4 50%,
        #9d6aff 75%,
        #7B2CFF 100%
    ) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: normal !important;
    box-shadow: 0 5px 15px rgba(88, 11, 228, 0.4) !important;
    transform: none !important;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Отключаем hover эффекты во время обработки */
.btn-buy-now:hover:not(.processing),
.buy-style-button:hover:not(.processing) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(88, 11, 228, 0.5);
}

.btn-buy-now:active:not(.processing),
.buy-style-button:active:not(.processing) {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(88, 11, 228, 0.3);
}

/* Buy button styles */
.buy-style-button {
    background-color: transparent;
    border: none;
    background-image: linear-gradient(135deg, #7B2CFF, #580BE4);
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(88, 11, 228, 0.4);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.buy-style-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(88, 11, 228, 0.5);
    color: white;
    background-image: linear-gradient(135deg, #7B2CFF, #580BE4);
    border: none;
}

.buy-style-button:active,
.buy-style-button:focus {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(88, 11, 228, 0.3);
    background-image: linear-gradient(135deg, #6A3BFF, #4D0AC2);
    color: white;
    border: none;
    outline: none;
}

/* Изменяем селектор для disabled - применяется только когда НЕТ класса processing */
.buy-style-button:disabled:not(.processing) {
    cursor: not-allowed;
    opacity: 0.65;
    background-image: linear-gradient(135deg, #a0a0a0, #888888) !important;
    box-shadow: none;
    transform: none;
}

/* Payment button styles */
.payment-button-optimal {
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-size: 1.25rem;
    max-width: 320px;
    width: 100%;
    display: inline-block;
}

/* Оптимизированные стили для формы - минимум теней и переходов */
.form-control {
    padding: 0.8rem 1.25rem;
    border: 1px solid #A093FF;
    border-radius: 0.5rem;
    background-color: #fff;
    color: #212529;
    /* Убираем transitions для полей ввода */
    transition: none;
    /* Используем will-change для подготовки браузера */
    will-change: border-color;
    /* Увеличиваем размер шрифта для лучшего UX */
    font-size: 1.1rem;
}

.form-control:focus {
    border-color: #7B2CFF;
    /* Упрощаем тень - одна вместо сложной */
    box-shadow: 0 0 0 2px rgba(123, 44, 255, 0.1);
    background-color: #fff;
    color: #212529;
    outline: 0;
}

.form-control::placeholder {
    color: #A093FF;
    opacity: 1;
    /* Также увеличиваем размер placeholder */
    font-size: 1.05rem;
}

.form-control::-webkit-input-placeholder {
    color: #A093FF;
    font-size: 1.05rem;
}

.form-control::-moz-placeholder {
    color: #A093FF;
    opacity: 1;
    font-size: 1.05rem;
}

.form-control:-ms-input-placeholder {
    color: #A093FF;
    font-size: 1.05rem;
}

.form-control::-ms-input-placeholder {
    color: #A093FF;
    font-size: 1.05rem;
}

/* Form validation styles */
.was-validated .form-control:invalid {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.08);
    box-shadow: none;
}

.was-validated .form-control:invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
    background-color: rgba(220, 53, 69, 0.08);
}

/* Оптимизация чекбокса */
.form-check-input {
    /* Убираем все transitions */
    transition: none !important;
    /* Используем тот же цвет границы, что и у полей формы */
    border: 1px solid #A093FF;
}

.form-check-input:checked {
    background-color: #7B2CFF;
    border-color: #7B2CFF;
}

.form-check-input:focus {
    border-color: #9d6aff;
    box-shadow: 0 0 0 0.25rem rgba(123, 44, 255, 0.25);
}

.form-check-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.was-validated .form-check-input:invalid {
    border-color: #dc3545 !important;
    background-color: #fff;
}

.was-validated .form-check-input:invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Confirmation data styles */
.confirmation-data p {
    margin-bottom: 0.6rem;
    font-size: 1.1rem;
    line-height: 1.5;
}

.confirmation-data .data-label {
    color: #6c757d;
    font-size: 0.9em;
    display: inline-block;
    min-width: 80px;
    margin-right: 1em;
}

.confirmation-data .data-value {
    font-weight: 500;
    color: #343a40;
}

/* Product thumbnail styles */
.product-thumbnail {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 2px solid transparent;
}

.product-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #7B2CFF;
}

/* CDEK map styles */
#cdek-map {
    width: 100%;
    max-width: 800px;
    height: 500px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #eee;
    border-radius: 0.5rem;
}

.pvz-instruction {
    color: #6c757d;
    font-size: 0.95em;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Payment summary styles */
.payment-summary {
    text-align: center;
}

.payment-summary .lead-title {
    display: inline-block;
    text-align: left;
    margin-bottom: 0;
}

.payment-summary .note {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 0.1rem;
    text-align: center;
}

/* Увеличенный чекбокс для лучшей юзабилити */
.form-check-custom {
    padding-left: 2.5rem;
}

.form-check-input-lg {
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.125rem;
    margin-right: 0.75rem;
    cursor: pointer;
    /* Используем тот же цвет границы, что и у полей формы */
    border: 2px solid #A093FF;
    /* Никаких transitions */
    transition: none !important;
    /* Оптимизация рендеринга */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.form-check-input-lg:checked {
    background-color: #7B2CFF;
    border-color: #7B2CFF;
}

.form-check-input-lg:focus {
    border-color: #9d6aff;
    box-shadow: 0 0 0 0.3rem rgba(123, 44, 255, 0.25);
    outline: none;
}

.form-check-label-lg {
    /* Увеличиваем размер текста чекбокса */
    font-size: 1.15rem;
    color: #495057;
    cursor: pointer;
    line-height: 1.5;
    padding-top: 0.125rem;
}

/* Полностью убираем transitions для чекбокса */
.form-check-input-lg,
.form-check-custom .form-check-input {
    transition: none !important;
}

/* Состояние при наведении для визуальной обратной связи - без анимации */
.form-check-custom:hover .form-check-input-lg:not(:checked) {
    border-color: #7B2CFF;
    background-color: rgba(123, 44, 255, 0.05);
}

/* Убираем hover эффекты на мобильных (они вызывают задержки) */
@media (hover: none) and (pointer: coarse) {
    .form-check-custom:hover .form-check-input-lg:not(:checked) {
        border-color: #A093FF;
        background-color: transparent;
    }
}

/* Валидация для увеличенного чекбокса */
.was-validated .form-check-input-lg:invalid {
    border-color: #dc3545 !important;
    background-color: #fff;
}

.was-validated .form-check-input-lg:invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.3rem rgba(220, 53, 69, 0.25);
}

/* Оптимизация для мобильных */
@media (max-width: 768px) {
    .form-control {
        /* Отключаем эффекты на мобильных */
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        /* Увеличиваем touch target */
        min-height: 48px;
        /* Еще больше увеличиваем шрифт на мобильных для удобства */
        font-size: 1.15rem;
    }

    .form-control::placeholder {
        font-size: 1.1rem;
    }

    .form-control::-webkit-input-placeholder {
        font-size: 1.1rem;
    }

    .form-control::-moz-placeholder {
        font-size: 1.1rem;
    }

    .form-control:-ms-input-placeholder {
        font-size: 1.1rem;
    }

    .form-control::-ms-input-placeholder {
        font-size: 1.1rem;
    }

    .form-control:focus {
        /* Минимальная тень на мобильных */
        box-shadow: 0 0 0 1px #7B2CFF;
    }

    .form-check-custom {
        padding-left: 2.75rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .form-check-input-lg {
        width: 1.75rem;
        height: 1.75rem;
        margin-right: 0.875rem;
        /* Тот же цвет границы на мобильных */
        border: 2px solid #A093FF;
    }

    .form-check-label-lg {
        /* Увеличиваем размер текста на мобильных */
        font-size: 1.2rem;
        line-height: 1.6;
    }
}
