:root {
    --wgraf-pink: #e8268d;
    --wgraf-pink-dark: #c01e76;
    --wgraf-sidebar-bg: #222;
    --wgraf-sidebar-hover: #2d2d2d;
    --wgraf-sidebar-text: #b8b8b8;
    --wgraf-navbar-h: 56px;
    --wgraf-sidebar-w: 240px;
}

* { font-family: 'Questrial', sans-serif; }
body { background: #f4f6f9; }

/* Navbar (topo) */
.wgraf-navbar {
    background: var(--wgraf-pink);
    height: var(--wgraf-navbar-h);
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.wgraf-navbar .navbar-brand { color: #fff; letter-spacing: 1px; }
.wgraf-navbar .dropdown-toggle::after { margin-left: .4em; }

/* Sidebar */
.wgraf-sidebar {
    background: var(--wgraf-sidebar-bg) !important;
    width: var(--wgraf-sidebar-w) !important;
    color: var(--wgraf-sidebar-text);
    --bs-offcanvas-bg: var(--wgraf-sidebar-bg);
}

@media (min-width: 992px) {
    .wgraf-sidebar {
        position: fixed;
        top: var(--wgraf-navbar-h);
        bottom: 0;
        left: 0;
        visibility: visible !important;
        transform: none !important;
    }
}

.wgraf-sidebar .nav-link {
    color: var(--wgraf-sidebar-text);
    padding: 12px 20px;
    border-left: 3px solid transparent;
    border-radius: 0;
    font-size: 14px;
    transition: all .15s;
}
.wgraf-sidebar .nav-link:hover {
    background: var(--wgraf-sidebar-hover);
    color: #fff;
    border-left-color: var(--wgraf-pink);
}
.wgraf-sidebar .nav-link.active {
    background: var(--wgraf-sidebar-hover);
    color: #fff;
    border-left-color: var(--wgraf-pink);
    font-weight: 600;
}
.wgraf-sidebar .nav-link i { width: 20px; text-align: center; }

/* Sub-nav (grupos do menu admin) */
.wgraf-subnav { background: rgba(0,0,0,.18); padding: 4px 0; }
.wgraf-subnav .nav-link { padding-left: 38px; font-size: 13px; }
.wgraf-subnav .nav-link i { width: 16px; font-size: 12px; }

/* Chevron rotativo do grupo */
.wgraf-group-toggle .toggle-chevron { transition: transform .2s; }
.wgraf-group-toggle.collapsed .toggle-chevron { transform: rotate(-90deg); }

/* Main content */
.wgraf-main { padding-top: var(--wgraf-navbar-h); }
@media (min-width: 992px) {
    .wgraf-main.with-sidebar { margin-left: var(--wgraf-sidebar-w); }
}

/* Imagem do produto clicável (zoom) */
.btn-zoom-img {
    display: block;
    cursor: zoom-in;
    transition: filter .15s;
}
.btn-zoom-img:hover { filter: brightness(.96); }
.btn-zoom-img:hover::after {
    content: "\f00e"; /* fa-magnifying-glass-plus */
    font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; top: 6px; right: 8px;
    background: rgba(0,0,0,.55); color: #fff;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
}

/* Carrinho: offcanvas em qualquer breakpoint (abre via botão "Ver Carrinho") */
.wgraf-cart .offcanvas-body { background: #f4f6f9; }

/* Bottom bar fixa do carrinho (todas as resoluções) */
.wgraf-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #ddd;
    padding: 10px 14px;
    z-index: 1020;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .08);
}
@media (min-width: 992px) {
    .wgraf-cart-bar { left: var(--wgraf-sidebar-w); }
}
.wgraf-cart-bar-total {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}
.wgraf-cart-bar-badge {
    background: #fff;
    color: var(--wgraf-pink);
    font-weight: 700;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.wgraf-main { padding-bottom: 80px; }

/* Cards/painéis (substituem .panel do BS3) */
.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card-header { background: #fff; border-bottom: 1px solid #eee; font-weight: 600; }

/* Stat cards (do dashboard) — versão pastel-mix:
   fundo pastel claro, número/ícone na cor cheia, footer da cor escura */
.stat-card { border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-card .stat-body { padding: 18px; display: flex; align-items: center; }
.stat-card .stat-icon { font-size: 48px; opacity: .55; margin-right: 18px; }
.stat-card .stat-info { flex: 1; text-align: right; }
.stat-card .stat-info .stat-value { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-card .stat-info .stat-label { font-size: 14px; opacity: .85; }
.stat-card .stat-footer {
    padding: 8px 14px;
    display: flex; justify-content: space-between;
    font-size: 13px;
    text-decoration: none;
    color: #fff;
    transition: filter .15s;
}
.stat-card .stat-footer:hover { color: #fff; filter: brightness(.92); }

/* !important necessário pq Bootstrap 5 aplica .bg-* com !important global */
.stat-card.bg-info {
    background: #d6f0f7 !important; color: #2c7a91 !important;
}
.stat-card.bg-info .stat-footer { background: #5bc0de !important; color: #fff !important; }

.stat-card.bg-success {
    background: #d6ecd5 !important; color: #3a8537 !important;
}
.stat-card.bg-success .stat-footer { background: #5cb85c !important; color: #fff !important; }

.stat-card.bg-pink {
    background: #fbd6ea !important; color: #b51e72 !important;
}
.stat-card.bg-pink .stat-footer { background: var(--wgraf-pink) !important; color: #fff !important; }

.stat-card.bg-danger {
    background: #f5d5d4 !important; color: #a83532 !important;
}
.stat-card.bg-danger .stat-footer { background: #d9534f !important; color: #fff !important; }

/* Garante que o ícone, valor e label herdem a cor do card */
.stat-card .stat-icon,
.stat-card .stat-value,
.stat-card .stat-label { color: inherit; }

/* Badges suaves (pastel) — usados nos status de pedido */
.badge.badge-soft-secondary { background: #e3e5e8; color: #4a5159; }
.badge.badge-soft-info      { background: #d6f0f7; color: #1e6c82; }
.badge.badge-soft-warning   { background: #fce8cf; color: #8a5519; }
.badge.badge-soft-success   { background: #d6ecd5; color: #2e6b2c; }
.badge.badge-soft-danger    { background: #f5d5d4; color: #8e2e2b; }
.badge.badge-soft-dark      { background: #cfd2d6; color: #2c3036; }

/* Botão primário WGRAF */
.btn-wgraf { background: var(--wgraf-pink); border-color: var(--wgraf-pink); color: #fff; }
.btn-wgraf:hover { background: var(--wgraf-pink-dark); border-color: var(--wgraf-pink-dark); color: #fff; }
.bg-wgraf { background-color: var(--wgraf-pink) !important; }

/* Tabelas */
.table > :not(caption) > * > * { padding: .65rem .75rem; }

/* Forms compactos: aplicar classe .wgraf-form no <form> */
.wgraf-form .card { box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.wgraf-form .card + .card { margin-top: 8px; }
.wgraf-form > .card { margin-bottom: 8px; }
.wgraf-form .card-header {
    background: #fafbfc;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #eef0f3;
}
.wgraf-form .card-header i.fa-solid { color: var(--wgraf-pink); }
.wgraf-form .card-body { padding: 12px 14px; }
.wgraf-form .row.g-3 { --bs-gutter-x: .75rem; --bs-gutter-y: .5rem; }
.wgraf-form .form-label {
    font-size: 11px;
    margin-bottom: 2px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.wgraf-form .form-text { font-size: 11px; margin-top: 2px; }
.wgraf-form .form-control,
.wgraf-form .form-select {
    padding: 6px 10px;
    font-size: 14px;
    height: auto;
    min-height: 34px;
}
.wgraf-form textarea.form-control { min-height: 60px; }

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--wgraf-pink), var(--wgraf-pink-dark));
    padding: 20px;
}
.login-card {
    background: #fff;
    padding: 40px 35px;
    border-radius: 8px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.login-card .form-control { padding: 12px; font-size: 15px; }
.login-card .btn-wgraf { padding: 12px; font-weight: 600; letter-spacing: 1px; }
.login-card .logo { text-align: center; margin-bottom: 25px; }
.login-card .logo img { max-width: 200px; }

/* Produto: swipe pra ocultar/mostrar (mobile) + estado oculto */
.produto-swipe-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.produto-swipe-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100px;
    display: flex;
    align-items: stretch;
    z-index: 1;
}
.produto-swipe-actions form,
.produto-swipe-actions .btn {
    width: 100%;
    border-radius: 0;
}
.produto-swipe-card {
    position: relative;
    z-index: 2;
    background: #fff;
    transition: transform .25s ease;
    touch-action: pan-y;
}
.produto-swipe-wrap.dragging .produto-swipe-card { transition: none; }

/* Em desktop a ação fica escondida — só botão do footer é usado */
@media (min-width: 992px) {
    .produto-swipe-actions { display: none; }
    .produto-swipe-card { transform: none !important; }
}

/* Visual de produto oculto (ativo=0) */
.produto-oculto { opacity: .55; }
.produto-oculto .card-body h6,
.produto-oculto .card-body .text-success { text-decoration: line-through; }
.produto-oculto-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,.7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: .5px;
    z-index: 3;
}
