/* loja.css — vitrine pública, carrinho e checkout (sem cadastro obrigatório) */

/* Utilitários de formulário/botão — cópia enxuta do padrão do admin
   (admin_panel.css/admin_login.css), pra loja.css não depender do CSS do
   painel administrativo em páginas públicas. */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.form-grid label {
    display: block;
    font-size: 0.85em;
    color: var(--muted);
    margin-bottom: 4px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95em;
    box-sizing: border-box;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: none;
    border-color: var(--brand);
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--brand);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: var(--brand-d);
}

.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--mid);
    font-family: var(--font-body);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.campo-com-botao {
    display: flex;
    gap: 8px;
}

.campo-com-botao input {
    flex: 1;
}

.btn-dentro-input {
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    white-space: nowrap;
}

.btn-dentro-input:hover {
    border-color: var(--brand);
}

.login-erro {
    color: var(--err);
    font-size: 0.88em;
    margin-top: 10px;
}

.login-dica {
    color: var(--muted);
    font-size: 0.85em;
}

.feedback {
    font-size: 0.88em;
    margin-top: 10px;
}

.feedback.erro { color: var(--err); }
.feedback.sucesso, .feedback.ok { color: var(--ok); }

.field-full {
    margin-top: 16px;
}

.field-full label {
    display: block;
    font-size: 0.85em;
    color: var(--muted);
    margin-bottom: 4px;
}

.field-full textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95em;
    box-sizing: border-box;
}

.extrato {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.extrato h3 {
    font-family: var(--font-head);
    font-size: 1.05em;
    color: var(--dark);
    margin-bottom: 8px;
}

.extrato ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.extrato li {
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    color: var(--mid);
    font-size: 0.92em;
}

.loja-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
}

.loja-header-topo {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.loja-logo {
    font-family: var(--font-head);
    font-size: 1.3em;
    font-weight: 700;
    color: var(--brand);
    text-decoration: none;
}

.loja-header-acoes {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9em;
}

.loja-header-acoes a {
    color: var(--mid);
    text-decoration: none;
}

.loja-header-acoes a:hover {
    color: var(--brand);
}

.loja-carrinho-link {
    position: relative;
    font-size: 1.3em;
}

.loja-carrinho-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--brand);
    color: var(--white);
    font-size: 0.5em;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.loja-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.loja-main h1 {
    font-family: var(--font-head);
    font-size: 1.5em;
    color: var(--dark);
    margin-bottom: 6px;
}

.loja-main h2 {
    font-family: var(--font-head);
    font-size: 1.1em;
    color: var(--dark);
}

.loja-continuar-comprando {
    display: inline-block;
    color: var(--mid);
    text-decoration: none;
    font-size: 0.9em;
    margin-bottom: 16px;
}

.loja-continuar-comprando:hover {
    color: var(--brand);
}

.loja-vazio {
    text-align: center;
    color: var(--muted);
    padding: 40px 0;
}

/* Grade da vitrine ----------------------------------------------------- */

.loja-banner-topo {
    display: block;
    width: 100%;
    max-width: 720px;
    height: auto;
    margin: 0 auto 20px;
    border-radius: var(--radius-lg);
}

.loja-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.loja-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow .15s;
}

.loja-card:hover {
    box-shadow: var(--shadow);
}

.loja-card-thumb-wrap {
    position: relative;
    overflow: hidden;
    height: 160px;
    background: var(--bg);
}

.loja-card-thumb {
    width: 100%;
    height: 160px;
    object-fit: contain;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.85em;
}

.loja-card-body {
    padding: 12px 14px;
}

.loja-card-nome {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 6px;
}

.loja-card-preco {
    color: var(--brand);
    font-weight: 700;
}

.loja-card-preco-original {
    color: var(--muted);
    text-decoration: line-through;
    font-size: 0.85em;
    font-weight: 400;
    margin-right: 6px;
}

.loja-badge-indisponivel {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.78em;
    color: var(--err);
    font-weight: 600;
}

.loja-badge-so-local {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.75em;
    color: var(--warn);
}

/* Produto (detalhe) ------------------------------------------------------ */

.loja-produto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

@media (max-width: 700px) {
    .loja-produto { grid-template-columns: 1fr; }
}

.loja-produto-foto-wrap {
    position: relative;
    max-width: 340px;
    margin: 0 auto;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius);
}

.loja-produto-foto-principal {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg);
}

.loja-produto-foto-seta {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: var(--white);
    font-size: 1.4em;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loja-produto-foto-seta:hover {
    background: rgba(0, 0, 0, 0.55);
}

.loja-produto-foto-seta-esq {
    left: 8px;
}

.loja-produto-foto-seta-dir {
    right: 8px;
}

.loja-produto-miniaturas {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.loja-produto-miniaturas img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
}

.loja-produto-miniaturas img.ativa {
    border-color: var(--brand);
}

.loja-produto-preco {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--brand);
    margin: 10px 0;
}

.loja-produto-descricao {
    color: var(--mid);
    white-space: pre-line;
    margin-bottom: 16px;
}

.loja-tamanhos {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.loja-tamanho-btn {
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: var(--radius);
    padding: 8px 14px;
    cursor: pointer;
    font-family: var(--font-body);
}

.loja-tamanho-btn.selecionado {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--white);
}

.loja-tamanho-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.loja-qtd-linha {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.loja-qtd-stepper {
    display: flex;
    align-items: stretch;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.loja-qtd-stepper input {
    width: 40px;
    height: 100%;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 1em;
    -moz-appearance: textfield;
}

.loja-qtd-stepper input::-webkit-outer-spin-button,
.loja-qtd-stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.loja-qtd-stepper button {
    width: 26px;
    height: 100%;
    border: none;
    background: var(--bg);
    color: var(--mid);
    font-size: 1.1em;
    cursor: pointer;
}

.loja-qtd-stepper button:hover {
    background: var(--border);
}

#loja-btn-add {
    flex: 1 1 auto;
    height: 48px;
}

.loja-aviso-entrega {
    background: #fdf3e0;
    color: var(--warn);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.88em;
    margin-bottom: 14px;
}

/* Carrinho ---------------------------------------------------------------- */

.loja-carrinho-item {
    display: grid;
    grid-template-columns: 70px 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.loja-carrinho-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: var(--bg);
    border-radius: var(--radius);
}

.loja-carrinho-item-nome {
    font-weight: 600;
}

.loja-carrinho-item-detalhe {
    font-size: 0.85em;
    color: var(--muted);
}

.loja-carrinho-indisponivel {
    color: var(--err);
    font-size: 0.82em;
    font-weight: 600;
}

.loja-carrinho-qtd {
    display: flex;
    align-items: center;
    gap: 6px;
}

.loja-carrinho-qtd input {
    width: 50px;
    text-align: center;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.loja-carrinho-remover {
    background: none;
    border: none;
    color: var(--err);
    cursor: pointer;
    font-size: 1.1em;
}

.loja-carrinho-resumo {
    text-align: right;
    margin-top: 16px;
    font-size: 1.1em;
}

/* Checkout ------------------------------------------------------------ */

.loja-entrega-opcoes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.loja-entrega-opcao {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    cursor: pointer;
    flex: 1;
    min-width: 140px;
    text-align: center;
}

.loja-entrega-opcao.selecionada {
    border-color: var(--brand);
    background: rgba(232,82,42,0.06);
}

.loja-entrega-opcao.desabilitada {
    opacity: .5;
    cursor: not-allowed;
}

#loja-opcoes-frete-correios {
    margin-top: 14px;
}

.loja-opcao-frete {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 0.92em;
}

.loja-opcao-frete:has(input:checked),
.loja-opcao-frete.selecionada {
    border-color: var(--brand);
    background: rgba(232,82,42,0.06);
}

.loja-opcao-frete strong {
    margin-left: auto;
    color: var(--brand);
}

.loja-frete-preview {
    font-size: 0.9em;
    color: var(--mid);
    margin: 10px 0 16px;
}

.loja-checkout-total {
    text-align: right;
    font-size: 1.2em;
    margin: 16px 0;
}

/* Confirmação / consulta de pedido --------------------------------------- */

.loja-pedido-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.loja-pedido-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    background: var(--bg);
    color: var(--mid);
}

.loja-pedido-status-alerta {
    background: #fdf3e0;
    color: var(--warn);
}
