/* ============================================================
   TrackMaker Store — Estilo Moderno (alinhado ao tema Kadence)
   Coexiste com estilogeo.css. Use classes prefixadas com `tm-`.
   ============================================================ */

:root {
    /* Paleta extraída do Kadence em trackmaker.com */
    --tm-primary:        #2B6CB0;
    --tm-primary-hover:  #265E9A;
    --tm-text:           #222222;
    --tm-text-strong:    #3B3B3B;
    --tm-text-soft:      #515151;
    --tm-text-subtle:    #626262;
    --tm-bg-subtle:      #E1E1E1;
    --tm-bg-light:       #F7F7F7;
    --tm-white:          #ffffff;

    --tm-success: #13612e;
    --tm-info:    #1159af;
    --tm-danger:  #b82105;
    --tm-warning: #f7630c;
    --tm-rating:  #f5a524;

    /* Tipografia (mesmo stack do Kadence) */
    --tm-font-body:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans,
        Ubuntu, Cantarell, "Helvetica Neue", sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

    --tm-fs-sm:   0.875rem;   /* 14px */
    --tm-fs-base: 1rem;       /* 16px */
    --tm-fs-md:   clamp(1.1rem, 0.995rem + 0.326vw, 1.25rem);
    --tm-fs-lg:   clamp(1.75rem, 1.576rem + 0.543vw, 2rem);
    --tm-fs-xl:   clamp(2.25rem, 1.728rem + 1.63vw, 3rem);

    /* Layout */
    --tm-content-width:   1290px;
    --tm-content-narrow:  842px;
    --tm-edge-padding:    1.5rem;

    /* Forma */
    --tm-radius-sm:   4px;
    --tm-radius:      8px;
    --tm-radius-lg:   16px;
    --tm-radius-pill: 9999px;

    /* Sombra (suave, ao estilo de cards do WordPress) */
    --tm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --tm-shadow:    0 4px 16px rgba(0, 0, 0, 0.08);
    --tm-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);

    /* Transições */
    --tm-transition: 200ms ease;
}

/* ============================================================
   Compat com top.inc / estilogeo.css legacy
   (só ativo nas páginas que carregam loja-modern.css)
   ============================================================ */

body {
    /* compensa o #fixedDiv — reduzido pra 80px nas páginas modernizadas */
    padding-top: 80px;
}

#fixedDiv {
    /* corta o espaço branco vazio na parte inferior do header fixo */
    height: 80px;
}

#contentDiv {
    /* anula o "top: 120px" do estilogeo.css — já compensado no body */
    top: 0;
}

#contentTable {
    /* esconde o <table><tr><td height="664"> vazio do top.inc */
    display: none;
}

/* ============================================================
   Reset escopado — só afeta elementos .tm-* (não quebra legacy)
   ============================================================ */

[class^="tm-"], [class*=" tm-"],
[class^="tm-"] *, [class*=" tm-"] * {
    box-sizing: border-box;
}

/* ============================================================
   Container & layout primitivos
   ============================================================ */

.tm-container {
    max-width: var(--tm-content-width);
    margin: 0 auto;
    padding-left: var(--tm-edge-padding);
    padding-right: var(--tm-edge-padding);
}

.tm-container--narrow {
    max-width: var(--tm-content-narrow);
}

.tm-section {
    padding: 0;
}

.tm-grid {
    display: grid;
    gap: 2rem;
}

.tm-grid--2 {
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 768px) {
    .tm-grid--2 {
        grid-template-columns: minmax(280px, 400px) 1fr;
        align-items: center;
    }
}

/* ============================================================
   Tipografia
   ============================================================ */

.tm-h1, .tm-h2, .tm-h3 {
    font-family: var(--tm-font-body);
    color: var(--tm-text);
    line-height: 1.2;
    margin: 0 0 0.5em;
    font-weight: 600;
}

.tm-h1 { font-size: var(--tm-fs-xl); }
.tm-h2 { font-size: var(--tm-fs-lg); }
.tm-h3 { font-size: var(--tm-fs-md); font-weight: 600; }

.tm-lead {
    font-family: var(--tm-font-body);
    font-size: var(--tm-fs-md);
    color: var(--tm-text-soft);
    line-height: 1.6;
    margin: 0 0 1.25rem;
}

.tm-body {
    font-family: var(--tm-font-body);
    font-size: var(--tm-fs-base);
    color: var(--tm-text-strong);
    line-height: 1.6;
    margin: 0 0 1rem;
}

/* ============================================================
   Cards (produtos / destaques)
   ============================================================ */

.tm-card {
    background: var(--tm-white);
    border: 2px solid var(--tm-primary);
    border-radius: var(--tm-radius-lg);
    overflow: hidden;
    transition: box-shadow var(--tm-transition), transform var(--tm-transition);
}

.tm-card:hover {
    box-shadow: var(--tm-shadow);
    transform: translateY(-2px);
}

.tm-card__media {
    display: block;
    background: var(--tm-bg-light);
}

.tm-card__media img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: var(--tm-radius-lg) var(--tm-radius-lg) 0 0;
}

.tm-card__body {
    padding: 1.5rem;
    background: #EBF2FB;
    text-align: left;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================================
   Tabela de formas de pagamento (parcelas.php)
   ============================================================ */

.tm-payment-table {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-collapse: collapse;
    background: var(--tm-white);
    border: 1px solid var(--tm-bg-subtle);
    border-radius: var(--tm-radius);
    overflow: hidden;
}

.tm-payment-table th {
    background: var(--tm-primary);
    color: var(--tm-white);
    padding: 0.625rem 1rem;
    font-weight: 600;
    text-align: left;
    font-size: 0.9375rem;
}

.tm-payment-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--tm-bg-subtle);
    font-size: 1rem;
    text-align: left;
    color: var(--tm-text-strong);
}

.tm-payment-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   Carrinho (carrinho.php)
   ============================================================ */

.tm-table-wrap {
    background: var(--tm-white);
    border: 1px solid var(--tm-bg-subtle);
    border-radius: var(--tm-radius-lg);
    overflow: hidden;
    overflow-x: auto;
}

.tm-cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--tm-fs-md);
}

.tm-cart-table thead th {
    background: var(--tm-primary);
    color: var(--tm-white);
    padding: 0.875rem 1rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.tm-cart-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--tm-bg-subtle);
    vertical-align: middle;
    background: var(--tm-white);
}

.tm-cart-table tfoot td {
    padding: 0.625rem 1rem;
    background: var(--tm-bg-light);
    border-top: 1px solid var(--tm-bg-subtle);
    font-weight: 600;
}

.tm-cart-table .tm-num,
.tm-cart-table thead th.tm-num {
    text-align: right;
    white-space: nowrap;
}

/* Linha de produto fora de estoque (confirma.php) */
.tm-cart-table tbody tr.tm-out-of-stock td {
    color: var(--tm-danger);
}

/* Botões de ícone (lixeira, atualizar no carrinho) */
.tm-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--tm-radius-sm);
    color: var(--tm-text-soft);
    cursor: pointer;
    transition: color var(--tm-transition), background var(--tm-transition);
}

.tm-icon-btn:hover,
.tm-icon-btn:focus {
    color: var(--tm-danger);
    background: rgba(184, 33, 5, 0.08);
    outline: none;
}

.tm-icon-btn svg {
    display: block;
}

/* Variante menor (cabe ao lado do input de quantidade) */
.tm-icon-btn--sm {
    width: 30px;
    height: 30px;
}

/* Variante "atualizar" — hover azul em vez de vermelho */
.tm-icon-btn--update:hover,
.tm-icon-btn--update:focus {
    color: var(--tm-primary);
    background: rgba(43, 108, 176, 0.08);
}

/* Wrapper para input de quantidade + ícone de atualizar */
.tm-qty-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    justify-content: flex-end;
}

/* Inputs de formulário */
.tm-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--tm-bg-subtle);
    border-radius: var(--tm-radius-sm);
    font-family: var(--tm-font-body);
    font-size: var(--tm-fs-md);
    background: var(--tm-white);
    color: var(--tm-text);
}

.tm-input:focus {
    outline: none;
    border-color: var(--tm-primary);
    box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.2);
}

/* Anula o background azul-claro do autofill do Chrome/Safari */
.tm-input:-webkit-autofill,
.tm-input:-webkit-autofill:hover,
.tm-input:-webkit-autofill:focus,
.tm-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--tm-white) inset !important;
    -webkit-text-fill-color: var(--tm-text) !important;
    caret-color: var(--tm-text);
    transition: background-color 5000s ease-in-out 0s;
}

.tm-input--qty {
    width: 60px;
    text-align: center;
}

/* Linha CEP + botão Calcular */
.tm-cep-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Opções de frete (radios em linha) */
.tm-freight-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--tm-bg-subtle);
    border-radius: var(--tm-radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    background: var(--tm-white);
    transition: border-color var(--tm-transition);
}

.tm-freight-option:hover {
    border-color: var(--tm-primary);
}

.tm-freight-option input { margin: 0; }

.tm-freight-price {
    color: var(--tm-primary);
    font-weight: 700;
    min-width: 90px;
}

/* Linha de ações (botões inferiores do carrinho) */
.tm-cart-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

/* Row de 2 colunas: Cálculo de Frete (esq.) + botões (dir.) */
.tm-cart-bottom-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .tm-cart-bottom-row {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.tm-cart-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: flex-start;
}

@media (max-width: 767px) {
    .tm-cart-bottom-actions {
        justify-content: center;
    }
}

/* ============================================================
   Pagamento (pagamento.php) — formulário + resumo + métodos
   ============================================================ */

/* Resumo financeiro compacto (Subtotal/Frete/Total) */
.tm-summary {
    max-width: 480px;
    margin: 0 auto;
}

.tm-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--tm-bg-subtle);
}

.tm-summary-row:last-child {
    border-bottom: none;
}

.tm-summary-row--total {
    border-top: 2px solid var(--tm-bg-subtle);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    font-size: 1.1em;
}

/* Resumo financeiro inline (4 colunas em linha — pagamento.php topo) */
.tm-summary-inline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    align-items: center;
    font-size: 1.2em; /* +20% — base do componente */
}

.tm-summary-cell {
    padding: 0.5rem 1rem;
    border-right: 1px solid var(--tm-bg-subtle);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.tm-summary-cell:last-child {
    border-right: none;
}

.tm-summary-cell__label {
    color: var(--tm-text-soft);
    font-size: 0.875em;
}

.tm-summary-cell__value {
    color: var(--tm-text);
    font-weight: 700;
}

.tm-summary-cell__sub {
    color: var(--tm-text-soft);
    font-size: 0.8125em;
    font-style: italic;
    margin-top: 0.125rem;
}

.tm-summary-cell--total .tm-summary-cell__value {
    color: var(--tm-primary);
}

@media (max-width: 600px) {
    .tm-summary-inline {
        grid-template-columns: 1fr 1fr;
    }
    .tm-summary-cell:nth-child(2n) {
        border-right: none;
    }
    .tm-summary-cell:nth-child(-n+2) {
        border-bottom: 1px solid var(--tm-bg-subtle);
    }
}

/* Seção de formulário com título (Identidade, Contato, Endereço) */
.tm-form-section + .tm-form-section {
    margin-top: 2rem;
}

.tm-form-section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--tm-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--tm-bg-subtle);
}

/* Form grid: label esquerda | input direita (desktop), stack (mobile) */
.tm-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: center;
}

@media (min-width: 768px) {
    .tm-form-grid {
        grid-template-columns: 180px 1fr;
        gap: 0.75rem 1rem;
    }
}

.tm-form-label {
    font-weight: 600;
    color: var(--tm-text);
}

.tm-form-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tm-form-error {
    color: var(--tm-danger);
    font-size: 0.875rem;
    font-weight: 600;
}

.tm-form-readonly {
    color: var(--tm-text-soft);
    font-style: italic;
}

.tm-form-phone-row {
    display: flex;
    gap: 0.5rem;
}

.tm-form-phone-row .tm-input--ddd {
    width: 70px;
    flex-shrink: 0;
    text-align: center;
}

.tm-input--full {
    width: 100%;
}

/* Inputs preenchem largura do wrapper */
.tm-form-input-wrap .tm-input {
    width: 100%;
}

/* Métodos de pagamento (parcelas2.php) */
.tm-payment-methods {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 720px;
    margin: 0 auto;
}

@media (min-width: 600px) {
    .tm-payment-methods {
        grid-template-columns: 1fr 1fr;
    }
}

.tm-payment-method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 2px solid var(--tm-bg-subtle);
    border-radius: var(--tm-radius-lg);
    background: var(--tm-white);
    cursor: pointer;
    transition: border-color var(--tm-transition), background var(--tm-transition);
    text-align: center;
}

.tm-payment-method-card:hover {
    border-color: var(--tm-primary);
}

.tm-payment-method-card:has(input:checked) {
    border-color: var(--tm-primary);
    background: #EBF2FB;
}

.tm-payment-method-card input[type="radio"] {
    margin: 0;
}

.tm-payment-method-card img {
    max-width: 280px;
    height: auto;
}

.tm-payment-method-card .tm-payment-method-label {
    color: var(--tm-text-soft);
    font-size: 1rem;
    line-height: 1.4;
}

/* ============================================================
   Botões — alinhados ao Kadence (palette1 / palette2)
   ============================================================ */

.tm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--tm-font-body);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.875rem 1.75rem;
    border-radius: var(--tm-radius-sm);
    border: 2px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--tm-transition),
                color var(--tm-transition),
                border-color var(--tm-transition),
                transform var(--tm-transition);
}

/* sobrescreve o a:hover{opacity:0.5} do estilogeo.css */
.tm-btn:hover { opacity: 1; }

.tm-btn--primary {
    background: var(--tm-primary);
    color: var(--tm-white);
    border-color: var(--tm-primary);
}

.tm-btn--primary:hover,
.tm-btn--primary:focus {
    background: var(--tm-primary-hover);
    border-color: var(--tm-primary-hover);
    color: var(--tm-white);
}

.tm-btn--secondary {
    background: var(--tm-bg-subtle);
    color: var(--tm-text);
    border-color: var(--tm-bg-subtle);
}

.tm-btn--secondary:hover,
.tm-btn--secondary:focus {
    background: var(--tm-primary-hover);
    border-color: var(--tm-primary-hover);
    color: var(--tm-white);
}

.tm-btn--outline {
    background: transparent;
    color: var(--tm-primary);
    border-color: var(--tm-primary);
}

.tm-btn--outline:hover,
.tm-btn--outline:focus {
    background: var(--tm-primary);
    color: var(--tm-white);
}

.tm-btn--lg {
    font-size: 1.125rem;
    padding: 1rem 2rem;
}

.tm-btn--block {
    display: flex;
    width: 100%;
}

/* ============================================================
   Links
   ============================================================ */

.tm-link {
    color: var(--tm-primary);
    text-decoration: none;
    transition: color var(--tm-transition);
}

.tm-link:hover {
    color: var(--tm-primary-hover);
    text-decoration: underline;
    opacity: 1; /* anula o opacity:0.5 global do estilogeo.css */
}

/* ============================================================
   Utilitários
   ============================================================ */

.tm-text-center { text-align: center; }
.tm-text-muted  { color: var(--tm-text-subtle); }
.tm-text-soft   { color: var(--tm-text-soft); }

.tm-mt-0 { margin-top: 0; }
.tm-mt-1 { margin-top: 0.5rem; }
.tm-mt-2 { margin-top: 1rem; }
.tm-mt-3 { margin-top: 1.5rem; }
.tm-mt-4 { margin-top: 2rem; }

.tm-mb-0 { margin-bottom: 0; }
.tm-mb-1 { margin-bottom: 0.5rem; }
.tm-mb-2 { margin-bottom: 1rem; }
.tm-mb-3 { margin-bottom: 1.5rem; }
.tm-mb-4 { margin-bottom: 2rem; }

.tm-divider {
    border: 0;
    border-top: 1px solid var(--tm-bg-subtle);
    margin: 2rem 0;
}

/* ============================================================
   Badge (ex.: "destaque", "promoção")
   ============================================================ */

.tm-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: var(--tm-fs-sm);
    font-weight: 600;
    border-radius: var(--tm-radius-pill);
    background: var(--tm-primary);
    color: var(--tm-white);
}

.tm-badge--warning { background: var(--tm-warning); }
.tm-badge--success { background: var(--tm-success); }
.tm-badge--danger  { background: var(--tm-danger); }
