/* ---------------- Стили сетки и кнопки "Один клик" ---------------- */
/* Базовый фон страницы и общие отступы */
.j2commerce-single-product {
    background-color: #f8fafc;
}

/* Заголовок товара */
.j2commerce-single-product .product-title {
    font-weight: 800;
    font-size: 2.5rem;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 20px;
}

/* Артикул и цена: Переопределение сетки для вывода артикула над ценой */
.j2commerce-single-product .sku-price-container {
    display: flex;
    flex-direction: column-reverse;
    margin-bottom: 20px !important;
}
.j2commerce-single-product .sku-price-container .col-lg-6 {
    width: 100%;
}
.j2commerce-single-product .product-sku {
    background-color: #f1f5f9;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-block;
    font-size: 15px;
    margin-bottom: 15px;
    text-align: left !important;
    width: fit-content;
}


/* Обертка цены и кнопки Купить (в одну линию) */
.price-cart-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.price-cart-wrapper .j2commerce-product-price-container {
    background-color: #f1f5f9;
    padding: 10px 25px;
    border-radius: 12px;
    display: inline-flex;
    width: auto;
    margin-bottom: 0 !important;
    flex: 0 0 auto;
}
.price-cart-wrapper .sale-price .j2commerce-product-price {
    color: #3b82f6;
    font-size: 2.2rem;
    font-weight: 800;
}
.price-cart-wrapper .product-add-to-cart-group {
    margin-bottom: 0 !important;
    flex: 1 1 auto;
}

/* Короткое описание */
.j2commerce-single-product .product-sdesc p {
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Сетка опций */
.j2commerce-single-product .options {

}
@media (max-width: 768px) {
    .j2commerce-single-product .options {
        grid-template-columns: 1fr;
    }
}
.j2commerce-single-product .options .option {
    border-radius: 16px;
    padding: 0 24px 24px 24px;
    margin-bottom: 0 !important;
    border: 1px solid transparent;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.j2commerce-single-product .options .option .form-label {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
    margin-bottom: 15px;
    display: inline;
}
.j2commerce-single-product .options .option .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    color: #334155;
    background-color: #ffffff;
}
.j2commerce-single-product .options .option .form-check {
    margin-bottom: 10px;
}
.j2commerce-single-product .options .option .form-check-label {
    color: #334155;
    font-size: 15px;
}
.j2commerce-single-product .options .option .form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* Блок корзины (Количество и кнопка купить) */
.j2commerce-single-product .product-add-to-cart-group {
    display: flex;
    gap: 15px;
}
.j2commerce-single-product .count-input {
    display: flex;
    gap: 5px;
    background: transparent;
}
.j2commerce-single-product .count-input button {
    background-color: #3b82f6;
    color: #ffffff;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.j2commerce-single-product .count-input button:hover:not(:disabled) {
    background-color: #2563eb;
}
.j2commerce-single-product .count-input input {
    background-color: #f1f5f9 !important;
    border: none !important;
    border-radius: 8px;
    width: 60px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
}
.j2commerce-single-product .j2commerce-cart-button {
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0 24px;
    flex-grow: 1;
    transition: background-color 0.2s;
}
.j2commerce-single-product .j2commerce-cart-button:hover {
    background-color: #2563eb;
}

/* Кнопки "Задать вопрос" и "Заказать в один клик" */
.j2commerce-single-product .j2c-ask-question-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
    width: 100%;
}
.j2commerce-single-product .open-ask-question-btn,
.j2commerce-single-product .open-oneclick-btn {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #0f172a !important;
    border-radius: 8px !important;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    box-sizing: border-box;
    box-shadow: none;
    margin: 0;
    height: auto;
}
#j2commerce-product-detail-tab, #j2commerceProfileTabs {
    box-shadow: none;
}
.j2commerce-single-product .open-ask-question-btn:hover,
.j2commerce-single-product .open-oneclick-btn:hover {
    background-color: #f8fafc !important;
    border-color: #334155 !important;
    transform: scale(1.02);
}
.j2commerce-single-product .open-ask-question-btn:active,
.j2commerce-single-product .open-oneclick-btn:active {
    transform: scale(0.98);
}
.j2commerce-single-product .open-ask-question-btn::before, 
.j2commerce-single-product .open-oneclick-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.05) 50%, rgba(15, 23, 42, 0) 100%);
    transform: skewX(-25deg);
    animation: askBtnShimmer 3s infinite;
    display: block !important;
}

@keyframes askBtnShimmer {
    0% { left: -100%; }
    50% { left: 200%; }
    100% { left: 200%; }
}

/* ---------------- Стили модальных окон (Оверлеи и контент) ---------------- */
.ask-question-overlay,
.oneclick-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ask-question-overlay.active,
.oneclick-overlay.active {
    opacity: 1;
}

.ask-question-content {
    background: #ffffff;
    padding: 40px 35px 35px;
    border-radius: 16px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

.oneclick-content {
    max-width: 600px;
}

.ask-question-overlay.active .ask-question-content,
.oneclick-overlay.active .ask-question-content {
    transform: translateY(0);
}

.ask-question-close,
.oneclick-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 10;
}

.ask-question-close:hover,
.oneclick-close:hover {
    color: #ef4444;
}

@media (max-width: 768px) {
    .ask-question-content { padding: 30px 25px 25px; max-width: 450px !important; }
}
@media (max-width: 480px) {
    .ask-question-content { padding: 25px 20px 20px; width: 95%; max-width: 100% !important; border-radius: 12px; }
}

/* Внутренние формы модальных окон (simpleForm2) */
.sf2-oneclick-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}
.sf2-oneclick-form-grid .sf2-form-group {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
@media (max-width: 768px) {
    .sf2-oneclick-form-grid {
        grid-template-columns: 1fr;
    }
}
textarea.oc-product-name::-webkit-scrollbar {
    width: 6px;
}
textarea.oc-product-name::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
textarea.oc-product-name::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

form.simpleForm2 .oneclick-submit-btn,
form.simpleForm2 .ask-question-submit-btn {
    background-color: #03234b !important;
    color: #ffffff !important;
    border: none !important;
    padding: 16px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    transition: background-color 0.3s ease, transform 0.2s ease !important;
    width: 100% !important;
    display: block !important;
    margin-top: 15px !important;
    box-shadow: none !important;
}
form.simpleForm2 .oneclick-submit-btn::before,
form.simpleForm2 .ask-question-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: oneClickBtnShimmer 3s infinite;
}
form.simpleForm2 .oneclick-submit-btn:hover,
form.simpleForm2 .ask-question-submit-btn:hover {
    transform: scale(1.03) !important;
    background-color: #0b2239 !important;
}

/* Галерея */
.j2commerce-single-product .product-gallery-main .swiper-slide {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}
.j2commerce-single-product .product-gallery-thumbs .swiper-slide {
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
}
.j2commerce-single-product .product-gallery-thumbs .swiper-slide-thumb-active {
    border-color: #111827;
}

/* Табы (Описание и Характеристики) */
.j2commerce-single-product .j2commerce-product-tabs {
    margin-top: 20px;
}
.j2commerce-single-product .j2commerce-product-tabs .nav-tabs {
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 30px;
    gap: 30px;
}
.j2commerce-single-product .j2commerce-product-tabs .nav-link {
    color: #64748b;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 15px 5px;
    font-size: 1.1rem;
    margin-bottom: -2px;
}
.j2commerce-single-product .j2commerce-product-tabs .nav-link:hover {
    color: #334155;
    border-color: transparent;
}
.j2commerce-single-product .j2commerce-product-tabs .nav-link.active {
    color: #0f172a;
    border-bottom-color: #0f172a;
    background: transparent;
}
.j2commerce-single-product .j2commerce-product-tabs .tab-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}
.table.table-borderless {
	margin-bottom: 20px !important;
}
.j2commerce-single-product .options .option .form-check-input:checked {
    background-color: #1a1e34;
    border-color: #1a1e34;
}
.product-gallery-main .swiper-slide img {
    cursor: pointer;
}
.j2commerce.j2commerce-single-product.simple.detail.bootstrap5.py-4 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
	padding: 0 20px;
}
/* Спецификации (Таблицы внутри табов) */
.j2commerce-single-product .j2commerce-product-specifications table {
    width: 100%;
}
.j2commerce-single-product .j2commerce-product-specifications td {
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}
.j2commerce-single-product .j2commerce-product-specifications .fw-bold {
    color: #64748b;
    font-weight: 500 !important;
	padding-left: 20px;
}
.j2commerce-single-product .j2commerce-product-specifications .text-end {
    color: #0f172a;
    font-weight: 600;
    text-align: right;
	padding-right: 20px;
}
.j2commerce-single-product .product-ldesc h2 {
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 15px;
    color: #111827;
}
.j2commerce-single-product .product-ldesc p,
.j2commerce-single-product .product-ldesc li {
    color: #475569;
    line-height: 1.7;
}

/* Кросс-селлы */
.j2commerce-single-product .j2commerce-crosssells-container {
    margin-top: 60px !important;
    border-top: none !important;
}
.j2commerce-single-product .j2commerce-crosssells-container h3 {
    font-weight: 800;
    font-size: 2rem;
    color: #111827;
    margin-bottom: 40px !important;
    text-align: center;
}
.j2commerce-single-product .j2commerce-crosssells-row .j2commerce-product-item {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.j2commerce-single-product .j2commerce-crosssells-row .j2commerce-product-item:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    transform: translateY(-8px);
}
.j2commerce-single-product .j2commerce-crosssells-row .j2commerce-product-image img {
    border-radius: 8px;
    background-color: #f8f9fa;
}
.j2commerce-single-product .j2commerce-crosssells-row .j2commerce-product-title a {
    color: #111827;
    font-weight: 700;
}
.j2commerce-single-product .j2commerce-crosssells-row .j2commerce-cart-button,
.j2commerce-single-product .j2commerce-crosssells-row .btn-outline-primary {
    background-color: #1a1e34;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
}
.j2commerce-single-product .j2commerce-crosssells-row .j2commerce-product-stock {
    display: block;
    width: fit-content;
    align-self: flex-start;
    margin: 10px 0 0 0;
    background-color: #f3f4f6;
    border-radius: 8px;
    color: #166534;
}

/* ---------------- Липкая нижняя панель (Mobile Sticky Bar) ---------------- */
.mobile-sticky-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    padding: 10px 15px;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    visibility: hidden;
}
.mobile-sticky-cart-bar.visible {
    transform: translateY(0);
    visibility: visible;
}
.mobile-sticky-cart-bar .sticky-price {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.mobile-sticky-cart-bar .sticky-label {
    font-weight: 700;
    color: #111827;
    font-size: 1.1rem;
}
.mobile-sticky-cart-bar .sticky-val {
    font-weight: 800;
    color: #111827;
    font-size: 1.2rem;
}
.mobile-sticky-cart-bar .sticky-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Счетчик количества с кнопками по бокам */
.mobile-sticky-cart-bar .sticky-count-input {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
}

/* Кнопки декремента и инкремента */
.mobile-sticky-cart-bar .sticky-count-input .sticky-decrement,
.mobile-sticky-cart-bar .sticky-count-input .sticky-increment {
    width: 38px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.mobile-sticky-cart-bar .sticky-count-input .sticky-decrement:active,
.mobile-sticky-cart-bar .sticky-count-input .sticky-increment:active {
    background-color: #2563eb;
}

.mobile-sticky-cart-bar .sticky-count-input .sticky-decrement span,
.mobile-sticky-cart-bar .sticky-count-input .sticky-increment span {
    font-size: 1rem;
    line-height: 1;
}

.mobile-sticky-cart-bar .sticky-qty-input {
    width: 50px;
    height: 44px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0;
    margin: 0;
    background-color: #ffffff;
    color: #1e293b;
}
.mobile-sticky-cart-bar .sticky-qty-input::-webkit-outer-spin-button,
.mobile-sticky-cart-bar .sticky-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.mobile-sticky-cart-bar .sticky-qty-input[type=number] {
    -moz-appearance: textfield;
}
.mobile-sticky-cart-bar .sticky-cart-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: #4caf50;
    color: #fff;
    border: none;
}

/* Стилизация Helix Ultimate кнопки "наверх" внутри мобильной панели */
.mobile-sticky-cart-bar .sp-scroll-up {
    position: static !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background-color: #000000 !important;
    color: #fff !important;
    border: none !important;
    margin: 0 !important;
    right: auto !important;
    bottom: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-decoration: none !important;
    transform: none !important;
}
.mobile-sticky-cart-bar .sp-scroll-up span {
    font-size: 1.2rem;
    line-height: 1;
}

@media (max-width: 480px) {
    .mobile-sticky-cart-bar .sticky-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }
    .mobile-sticky-cart-bar .sticky-label {
        font-size: 15px;
        color: #64748b;
    }
    .mobile-sticky-cart-bar .sticky-val {
        font-size: 1.1rem;
    }
    
    /* Уменьшаем размеры кнопок на очень маленьких экранах */
    .mobile-sticky-cart-bar .sticky-count-input .sticky-decrement,
    .mobile-sticky-cart-bar .sticky-count-input .sticky-increment {
        width: 34px;
        height: 40px;
    }
    
    .mobile-sticky-cart-bar .sticky-qty-input {
        width: 44px;
        height: 40px;
        font-size: 1rem;
    }
    
    .mobile-sticky-cart-bar .sticky-cart-btn {
        width: 40px;
        height: 40px;
    }
.j2commerce-single-product .j2commerce-cart-button {
    font-size: 15px;
    padding: 10px;
}	
}
@media (min-width: 992px) {
    .mobile-sticky-cart-bar {
        display: none !important;
    }
}

/* ---------------- Дополнительные стили для невалидных полей опций J2Commerce ---------------- */
.j2commerce-single-product .j2commerce-option-select.is-invalid,
.j2commerce-single-product .form-select.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.25) !important;
}

.custom-j2c-error {
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Дополнительные стили материалов товаров в J2Commerce ---------------- */
.current-version-info {background: #f0f7ff; padding: 20px; border-radius: 8px; margin: 20px 0;}
.pricing-info {background: #fff3cd; padding: 15px; border-left: 4px solid #ffc107; margin: 20px 0;}
.warning-block {background: #fff; border: 2px solid #dc3545; padding: 20px; border-radius: 8px; margin: 20px 0;}
.critical-warning {background: #f8d7da; border: 2px solid #f5c6cb; padding: 20px; border-radius: 8px; margin: 20px 0;}
.info-block {background: #d1ecf1; border: 2px solid #bee5eb; padding: 20px; border-radius: 8px; margin: 20px 0;}
/* ---------------- Конец Дополнительные стили материалов товаров в J2Commerce ---------------- */