:root {
    --primary: #0054E2;
    --bg-body: #F0F5FA;
    --text-dark: #1E293B;
    --success: #10B981;
}

* { box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; }

/* ==================== LOGIN ==================== */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    background: white;
    border-radius: 24px;
    padding: 50px 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}
.login-logo {
    width: 70px; height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), #667eea);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.8rem;
}
.login-card h1 { font-size: 1.5rem; font-weight: 800; color: var(--text-dark); }

/* ==================== ADMIN ==================== */
.admin-body { background: var(--bg-body); }
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px;
    background: var(--text-dark);
    color: white;
    padding: 30px 0;
    flex-shrink: 0;
}
.admin-logo {
    font-size: 1.5rem; font-weight: 900;
    padding: 0 25px 25px;
}
.admin-logo span { color: var(--primary); }
.admin-sidebar nav { display: flex; flex-direction: column; }
.admin-sidebar nav a {
    color: #cbd5e1;
    padding: 12px 25px;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
    background: rgba(255,255,255,0.08);
    color: white;
}
.admin-content { flex: 1; padding: 40px; max-width: 1200px; }
.page-title { font-size: 1.7rem; font-weight: 800; color: var(--text-dark); }
.card-panel {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.link-copy-input { font-size: 0.8rem; }

/* ==================== CHECKOUT (link individual / retorno) ==================== */
.checkout-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.checkout-wrap { max-width: 480px; width: 100%; }
.checkout-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    animation: checkoutIn 0.45s ease-out;
}
@keyframes checkoutIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.checkout-product-label { font-size: 0.85rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.checkout-product h1 { font-size: 1.6rem; font-weight: 800; color: var(--text-dark); margin: 5px 0 10px; }
.checkout-price { font-size: 2.5rem; font-weight: 900; color: var(--success); }

@media (max-width: 576px) {
    .checkout-card { padding: 30px 22px; border-radius: 20px; }
    .checkout-product h1 { font-size: 1.35rem; }
    .checkout-price { font-size: 2.1rem; }
}

/* ==================== LOJA PÚBLICA ==================== */
.loja-body { background: var(--bg-body); padding-bottom: 110px; }
.loja-header {
    background: linear-gradient(135deg, var(--text-dark) 0%, #334155 100%);
    color: white;
    padding: 50px 0 40px;
    text-align: center;
}
.loja-header h1 { font-weight: 800; font-size: 1.9rem; }
.loja-header p { opacity: 0.8; font-size: 0.95rem; margin: 0; }
.loja-container { padding: 30px 15px 20px; max-width: 900px; margin: 0 auto; }

.loja-card {
    background: white;
    border-radius: 20px;
    padding: 18px;
    height: 100%;
    box-shadow: 0 2px 12px rgba(15,23,42,0.06);
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}
.loja-card.in-cart { border-color: var(--primary); }
.loja-card-top { display: flex; justify-content: flex-start; margin-bottom: 8px; }
.loja-card-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #3b7cf0);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.loja-card h4 { font-weight: 700; color: var(--text-dark); font-size: 1rem; margin-bottom: 4px; }
.loja-card-desc {
    color: #64748b;
    font-size: 0.8rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}
.loja-card-footer { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.loja-card-price { font-weight: 800; color: var(--primary); font-size: 1.05rem; }

.btn-add-cart {
    width: 100%;
    border: none;
    background: var(--text-dark);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s, transform 0.1s;
}
.btn-add-cart:active { transform: scale(0.97); }
.btn-add-cart:hover { background: var(--primary); }

.loja-card-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #EEF3FF;
    border-radius: 10px;
    padding: 4px;
}
.stepper-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    background: white;
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 1rem;
    transition: transform 0.1s;
}
.stepper-btn:active { transform: scale(0.9); }
.stepper-btn.mini { width: 26px; height: 26px; font-size: 0.85rem; }
.stepper-qty { font-weight: 700; color: var(--text-dark); min-width: 20px; text-align: center; }

/* ---- Barra flutuante do carrinho ---- */
.cart-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--text-dark);
    color: white;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transform: translateY(120%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 998;
}
.cart-bar.visible { transform: translateY(0); }
.cart-bar-info { display: flex; flex-direction: column; line-height: 1.3; }
.cart-bar-count { font-size: 0.75rem; opacity: 0.75; }
.cart-bar-total { font-size: 1.1rem; }
.btn-ver-carrinho {
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 10px;
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .cart-bar {
        left: auto;
        right: 24px;
        bottom: 24px;
        width: 380px;
        border-radius: 16px;
        box-shadow: 0 15px 40px rgba(0,0,0,0.3);
        padding: 16px 20px;
    }
}

/* ---- Backdrop + Gaveta ---- */
.cart-backdrop {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}
.cart-backdrop.open { opacity: 1; pointer-events: auto; }

body.drawer-lock { overflow: hidden; }

.cart-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 430px;
    background: var(--bg-body);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(.4,0,.2,1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.25);
}
.cart-drawer.open { transform: translateX(0); }

.drawer-step { display: flex; flex-direction: column; height: 100%; }

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px;
    background: white;
    border-bottom: 1px solid #eef1f5;
    flex-shrink: 0;
}
.drawer-header h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-dark); margin: 0; display: flex; align-items: center; gap: 8px; }
.drawer-close, .drawer-back {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: none;
    background: #F1F5F9;
    color: var(--text-dark);
    display: flex; align-items: center; justify-content: center;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    -webkit-overflow-scrolling: touch;
}

.drawer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(15,23,42,0.05);
}
.drawer-item-info { display: flex; flex-direction: column; gap: 2px; }
.drawer-item-name { font-weight: 600; color: var(--text-dark); font-size: 0.92rem; }
.drawer-item-price { font-size: 0.78rem; color: #94a3b8; }
.drawer-item-controls { display: flex; align-items: center; gap: 10px; }

.drawer-resumo-mini {
    background: white;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 20px;
}
.resumo-mini-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #475569;
    padding: 4px 0;
}

.drawer-footer {
    flex-shrink: 0;
    background: white;
    border-top: 1px solid #eef1f5;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
}
.drawer-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 12px;
}
.drawer-total-row strong { font-size: 1.3rem; color: var(--primary); }
.btn-fechar-pedido {
    width: 100%;
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 8px 20px rgba(16,185,129,0.35);
    transition: transform 0.1s;
}
.btn-fechar-pedido:active { transform: scale(0.98); }

.order-empty { text-align: center; color: #94a3b8; padding: 60px 0; }
.order-empty i { font-size: 2.5rem; opacity: 0.4; display: block; margin-bottom: 10px; }

@media (max-width: 576px) {
    .loja-header { padding: 36px 0 28px; }
    .loja-header h1 { font-size: 1.5rem; }
    .loja-container { padding: 22px 12px 10px; }
    .loja-card { padding: 14px; border-radius: 16px; }
    .loja-card-icon { width: 38px; height: 38px; font-size: 1rem; }
}
