/* ================================================================
   Trendalan — Single Product v4.0
   Layout управляется через content-single-product.php напрямую.
   Никакого переопределения WooCommerce float/width — не нужно.
   ================================================================ */

/* ── PRODUCT WRAPPER ─────────────────────────────────────────── */
.trd-product {
    margin: 0;
    padding: 0;
}

/* ── ДВУХКОЛОНОЧНЫЙ LAYOUT ───────────────────────────────────── */
.trd-layout {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 40px;
    max-width: 1280px;
    margin: 36px auto;
    padding: 0 28px;
    align-items: start;
    box-sizing: border-box;
}

.trd-col-gallery {
    position: sticky;
    top: 90px;
}

.trd-col-info {
    /* ничего — WC стили сюда не лезут */
}

/* ── ГАЛЕРЕЯ ─────────────────────────────────────────────────── */
.trd-col-gallery .woocommerce-product-gallery {
    background: #fff;
    border-radius: 20px;
    padding: 14px;
    border: 1px solid #eef0f3;
    box-shadow: 0 2px 20px rgba(0,0,0,.06);
    box-sizing: border-box;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
}

.trd-col-gallery .woocommerce-product-gallery .flex-viewport {
    border-radius: 14px !important;
    overflow: hidden !important;
    background: #f7f8fa !important;
    aspect-ratio: 1 / 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.trd-col-gallery .woocommerce-product-gallery .flex-viewport img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    transition: transform .35s ease !important;
}

.trd-col-gallery .woocommerce-product-gallery .flex-viewport:hover img {
    transform: scale(1.03) !important;
}

.trd-col-gallery .woocommerce-product-gallery__trigger {
    top: 26px !important;
    right: 26px !important;
    width: 34px !important;
    height: 34px !important;
    background: rgba(255,255,255,.92) !important;
    border: 1px solid rgba(0,0,0,.1) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all .2s !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.1) !important;
}

.trd-col-gallery .woocommerce-product-gallery__trigger:hover {
    background: #f5821f !important;
    border-color: #f5821f !important;
}

/* Миниатюры */
.trd-col-gallery .woocommerce-product-gallery ol.flex-control-thumbs {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    margin: 10px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
}

.trd-col-gallery .woocommerce-product-gallery ol.flex-control-thumbs::-webkit-scrollbar { display: none; }

.trd-col-gallery .woocommerce-product-gallery ol.flex-control-thumbs li {
    float: none !important;
    flex: 0 0 calc(20% - 7px) !important;
    margin: 0 !important;
}

.trd-col-gallery .woocommerce-product-gallery ol.flex-control-thumbs img {
    border-radius: 10px !important;
    border: 2px solid transparent !important;
    cursor: pointer !important;
    transition: all .18s !important;
    opacity: .55 !important;
    width: 100% !important;
    display: block !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    background: #f7f8fa !important;
}

.trd-col-gallery .woocommerce-product-gallery ol.flex-control-thumbs img.flex-active,
.trd-col-gallery .woocommerce-product-gallery ol.flex-control-thumbs img:hover {
    border-color: #f5821f !important;
    opacity: 1 !important;
    box-shadow: 0 0 0 3px rgba(245,130,31,.2) !important;
}

/* ── ПРАВАЯ КОЛОНКА — INFO КАРТОЧКА ─────────────────────────── */
.trd-col-info {
    background: #fff;
    border-radius: 20px;
    padding: 28px 28px 24px;
    border: 1px solid #eef0f3;
    box-shadow: 0 2px 20px rgba(0,0,0,.06);
    box-sizing: border-box;
}

/* ── НАЗВАНИЕ ────────────────────────────────────────────────── */
.trd-title {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
    margin: 0 0 16px;
    letter-spacing: -.3px;
}

/* ── ЦЕНА ────────────────────────────────────────────────────── */
.trd-price-box {
    background: #fff8f2;
    border: 1.5px solid #fddcb5;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trd-price .woocommerce-Price-amount {
    font-size: 36px !important;
    font-weight: 900 !important;
    color: #f5821f !important;
    letter-spacing: -1px !important;
    line-height: 1 !important;
}

.trd-price .woocommerce-Price-currencySymbol {
    font-size: 22px !important;
    vertical-align: super !important;
}

.trd-price del .woocommerce-Price-amount {
    font-size: 14px !important;
    color: #9ca3af !important;
    font-weight: 500 !important;
    text-decoration: line-through !important;
}

.trd-price ins { text-decoration: none !important; }

.trd-usd {
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    margin-top: 2px;
}

/* ── ОСТАТОК ─────────────────────────────────────────────────── */
.trd-col-info p.stock {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 6px 14px !important;
    border-radius: 99px !important;
    margin: 0 0 14px !important;
    position: relative !important;
}

.trd-col-info p.stock::before {
    content: '' !important;
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

.trd-col-info p.stock.in-stock {
    color: #15803d !important;
    background: #dcfce7 !important;
    border: 1.5px solid #86efac !important;
}

.trd-col-info p.stock.in-stock::before {
    background: #16a34a !important;
    animation: trd-dot 2s infinite !important;
}

.trd-col-info p.stock.out-of-stock {
    color: #991b1b !important;
    background: #fee2e2 !important;
    border: 1.5px solid #fca5a5 !important;
}

.trd-col-info p.stock.out-of-stock::before { background: #dc2626 !important; }

@keyframes trd-dot {
    0%,100% { box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
    50%      { box-shadow: 0 0 0 5px rgba(22,163,74,.04); }
}

/* ── КРАТКОЕ ОПИСАНИЕ ────────────────────────────────────────── */
.trd-excerpt {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.7;
    margin: 0 0 16px;
    padding: 12px 15px;
    background: #f8f9fb;
    border-radius: 10px;
    border-left: 3px solid #f5821f;
}

.trd-excerpt p { margin: 0; }

/* ── ADD TO CART ЗОНА ────────────────────────────────────────── */
.trd-col-info .woocommerce-product-details__short-description { display: none; }
/* Уже рендерим через trd-excerpt выше */

/* SKU / Kategoriler */
.trd-col-info .sku_wrapper,
.trd-col-info .posted_in,
.trd-col-info .tagged_as {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

.trd-col-info .posted_in a,
.trd-col-info .tagged_as a {
    color: #f5821f;
    font-weight: 600;
    text-decoration: none;
}

/* ── tr-atc: PLATFORM & KARGO ────────────────────────────────── */
.tr-atc {
    margin-top: 6px;
}

.tr-atc-group {
    margin-bottom: 16px;
}

.tr-atc-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tr-atc-label small {
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #b0b7c3;
}

.tr-req { color: #ef4444; }

/* Платформы */
.tr-platforms {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.tr-plat { cursor: pointer; display: block; }

.tr-plat input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.tr-plat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 3px 8px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #374151;
    transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
    min-height: 68px;
    position: relative;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.tr-plat-box:hover {
    border-color: #f5821f;
    background: #fff8f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245,130,31,.12);
}

.tr-plat input[type="radio"]:checked + .tr-plat-box,
.tr-plat.is-checked .tr-plat-box {
    border-color: #f5821f;
    background: #fff8f2;
    color: #d96000;
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(245,130,31,.15), 0 4px 12px rgba(245,130,31,.1);
}

.tr-plat-ic {
    font-size: 20px;
    line-height: 1;
    display: block;
}

.tr-plat-nm {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.tr-pdf {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 99px;
    box-shadow: 0 1px 4px rgba(239,68,68,.35);
}

.tr-kendim-info {
    margin-top: 8px;
    padding: 9px 13px;
    background: #fff8f2;
    border: 1.5px solid #fddcb5;
    border-radius: 9px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}

/* Kargo */
.tr-kargo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.tr-krg { cursor: pointer; display: block; }

.tr-krg input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.tr-krg-box {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 11px;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    transition: border-color .15s, background .15s, box-shadow .15s;
    cursor: pointer;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
}

.tr-krg-box:hover {
    border-color: #f5821f;
    background: #fff8f2;
}

.tr-krg input[type="radio"]:checked + .tr-krg-box,
.tr-krg.is-checked .tr-krg-box {
    border-color: #f5821f;
    background: #fff8f2;
    color: #d96000;
    box-shadow: 0 0 0 3px rgba(245,130,31,.12);
}

.tr-krg-ic {
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1;
}

/* Ekstra ambalaj */
.tr-ekstra { cursor: pointer; display: block; }

.tr-ekstra input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.tr-ekstra-box {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    border: 1.5px dashed #d1d5db;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: #fafafa;
    transition: all .15s;
    cursor: pointer;
    user-select: none;
}

.tr-ekstra-box:hover {
    border-color: #f5821f;
    background: #fff8f2;
    border-style: solid;
}

.tr-ekstra input[type="checkbox"]:checked + .tr-ekstra-box {
    border-color: #f5821f;
    border-style: solid;
    background: #fff8f2;
    color: #d96000;
}

.tr-ekstra-box small {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
}

/* Textarea */
.tr-atc textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #e5e7eb;
    border-radius: 11px;
    font-size: 13px;
    font-family: 'Inter', system-ui, sans-serif;
    resize: none;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    color: #111827;
    background: #fff;
    box-sizing: border-box;
}

.tr-atc textarea:focus {
    border-color: #f5821f;
    box-shadow: 0 0 0 3px rgba(245,130,31,.1);
}

/* Ошибка */
.tr-error {
    padding: 10px 13px;
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    font-size: 13px;
    color: #991b1b;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Счётчик + кнопка */
.tr-qty-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.tr-qty {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    transition: border-color .15s;
}

.tr-qty:focus-within { border-color: #f5821f; }

.tr-qb {
    width: 42px;
    height: 50px;
    background: #f7f8fa;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #374151;
    transition: background .15s, color .15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.tr-qb:hover { background: #f5821f; color: #fff; }

.tr-qi {
    width: 50px;
    height: 50px;
    border: none;
    border-left: 1.5px solid #e5e7eb;
    border-right: 1.5px solid #e5e7eb;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    outline: none;
    -moz-appearance: textfield;
    background: #fff;
    font-family: inherit;
}

.tr-qi::-webkit-outer-spin-button,
.tr-qi::-webkit-inner-spin-button { -webkit-appearance: none; }

.tr-atc-btn {
    flex: 1;
    height: 50px;
    background: linear-gradient(135deg, #f5821f 0%, #e06a00 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    font-family: 'Inter', system-ui, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .18s, box-shadow .18s, background .18s;
    box-shadow: 0 4px 16px rgba(245,130,31,.35);
}

.tr-atc-btn:hover {
    background: linear-gradient(135deg, #e87210 0%, #d05e00 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245,130,31,.44);
}

.tr-atc-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(245,130,31,.3);
}

.tr-atc-btn svg { flex-shrink: 0; }

/* ── TABS ────────────────────────────────────────────────────── */
.trd-product .woocommerce-tabs {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,.06);
    border: 1px solid #eef0f3;
    max-width: 1280px;
    margin: 32px auto 0;
    padding: 0;
    box-sizing: border-box;
}

/* убираем WC-отступы у .trd-product внутри tr-wc-wrap */
.tr-wc-wrap .trd-product .woocommerce-tabs {
    margin-left: 28px;
    margin-right: 28px;
}

.trd-product .woocommerce-tabs ul.tabs {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border-bottom: 1.5px solid #eef0f3 !important;
    background: #fafbfc !important;
    gap: 0 !important;
}

.trd-product .woocommerce-tabs ul.tabs::before,
.trd-product .woocommerce-tabs ul.tabs li::before,
.trd-product .woocommerce-tabs ul.tabs li::after { display: none !important; }

.trd-product .woocommerce-tabs ul.tabs li {
    border: none !important;
    background: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    display: block !important;
}

.trd-product .woocommerce-tabs ul.tabs li a {
    display: block !important;
    padding: 14px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #6b7280 !important;
    border: none !important;
    background: none !important;
    text-decoration: none !important;
    border-bottom: 2.5px solid transparent !important;
    margin-bottom: -1.5px !important;
    transition: color .15s !important;
}

.trd-product .woocommerce-tabs ul.tabs li a:hover { color: #f5821f !important; }

.trd-product .woocommerce-tabs ul.tabs li.active a {
    color: #f5821f !important;
    border-bottom-color: #f5821f !important;
    font-weight: 700 !important;
}

.trd-product .woocommerce-tabs .panel {
    padding: 28px 32px !important;
    margin: 0 !important;
}

.trd-product .woocommerce-tabs .panel h2 {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin-bottom: 14px !important;
}

/* ── СВЯЗАННЫЕ ТОВАРЫ ────────────────────────────────────────── */
.trd-product .related.products {
    max-width: 1280px;
    margin: 32px auto 0;
    padding: 0 28px;
    box-sizing: border-box;
}

.trd-product .related.products > h2 {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin-bottom: 18px !important;
}

.trd-product .related.products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.trd-product .related.products ul.products li.product {
    background: #fff !important;
    border: 1.5px solid #eef0f3 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: border-color .2s, box-shadow .2s, transform .2s !important;
    box-shadow: 0 1px 6px rgba(0,0,0,.04) !important;
}

.trd-product .related.products ul.products li.product:hover {
    border-color: #f5821f !important;
    box-shadow: 0 6px 24px rgba(245,130,31,.1) !important;
    transform: translateY(-3px) !important;
}

/* ── МОБИЛЬНАЯ ВЕРСИЯ ────────────────────────────────────────── */
@media (max-width: 900px) {
    .trd-layout {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 14px;
        margin: 18px auto;
    }

    .trd-col-gallery { position: static; }

    .trd-col-info {
        padding: 20px 16px;
    }

    .trd-title { font-size: 19px; }

    .trd-price .woocommerce-Price-amount { font-size: 30px !important; }

    .tr-platforms { grid-template-columns: repeat(4, 1fr); }
    .tr-kargo { grid-template-columns: 1fr; }

    .trd-product .woocommerce-tabs,
    .tr-wc-wrap .trd-product .woocommerce-tabs {
        margin-left: 14px;
        margin-right: 14px;
    }

    .trd-product .related.products {
        padding: 0 14px;
    }

    .trd-product .related.products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .trd-product .woocommerce-tabs .panel {
        padding: 18px 20px !important;
    }
}

@media (max-width: 520px) {
    .trd-layout { padding: 0 10px; gap: 12px; }
    .trd-col-info { padding: 16px 13px; border-radius: 16px; }
    .trd-col-gallery .woocommerce-product-gallery { border-radius: 16px; padding: 10px; }
    .tr-platforms { grid-template-columns: repeat(3, 1fr); }
    .tr-qty-row { flex-direction: column; }
    .tr-qty { width: 100%; }
    .tr-qb { flex: 1; }
    .tr-qi { flex: 2; width: auto; }
    .tr-atc-btn { width: 100%; }
    .trd-product .related.products ul.products { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
    .trd-product .woocommerce-tabs,
    .tr-wc-wrap .trd-product .woocommerce-tabs { margin-left: 10px; margin-right: 10px; }
    .trd-product .related.products { padding: 0 10px; }
}
