/* ===================================================================
   Loja pública — estilos
   =================================================================== */

.loja-wrapper {
    min-height: calc(100vh - 200px);
    background: #f8f9fa;
}

.loja-header h1 {
    font-weight: 700;
    margin-bottom: .25rem;
}

/* --- Sidebar de categorias --- */
.loja-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
    position: sticky;
    top: 110px;
}

.loja-sidebar ul li {
    margin-bottom: .25rem;
}

.loja-categoria-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .55rem .85rem;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    transition: all .15s ease;
    font-size: .95rem;
}
.loja-categoria-link:hover {
    background: #f1f5f9;
    color: var(--cor-primaria, #C41E3A);
}
.loja-categoria-link.active {
    background: var(--cor-primaria, #C41E3A);
    color: #fff;
    font-weight: 600;
}
.loja-categoria-link.active .badge { background: rgba(255,255,255,.25) !important; color: #fff !important; }

/* --- Card de produto --- */
.loja-card-produto {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s ease, box-shadow .2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.loja-card-produto:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,.12);
}

.loja-card-img-link { display: block; }
.loja-card-img {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}
.loja-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.loja-card-produto:hover .loja-card-img img {
    transform: scale(1.05);
}
.loja-card-img-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

.badge-destaque, .badge-promo {
    position: absolute;
    top: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.badge-destaque {
    left: 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}
.badge-promo {
    right: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.loja-card-body {
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    flex: 1;
}
.loja-card-titulo {
    font-size: 1rem;
    font-weight: 600;
    margin: .25rem 0;
    line-height: 1.3;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.loja-card-titulo a { color: #1e293b; }
.loja-card-titulo a:hover { color: var(--cor-primaria, #C41E3A); }
.loja-card-desc {
    font-size: .85rem;
    color: #64748b;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.loja-card-preco {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin: .5rem 0;
}
.preco-antigo {
    color: #94a3b8;
    text-decoration: line-through;
    font-size: .85rem;
}
.preco-atual {
    color: var(--cor-primaria, #C41E3A);
    font-size: 1.25rem;
}

.btn-add-carrinho {
    margin-top: auto;
}

/* --- Página de produto --- */
.loja-galeria .galeria-principal {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.loja-galeria .galeria-principal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.galeria-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

.galeria-thumbs {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
    overflow-x: auto;
}
.galeria-thumb {
    flex: 0 0 70px;
    height: 70px;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s;
}
.galeria-thumb:hover { border-color: var(--cor-primaria, #C41E3A); }
.galeria-thumb.active { border-color: var(--cor-primaria, #C41E3A); border-width: 3px; }
.galeria-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loja-produto-info h1 { font-weight: 700; line-height: 1.2; }
.loja-preco-box {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border-left: 4px solid var(--cor-primaria, #C41E3A);
}
.preco-antigo-grande {
    color: #94a3b8;
    text-decoration: line-through;
    font-size: 1rem;
}
.preco-atual-grande {
    color: var(--cor-primaria, #C41E3A);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.loja-pagamentos .badge {
    font-size: .8rem;
    padding: 6px 10px;
    margin-right: 4px;
}

.loja-descricao-completa {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    line-height: 1.7;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.loja-descricao-completa img { max-width: 100%; height: auto; border-radius: 8px; }

/* --- Carrinho --- */
.carrinho-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: 1rem;
    padding: 1rem 1.25rem;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}
.carrinho-item:last-child { border-bottom: 0; }
.carrinho-item-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}
.carrinho-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carrinho-item-img .placeholder-img {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}
.carrinho-item-qtd {
    display: flex;
    align-items: center;
    gap: .25rem;
}
.carrinho-item-qtd .input-qtd {
    width: 60px;
    text-align: center;
    -moz-appearance: textfield;
}
.carrinho-item-qtd .input-qtd::-webkit-outer-spin-button,
.carrinho-item-qtd .input-qtd::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.carrinho-item-subtotal { min-width: 100px; text-align: right; }
.carrinho-item-subtotal strong { color: var(--cor-primaria, #C41E3A); font-size: 1.1rem; }

.carrinho-resumo {
    position: sticky;
    top: 110px;
}

@media (max-width: 768px) {
    .carrinho-item {
        grid-template-columns: 70px 1fr auto;
        grid-template-rows: auto auto;
        gap: .5rem;
    }
    .carrinho-item-info { grid-column: 2 / 4; }
    .carrinho-item-qtd { grid-column: 1 / 3; }
    .carrinho-item-subtotal { grid-column: 3; text-align: right; }
}

/* --- FAB carrinho flutuante --- */
.loja-fab-carrinho {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--cor-primaria, #C41E3A);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.4rem;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
    z-index: 9997;
    transition: transform .2s ease;
}
.loja-fab-carrinho:hover {
    color: #fff;
    transform: scale(1.08);
}
.loja-fab-carrinho .fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: #fff;
    color: var(--cor-primaria, #C41E3A);
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid var(--cor-primaria, #C41E3A);
}
.loja-fab-carrinho .fab-badge.zero { display: none; }

/* --- Checkout: opcoes de pagamento --- */
.checkout-pagamentos {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.checkout-pgto-opcao { cursor: pointer; margin: 0; }
.checkout-pgto-opcao input[type="radio"] { display: none; }
.checkout-pgto-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    transition: all .15s ease;
}
.checkout-pgto-opcao input:checked + .checkout-pgto-card {
    border-color: var(--cor-primaria, #C41E3A);
    background: rgba(196, 30, 58, .04);
    box-shadow: 0 4px 12px rgba(196, 30, 58, .08);
}
.checkout-pgto-icone {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.resumo-itens {
    max-height: 280px;
    overflow-y: auto;
}
