/**
 * Módulo de Checkout - Upsell Barra Superior (Tabs + Carrossel de Produtos)
 *
 * @package Treinacom_Core\Modules\Checkout\Assets\Css\Upsell
 */

/* ==========================================================================
   1. BARRA SUPERIOR DO CHECKOUT (TABS + CARROSSEL)
   ========================================================================== */

/* Ocultar apenas o título h1 da página de checkout */
body.woocommerce-checkout #main-content > .container > h1.main_title,
body.woocommerce-checkout #main-content > .container > h1.entry-title,
body.woocommerce-checkout article > h1.entry-title,
body.woocommerce-checkout article > h1.main_title { display: none !important; }

/* Redução máxima do espaçamento superior entre Header e Checkout */
html body.woocommerce-checkout #page-container,
html body.woocommerce-checkout #et-main-area,
html body.woocommerce-checkout #main-content,
html body.woocommerce-checkout #main-content > .container,
html body.woocommerce-checkout #main-content .container,
html body.woocommerce-checkout .et_pb_section,
html body.woocommerce-checkout .et_pb_section_0,
html body.woocommerce-checkout .et_pb_row,
html body.woocommerce-checkout .et_pb_row_0,
html body.woocommerce-checkout #content-area,
html body.woocommerce-checkout #left-area,
html body.woocommerce-checkout article,
html body.woocommerce-checkout .entry-content,
html body.woocommerce-checkout .woocommerce,
html body.woocommerce-checkout form.checkout { padding-top: 0px !important; margin-top: 0px !important; }

.tc-checkout-top-upsell-wrapper {
    margin: 10px 0 10px 0 !important;
    padding-top: 0px !important;
    width: 100%;
}

.tc-top-upsell-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    padding: 8px 12px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Cabeçalho de Instruções da Barra de Topo */
.tc-top-upsell-heading {
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid #f1f5f9;
}

.tc-top-upsell-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tc-top-upsell-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tc-top-truck-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}

.tc-top-upsell-title h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.tc-top-upsell-counter {
    font-size: 12px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.tc-top-upsell-counter strong {
    color: #0284c7;
    font-weight: 800;
}

/* Navegação por Tabs dos Fornecedores */
.tc-top-upsell-tabs-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 6px;
    scrollbar-width: thin;
}

.tc-top-tab-btn {
    flex: 1;
    min-width: 165px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

.tc-top-tab-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.tc-top-tab-btn.active { background: #f0f9ff; border-color: #0284c7; box-shadow: 0 2px 8px rgba(2, 132, 199, 0.1); }
.tc-top-tab-btn.is-free { background: #f0fdf4; border-color: #86efac; }
.tc-top-tab-header { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 3px; }
.tc-top-tab-name { font-size: 13px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-top-tab-badge { font-size: 11px; font-weight: 800; padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.tc-top-tab-badge.pending { background: #e0f2fe; color: #0369a1; }
.tc-top-tab-badge.free { background: #dcfce7; color: #166534; }
.tc-top-tab-progress { width: 100%; height: 4px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.tc-top-tab-fill { height: 100%; background: linear-gradient(90deg, #0284c7, #10b981); border-radius: 999px; transition: width 0.4s ease; }
.tc-top-tab-btn.is-free .tc-top-tab-fill { background: #16a34a; }

/* Painéis das Tabs */
.tc-top-tab-panel { display: none; animation: tcTabFade 0.25s ease forwards; }
.tc-top-tab-panel.active { display: block; }
@keyframes tcTabFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }


.tc-top-free-congrats {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #166534;
    font-size: 14px;
    margin-bottom: 10px;
}

.tc-congrats-icon {
    font-size: 1.4em;
}

/* Badge de Fornecedor no Resumo do Carrinho */
.sc-item-supplier {
    margin: 3px 0 2px 0;
}

.sc-supplier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* Carrossel Horizontal de Produtos (Compacto / Slim) */
.tc-top-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.tc-top-products-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 2px 2px;
    width: 100%;
    scrollbar-width: none;
}

.tc-top-products-track::-webkit-scrollbar {
    display: none;
}

.tc-carousel-nav {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #1e293b;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    user-select: none;
    padding: 0;
    margin: 0;
    outline: none;
}

.tc-carousel-nav svg {
    display: block;
    width: 12px;
    height: 12px;
    stroke: currentColor;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.tc-carousel-nav:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    transform: scale(1.06);
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.tc-carousel-nav:active {
    transform: scale(0.95);
}

/* Card Individual de Produto na Esteira (Espaçoso, Imagens e Tipografia Ampliadas) */
.tc-top-product-card {
    position: relative;
    flex: 0 0 180px;
    max-width: 195px;
    scroll-snap-align: start;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    box-sizing: border-box;
    min-height: 235px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tc-top-product-card:hover {
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.12);
}

.tc-card-zera-badge { position: absolute; top: 6px; right: 6px; background: #16a34a; color: #ffffff; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 5px; text-transform: uppercase; letter-spacing: 0.3px; box-shadow: 0 1px 4px rgba(22, 163, 74, 0.25); z-index: 2; }
.tc-card-thumb { width: 80px; height: 80px; object-fit: contain; margin-bottom: 8px; border-radius: 8px; flex-shrink: 0; background: #f8fafc; }

.tc-card-info {
    width: 100%;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.tc-card-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    min-height: 38px;
    max-height: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 5px;
    word-break: break-word;
}

.tc-card-price {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.tc-card-price del {
    font-size: 12.5px;
    color: #94a3b8;
    font-weight: 500;
    text-decoration: line-through;
}

.tc-card-price ins {
    text-decoration: none;
    color: #16a34a;
    font-weight: 800;
}

.tc-card-add-btn {
    width: 100%;
    background: #0284c7;
    color: #ffffff !important;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: auto;
    flex-shrink: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-card-add-btn:hover {
    background: #0369a1;
}

.tc-card-add-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}
