/* ============================================================
   SAAS DELIVERY — CSS APP MOBILE-FIRST
============================================================ */
:root { --sd-primary: #E63946; --sd-primary-dark: #c1121f; --sd-radius: 14px; --sd-shadow: 0 2px 12px rgba(0,0,0,.10); }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
#sd-pub-app { font-family: -apple-system, 'Segoe UI', Arial, sans-serif; background: #f4f4f8; min-height: 100vh; }

/* ===== HEADER LOJA ===== */
.sd-pub-header { position: relative; background: var(--sd-primary); }
.sd-pub-cover   { height: 130px; background-size: cover; background-position: center; }
.sd-pub-header-inner { padding: 14px 16px 16px; display: flex; align-items: flex-end; gap: 12px; }
.sd-pub-logo { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.2); margin-top: -24px; }
.sd-pub-logo-text { width: 68px; height: 68px; border-radius: 50%; background: rgba(255,255,255,.22); border: 3px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: #fff; flex-shrink: 0; margin-top: -24px; }
.sd-pub-store-info { flex: 1; }
.sd-pub-store-info h1 { font-size: 18px; font-weight: 800; color: #fff; line-height: 1.2; }
.sd-pub-category { display: inline-block; background: rgba(255,255,255,.2); color: #fff; border-radius: 20px; padding: 2px 10px; font-size: 11px; margin: 3px 0; }
.sd-pub-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sd-pub-meta span { font-size: 11px; color: rgba(255,255,255,.88); background: rgba(0,0,0,.15); padding: 2px 8px; border-radius: 20px; }
.sd-pub-open   { background: rgba(34,197,94,.35) !important; }
.sd-pub-closed { background: rgba(239,68,68,.4) !important; }
.sd-pub-closed-banner { background: #fff3cd; color: #856404; text-align: center; padding: 24px 16px; font-size: 15px; margin: 16px; border-radius: var(--sd-radius); }

/* ===== CATEGORIAS ===== */
.sd-pub-cats { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; -ms-overflow-style: none; background: #fff; border-bottom: 1px solid #eee; }
.sd-pub-cats::-webkit-scrollbar { display: none; }
.sd-pub-cat { padding: 7px 16px; border: 2px solid var(--sd-primary); border-radius: 30px; background: #fff; color: var(--sd-primary); font-weight: 700; cursor: pointer; font-size: 13px; white-space: nowrap; flex-shrink: 0; transition: .18s; }
.sd-pub-cat.active, .sd-pub-cat:hover { background: var(--sd-primary); color: #fff; }

/* ===== GRADE DE PRODUTOS ===== */
.sd-pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 14px 12px 120px; }
@media (min-width: 480px) { .sd-pub-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 16px 16px 120px; } }
@media (min-width: 768px) { .sd-pub-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }

.sd-pub-card { background: #fff; border-radius: var(--sd-radius); box-shadow: var(--sd-shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s; }
.sd-pub-card:hover { transform: translateY(-2px); }
.sd-pub-card.hidden { display: none; }
.sd-pub-card-img { width: 100%; height: 140px; object-fit: cover; display: block; }
@media (min-width: 480px) { .sd-pub-card-img { height: 160px; } }
.sd-pub-no-img { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 40px; background: #f8f9fa; }
.sd-pub-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.sd-pub-card-info { flex: 1; }
.sd-pub-card-info h3 { font-size: 14px; font-weight: 700; color: #111; line-height: 1.3; }
.sd-pub-card-info p  { font-size: 12px; color: #888; margin-top: 3px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sd-pub-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sd-pub-price { font-size: 16px; font-weight: 800; color: var(--sd-primary); white-space: nowrap; }

/* Botão + circular */
.sd-pub-add {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--sd-primary); color: #fff; border: none;
    font-size: 22px; font-weight: 400; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: .18s; box-shadow: 0 2px 8px rgba(230,57,70,.35);
}
.sd-pub-add:hover  { background: var(--sd-primary-dark); transform: scale(1.08); }
.sd-pub-add:active { transform: scale(.95); }
.sd-add-icon { font-style: normal; font-size: 24px; line-height: 1; margin-top: -1px; }

/* ===== FAB CARRINHO ===== */
#sd-cart-fab {
    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
    background: var(--sd-primary); color: #fff; border: none;
    border-radius: 50px; padding: 0 20px; height: 54px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 20px rgba(230,57,70,.45); z-index: 900;
    display: flex; align-items: center; gap: 10px; min-width: 200px;
    transition: transform .2s;
}
#sd-cart-fab:hover { transform: translateX(-50%) scale(1.03); }
.sd-fab-icon { font-size: 20px; }
.sd-fab-text { flex: 1; text-align: left; }
.sd-fab-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sd-fab-count { background: #fff; color: var(--sd-primary); border-radius: 50px; padding: 2px 8px; font-size: 12px; font-weight: 800; }

/* ===== DRAWER (slide up do celular) ===== */
#sd-drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
}
#sd-drawer {
    background: #f4f4f8; width: 100%; max-width: 540px;
    max-height: 92vh; border-radius: 20px 20px 0 0;
    display: flex; flex-direction: column; overflow: hidden;
}
@media (min-width: 600px) {
    #sd-drawer-overlay { align-items: center; }
    #sd-drawer { border-radius: 20px; max-height: 88vh; }
}

/* ===== CABEÇALHO DO DRAWER ===== */
.sd-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; background: #fff;
    border-bottom: 1px solid #ebebeb; flex-shrink: 0;
}
.sd-drawer-head h2 { font-size: 17px; font-weight: 800; }
.sd-head-back {
    background: #f4f4f8; border: none; border-radius: 50px;
    padding: 7px 14px; font-size: 13px; font-weight: 700;
    cursor: pointer; color: #333;
}

/* ===== BODY SCROLLÁVEL ===== */
.sd-drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

/* ===== RODAPÉ FIXO ===== */
.sd-drawer-foot { padding: 12px 16px; background: #fff; border-top: 1px solid #ebebeb; flex-shrink: 0; }

/* ===== ITENS DO CARRINHO ===== */
.sd-cart-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; background: #fff; border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sd-cart-item-name { flex: 1; font-weight: 700; font-size: 14px; line-height: 1.3; }
.sd-cart-item-price { font-size: 11px; color: #999; font-weight: 400; }
.sd-qty-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sd-qty-btn {
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid var(--sd-primary); background: #fff;
    color: var(--sd-primary); font-size: 18px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    line-height: 1; transition: .15s; flex-shrink: 0;
}
.sd-qty-btn:hover { background: var(--sd-primary); color: #fff; }
.sd-qty-val { font-weight: 800; font-size: 16px; min-width: 24px; text-align: center; }
.sd-item-total { font-weight: 800; color: var(--sd-primary); font-size: 14px; white-space: nowrap; flex-shrink: 0; min-width: 58px; text-align: right; }
.sd-empty-cart { text-align: center; padding: 32px 16px; color: #aaa; font-size: 15px; background: #fff; border-radius: 12px; }

/* ===== CUPOM ===== */
.sd-coupon-row { display: flex; gap: 8px; }
.sd-coupon-row input { flex: 1; border: 1.5px solid #ddd; border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit; min-width: 0; background: #fff; }
.sd-coupon-row input:focus { outline: none; border-color: var(--sd-primary); }
#sd-apply-coupon { background: var(--sd-primary); color: #fff; border: none; border-radius: 10px; padding: 10px 14px; font-weight: 700; cursor: pointer; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
#sd-coupon-msg { font-size: 12px; min-height: 14px; padding: 0 2px; }

/* ===== TOTAIS ===== */
.sd-totals { background: #fff; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.sd-total-line { display: flex; justify-content: space-between; font-size: 14px; color: #555; }
.sd-discount-line { color: #16a34a; }
.sd-total-bold { font-size: 17px; font-weight: 800; color: #111; margin-top: 4px; padding-top: 8px; border-top: 2px solid #f0f0f0; }

/* ===== BOTÃO CONTINUAR ===== */
.sd-btn-next {
    width: 100%; padding: 15px; border: none; border-radius: 12px;
    background: var(--sd-primary); color: #fff; font-size: 16px;
    font-weight: 800; cursor: pointer; transition: .18s;
}
.sd-btn-next:hover { background: var(--sd-primary-dark); }

/* ===== SEÇÕES DO STEP 2 ===== */
.sd-section-label { font-size: 12px; font-weight: 800; color: #888; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 2px; margin-top: 4px; }

/* ===== TIPOS DE ENTREGA ===== */
.sd-tipo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sd-tipo-btn {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 4px; padding: 12px 4px;
    border: 2px solid #e0e0e0; border-radius: 12px;
    background: #fff; cursor: pointer; transition: all .18s;
    color: #555; font-size: 12px; font-weight: 700; text-align: center;
    line-height: 1.4; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sd-tipo-btn span:first-child { font-size: 24px; line-height: 1; }
.sd-tipo-btn.active {
    border-color: var(--sd-primary); background: var(--sd-primary);
    color: #fff; box-shadow: 0 3px 10px rgba(230,57,70,.3);
}
.sd-tipo-btn:hover:not(.active) { border-color: var(--sd-primary); color: var(--sd-primary); }

/* ===== INPUTS ===== */
.sd-input-group { display: flex; flex-direction: column; gap: 8px; }
.sd-input-group input,
#sd-drawer input[type="text"],
#sd-drawer input[type="tel"],
#sd-drawer input[type="number"],
#sd-drawer input[type="email"] {
    width: 100%; padding: 12px 14px; border: 1.5px solid #e0e0e0;
    border-radius: 10px; font-size: 15px; font-family: inherit;
    background: #fff; transition: border-color .15s;
    -webkit-appearance: none; appearance: none;
}
#sd-drawer input:focus { outline: none; border-color: var(--sd-primary); }
#sd-drawer input[readonly] { background: #f8f8f8; color: #666; }

/* ===== CEP ===== */
.sd-cep-row { display: flex; gap: 8px; }
.sd-cep-row input { flex: 1; }
.sd-btn-cep { background: #111; color: #fff; border: none; border-radius: 10px; padding: 12px 16px; font-weight: 700; font-size: 13px; cursor: pointer; flex-shrink: 0; white-space: nowrap; transition: .15s; }
.sd-btn-cep:hover { background: #333; }
.sd-btn-cep:disabled { background: #aaa; cursor: wait; }
#sd-cep-msg { font-size: 12px; min-height: 14px; padding: 0 2px; }
#sd-cep-fields { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.sd-row2 { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.sd-num { } .sd-comp { }
.sd-cidade { } .sd-uf { }
.sd-row2.cidade-uf { grid-template-columns: 1fr 60px; }

/* ===== PAGAMENTO ===== */
.sd-pag-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 360px) { .sd-pag-grid { grid-template-columns: repeat(2, 1fr); } }
.sd-pag-btn {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; padding: 12px 4px;
    border: 2px solid #e0e0e0; border-radius: 12px;
    background: #fff; cursor: pointer; transition: all .18s;
    color: #555; font-size: 11px; font-weight: 700; text-align: center;
    line-height: 1.3; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sd-pag-btn span:first-child { font-size: 22px; line-height: 1; }
.sd-pag-btn.active {
    border-color: var(--sd-primary); background: var(--sd-primary);
    color: #fff; box-shadow: 0 3px 10px rgba(230,57,70,.3);
}
.sd-pag-btn:hover:not(.active) { border-color: var(--sd-primary); color: var(--sd-primary); }

/* ===== RESUMO FINAL ===== */
.sd-resumo-final { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.sd-resumo-linha { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.sd-resumo-linha strong { font-size: 20px; font-weight: 800; color: var(--sd-primary); }

/* ===== BOTÃO WHATSAPP ===== */
.sd-btn-whatsapp {
    width: 100%; padding: 16px; border: none; border-radius: 14px;
    background: #25D366; color: #fff; font-size: 17px; font-weight: 800;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    gap: 10px; transition: .18s; box-shadow: 0 4px 16px rgba(37,211,102,.4);
    -webkit-tap-highlight-color: transparent;
}
.sd-btn-whatsapp:hover  { background: #1ebe5b; }
.sd-btn-whatsapp:active { transform: scale(.98); }
.sd-btn-whatsapp:disabled { opacity: .65; cursor: not-allowed; }

/* ===== VITRINE ===== */
.sd-vitrine { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 16px 0; }
.sd-vitrine-card { text-decoration: none; color: inherit; background: #fff; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.08); overflow: hidden; transition: transform .2s; display: block; }
.sd-vitrine-card:hover { transform: translateY(-3px); }
.sd-vitrine-header { height: 80px; display: flex; align-items: center; justify-content: center; position: relative; }
.sd-vitrine-header img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; }
.sd-vitrine-letra { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.3); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: #fff; }
.sd-vitrine-status { position: absolute; top: 6px; right: 8px; border-radius: 20px; padding: 2px 8px; font-size: 10px; font-weight: 700; color: #fff; }
.sd-vitrine-status.open   { background: rgba(34,197,94,.6); }
.sd-vitrine-status.closed { background: rgba(239,68,68,.6); }
.sd-vitrine-body { padding: 12px; }
.sd-vitrine-body h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.sd-vitrine-cat { display: inline-block; background: #f3f4f6; color: #374151; border-radius: 20px; padding: 2px 10px; font-size: 11px; margin-bottom: 6px; }
.sd-vitrine-info { display: flex; gap: 8px; font-size: 11px; color: #666; }

/* ===== ANIMAÇÃO BOTÃO + ===== */
@keyframes sd-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}
.sd-pub-add.sd-add-pulse { animation: sd-pulse .3s ease; }

/* ===== CORREÇÃO GRID CEP ===== */
.sd-row2 { display: grid; gap: 8px; }
.sd-row2.num-comp  { grid-template-columns: 90px 1fr; }
.sd-row2.cid-uf    { grid-template-columns: 1fr 60px; }

/* ===== STEP ATIVO ===== */
.sd-step { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.sd-step .sd-drawer-body { flex: 1; overflow-y: auto; }

/* ===== SCROLL SUAVE NO DRAWER ===== */
#sd-drawer { overflow: hidden; }
#sd-drawer .sd-drawer-body { -webkit-overflow-scrolling: touch; }

/* ===== INPUT CEP DESTAQUE ===== */
#sd-cep { font-size: 16px; letter-spacing: 1px; }

/* ===== BADGE ANIMADO FAB ===== */
@keyframes sd-bounce {
    0%, 100% { transform: translateX(-50%) scale(1); }
    30%       { transform: translateX(-50%) scale(1.06); }
}
#sd-cart-fab.sd-fab-bump { animation: sd-bounce .35s ease; }
