/* STYLES.CSS - v9 (FRETE HOME) */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root { --cor-fundo: #FFF5F7; --cor-destaque: #E91E63; --cor-card: #FFFFFF; --cor-sucesso: #4CAF50; }
body { font-family: 'Segoe UI', sans-serif; background: var(--cor-fundo); margin: 0; padding-bottom: 100px; color: #444; }
.hidden { display: none !important; }
.container { max-width: 500px; margin: 0 auto; min-height: 100vh; position: relative; }

/* TOAST */
#toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    animation: fadeInOut 3s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}
@keyframes fadeInOut {
    0% { opacity: 0; top: 0; }
    10% { opacity: 1; top: 20px; }
    90% { opacity: 1; top: 20px; }
    100% { opacity: 0; top: 0; display: none;}
}

/* HEADER */
.hero { height: 180px; background-color: #ddd; background-size: cover; background-position: center; }
.header { text-align: center; margin-top: -50px; padding: 0 15px; position: relative; }
.profile { width: 100px; height: 100px; border-radius: 50%; border: 4px solid white; background: white; object-fit: cover; }

/* FRETE BOX (HOME) */
.frete-box {
    background: white;
    margin: 10px 15px;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    animation: slideUp 0.5s;
}
#home-address {
    margin-bottom: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding-right: 10px;
    transition: all 0.3s;
}
#home-address:focus {
    border-color: var(--cor-destaque);
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}
#home-frete-res {
    margin-top: 8px;
    font-size: 13px;
    color: var(--cor-sucesso);
    font-weight: bold;
    background: #e8f5e9;
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #c8e6c9;
}
.frete-error {
    color: #d32f2f !important;
    background: #ffebee !important;
    border-color: #ffcdd2 !important;
}

/* TABS */
.tabs { display: flex; gap: 10px; padding: 15px; overflow-x: auto; background: var(--cor-fundo); position: sticky; top: 0; z-index: 10; }
.tab { background: white; padding: 8px 16px; border-radius: 20px; border: 1px solid #eee; white-space: nowrap; font-weight: 600; font-size: 14px; cursor: pointer; }
.tab.ativo { background: var(--cor-destaque); color: white; border-color: var(--cor-destaque); }

/* VITRINE */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 0 15px; }
.card { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.05); cursor: pointer; }
.card-img { 
    width: 100%; height: 160px; 
    object-fit: contain !important; 
    background: white; padding: 5px; border-bottom: 1px solid #eee; 
}
.card-info { padding: 10px; }
.card-price { color: var(--cor-destaque); font-weight: 800; font-size: 15px; }

/* MODAL */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: flex-end; }
/* CORREÇÃO: Alerta sempre acima de outros modais */
#modal-alert { z-index: 10000 !important; }

.sheet { background: white; width: 100%; max-width: 500px; border-radius: 20px 20px 0 0; height: 90vh; display: flex; flex-direction: column; margin: 0 auto; animation: slideUp 0.3s; position: relative; overflow: hidden; }
.sheet-content { flex: 1; overflow-y: auto; padding: 0; padding-bottom: 20px; }
.sheet-footer { background: white; padding: 15px; border-top: 1px solid #eee; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); z-index: 10; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ALERT BOX CUSTOMIZADO */
.alert-box { background: white; width: 85%; max-width: 320px; padding: 20px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); text-align: center; }
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* CARROSSEL */
.carousel-container { position: relative; width: 100%; height: 380px; background: white; overflow: hidden; }
.carousel-img { width: 100%; height: 100%; object-fit: contain !important; padding: 10px; transition: opacity 0.3s ease; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.3); color: white; border: none; font-size: 24px; padding: 15px 10px; cursor: pointer; z-index: 5; }
.prev-btn { left: 0; border-radius: 0 5px 5px 0; }
.next-btn { right: 0; border-radius: 5px 0 0 5px; }
.dots-container { position: absolute; bottom: 15px; width: 100%; text-align: center; z-index: 5; pointer-events: none; }
.dot { display: inline-block; width: 8px; height: 8px; background: rgba(0,0,0,0.2); border-radius: 50%; margin: 0 4px; transition: 0.2s; box-shadow: 0 1px 3px rgba(255,255,255,0.5); }
.dot.active { background: var(--cor-destaque); transform: scale(1.3); }
.btn-close-modal { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.5); color: white; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-weight: bold; font-size: 16px; display: flex; align-items: center; justify-content: center; z-index: 10; backdrop-filter: blur(2px); }

/* OPÇÕES */
.opt-group { margin-top: 25px; padding-top: 10px; border-top: 1px dashed #eee; padding-left: 15px; padding-right: 15px; }
.opt-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; background: #f9f9f9; padding: 8px 10px; border-radius: 6px; }
.opt-title { font-weight: bold; font-size: 15px; color: #333; }
.opt-badge { background: #ddd; color: #666; font-size: 10px; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; font-weight: bold; }
.opt-badge.req { background: #333; color: white; }
.opt-item-moderno { display: flex; align-items: center; padding: 12px 5px; border-bottom: 1px solid #f5f5f5; cursor: pointer; transition: background 0.2s; }
.opt-img-wrapper { width: 50px; height: 50px; border-radius: 8px; overflow: hidden; margin-right: 15px; flex-shrink: 0; border: 1px solid #eee; background: white; display: flex; align-items: center; justify-content: center; }
.opt-img { width: 100%; height: 100%; object-fit: cover; }
.opt-img-placeholder { font-size: 20px; }
.opt-info { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.opt-name { font-size: 14px; color: #333; font-weight: 500; }
.opt-price { font-size: 13px; color: var(--cor-destaque); font-weight: 800; }
.opt-radio-wrapper { padding-left: 10px; }
.opt-radio-circle { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #ccc; position: relative; transition: 0.2s; }
input:checked ~ .opt-radio-wrapper .opt-radio-circle { border-color: var(--cor-destaque); border-width: 7px; }
input:checked ~ .opt-info .opt-name { color: var(--cor-destaque); font-weight: 700; }

.opt-item-moderno.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
    background-color: #fafafa;
}

/* GERAL */
.btn { width: 100%; padding: 15px; border: none; border-radius: 10px; font-weight: bold; cursor: pointer; font-size: 16px; transition: 0.2s; }
.btn-primary { background: var(--cor-destaque); color: white; }
.btn-primary:active { opacity: 0.8; }
.btn-sec { background: #eee; color: #555; }
input, select, textarea { width: 100%; padding: 12px; margin-bottom: 10px; border: 1px solid #ddd; border-radius: 8px; background: #f9f9f9; font-family: inherit; font-size: 14px; }
.float-cart { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--cor-destaque); color: white; padding: 15px 25px; border-radius: 50px; font-weight: bold; width: 90%; max-width: 450px; display: flex; justify-content: space-between; z-index: 1000; box-shadow: 0 5px 20px rgba(233,30,99,0.4); cursor: pointer; }
.loader { border: 4px solid #f3f3f3; border-top: 4px solid var(--cor-destaque); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* PAGAMENTO */
.pay-opt { display: flex; align-items: center; gap: 15px; padding: 15px; border: 1px solid #ddd; border-radius: 10px; margin-bottom: 10px; cursor: pointer; background: white; transition: all 0.2s ease; }
.pay-opt:hover { background-color: #f9f9f9; }
.pay-opt.selected { border: 2px solid var(--cor-destaque); background-color: #FFF0F5; box-shadow: 0 2px 8px rgba(233, 30, 99, 0.15); }
.pay-icon { font-size: 24px; }

/* SWITCH */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: #4CAF50; }
input:checked + .slider:before { transform: translateX(24px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* TOGGLE ENTREGA/RETIRADA */
.toggle-container { display: flex; background: #eee; border-radius: 8px; padding: 4px; margin-bottom: 15px; gap: 5px; }
.toggle-btn { flex: 1; text-align: center; padding: 10px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 14px; color: #666; transition: all 0.2s; }
.toggle-btn.active { background: white; color: var(--cor-destaque); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* RASTREIO - LINHA DO TEMPO */
.step-item { display: flex; align-items: center; margin-bottom: 20px; position: relative; }
.step-item:last-child { margin-bottom: 0; }
.step-icon { width: 40px; height: 40px; border-radius: 50%; background: #ddd; color: white; display: flex; align-items: center; justify-content: center; z-index: 2; margin-right: 15px; font-size: 18px; }
.step-line { position: absolute; left: 20px; top: 40px; width: 2px; height: calc(100% - 20px); background: #eee; z-index: 1; }
.step-item:last-child .step-line { display: none; }
.step-content { flex: 1; }
.step-title { font-weight: bold; font-size: 14px; margin-bottom: 2px; }
.step-date { font-size: 11px; color: #888; }
.step-active .step-icon { background: var(--cor-sucesso); box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2); }
.step-active .step-title { color: var(--cor-sucesso); }
.step-active .step-line { background: var(--cor-sucesso); }

.card-pedido-historico { background: white; border: 1px solid #eee; border-radius: 8px; padding: 15px; margin-bottom: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.03); }