/* =====================================================================
   ABM Seletor por Matéria  —  seletor-materia.css  (v1.1.1)
   ===================================================================== */

.abm-sel-root{
    --navy:#1B2A4A; --gold:#8B6914; --cream:#FDFCFA; --cream2:#F5F2ED;
    --border:#DDD6CB; --ink:#2c2c2c; --seg-color:#1B2A4A;
    max-width:1080px; margin:0 auto; padding:1rem; color:var(--ink);
    font-family:'Inter',system-ui,-apple-system,sans-serif;
}
.abm-sel-h2{ font-family:'Lora',Georgia,serif !important; color:var(--navy); font-size:1.7rem; text-align:center; margin:0 0 1.4rem; }

/* Tabs de segmento */
.abm-sel-segtabs{ display:flex; flex-wrap:wrap; gap:.5rem; justify-content:center; margin-bottom:1rem; }
.abm-sel-segtab{ font-weight:600; font-size:.95rem; padding:.6rem 1.2rem; border:2px solid var(--border); border-radius:999px; background:#fff; color:var(--navy); cursor:pointer; transition:all .15s ease; }
.abm-sel-segtab:hover{ border-color:var(--seg-color); }
.abm-sel-segtab.is-active{ background:var(--seg-color); border-color:var(--seg-color); color:#fff; }

/* Tabs de ano */
.abm-sel-anotabs{ display:flex; flex-wrap:wrap; gap:.4rem; justify-content:center; margin-bottom:1.6rem; border-bottom:1px solid var(--border); padding-bottom:1rem; }
.abm-sel-anotab{ font-weight:600; font-size:.95rem; padding:.45rem .9rem; border:1px solid var(--border); border-radius:8px; background:var(--cream2); color:var(--navy); cursor:pointer; transition:all .15s ease; }
.abm-sel-anotab:hover{ border-color:var(--seg-color); }
.abm-sel-anotab.is-active{ background:var(--seg-color); border-color:var(--seg-color); color:#fff; }

/* Grid */
.abm-sel-grid{ display:grid !important; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)) !important; gap:1rem; }
.abm-sel-loading,.abm-sel-empty{ grid-column:1/-1; text-align:center; padding:2.5rem 1rem; color:#888; font-style:italic; }

/* Card */
.abm-sel-card{ display:flex; flex-direction:column; border:1px solid var(--border); border-top:4px solid var(--seg-color); border-radius:12px; background:var(--cream); padding:1.1rem; box-shadow:0 1px 3px rgba(27,42,74,.06); }
.abm-sel-card-head{ margin-bottom:1rem; padding-bottom:.7rem; border-bottom:1px dashed var(--border); }
.abm-sel-materia{ font-family:'Lora',Georgia,serif !important; color:var(--navy); font-size:1.45rem !important; font-weight:700 !important; line-height:1.2; margin:0 0 .2rem !important; }
.abm-sel-grade{ font-size:.82rem; color:var(--gold); font-weight:600; text-transform:uppercase; letter-spacing:.03em; }

/* Opções */
.abm-sel-hint{
    margin:0 0 .5rem !important; font-size:.72rem; color:#8a8378; font-style:italic;
    line-height:1.3; text-align:center;
}
.abm-sel-options{ display:flex; flex-direction:column; gap:.5rem; margin-bottom:1rem; flex-grow:1; }
.abm-sel-opt{ display:flex; align-items:center; justify-content:space-between; gap:.6rem; padding:.6rem .75rem; border:1.5px solid var(--border); border-radius:9px; background:#fff; cursor:pointer; transition:all .12s ease; }
.abm-sel-opt:hover{ border-color:var(--gold); }
.abm-sel-opt.is-active{ border-color:var(--gold); background:#FBF7EE; box-shadow:inset 0 0 0 1px var(--gold); }
.abm-sel-opt input[type=radio]{ display:none; }
.abm-sel-opt-text{ display:flex; flex-direction:column; line-height:1.25; min-width:0; flex:1 1 auto; }
.abm-sel-opt-main{ font-size:.86rem; font-weight:700; color:var(--navy); }
.abm-sel-opt-sub{ font-size:.71rem; color:#8a8378; margin-top:2px; }
.abm-sel-opt-price{ font-size:.95rem; white-space:nowrap; text-align:right; }
.abm-sel-opt-price s{ color:#aaa; font-weight:400; margin-right:.25rem; }
.abm-sel-opt-price strong{ color:var(--gold); }

/* Botões card */
.abm-sel-actions{ display:flex; gap:.5rem; }
.abm-sel-btn{ flex:1; font-weight:600; font-size:.9rem; padding:.6rem .5rem; border-radius:8px; cursor:pointer; transition:all .15s ease; border:1.5px solid var(--navy); }
.abm-sel-add{ background:#fff; color:var(--navy); }
.abm-sel-add:hover{ background:var(--cream2); }
.abm-sel-buy{ background:var(--gold); border-color:var(--gold); color:#fff; }
.abm-sel-buy:hover{ filter:brightness(1.08); }
.abm-sel-btn:disabled{ opacity:.55; cursor:wait; }

/* ====== Mini-carrinho flutuante (blindado contra o tema) ====== */
#abm-sel-cart.abm-sel-cart{
    position:fixed !important; bottom:var(--abm-dock-offset,5.5rem) !important; left:22px !important;
    right:auto !important; top:auto !important;
    width:340px !important; max-width:calc(100vw - 44px) !important;
    margin:0 !important; padding:0 !important; box-sizing:border-box !important;
    display:flex !important; flex-direction:column-reverse !important; z-index:99990 !important;
    background:#fff !important; border:1px solid var(--border) !important; border-radius:12px !important;
    box-shadow:0 8px 28px rgba(27,42,74,.22) !important; overflow:hidden !important;
}
.abm-sel-cart *{ box-sizing:border-box; }

/* --- Doca: carrinho recolhe quando a Central de Ajuda abre --- */
#abm-sel-cart.abm-sel-cart.is-hidden-by-help{ display:none !important; }

/* --- Painel de Ajuda alinhado/largura igual a do carrinho ---
   (2 IDs para vencer o <style> inline que o widget imprime no rodape) --- */
#abm-help #abm-help-panel{
    width:340px !important;
    max-width:calc(100vw - 44px) !important;
    min-width:270px !important;
}
#abm-help #abm-help-title{ white-space:nowrap; }
.abm-sel-cart-bar{ display:flex !important; flex-wrap:wrap; align-items:center; gap:.4rem .6rem; padding:.7rem .9rem; background:var(--navy); color:#fff; }
.abm-sel-cart-title{ font-weight:700; font-size:.92rem; flex:1 1 auto; }
.abm-sel-cart-count{ display:inline-block; min-width:20px; padding:0 6px; margin-left:2px; border-radius:999px; background:var(--gold); color:#fff; font-size:.78rem; text-align:center; line-height:20px; }
.abm-sel-cart-toggle{ flex:0 0 auto; background:transparent; border:0; color:#fff; cursor:pointer; font-size:.82rem; text-decoration:underline; padding:0; }
.abm-sel-cart-sub{ flex:1 1 100%; font-size:.8rem; opacity:.92; }
.abm-sel-cart-body{ border-top:1px solid var(--border); }
.abm-sel-cart-items{ max-height:46vh; overflow-y:auto; padding:.4rem .6rem; }
.abm-sel-ci{ display:flex; align-items:center; gap:.5rem; padding:.5rem .2rem; border-bottom:1px solid var(--cream2); }
.abm-sel-ci:last-child{ border-bottom:0; }
.abm-sel-ci-x{ flex:0 0 auto; width:22px; height:22px; border-radius:50%; border:1px solid var(--border); background:#fff; color:#b03a2e; font-size:1rem; line-height:1; cursor:pointer; padding:0; }
.abm-sel-ci-x:hover{ background:#fdecea; border-color:#b03a2e; }
.abm-sel-ci-info{ display:flex; flex-direction:column; flex:1 1 auto; line-height:1.25; min-width:0; }
.abm-sel-ci-name{ font-weight:600; font-size:.85rem; color:var(--navy); }
.abm-sel-ci-tier{ font-size:.74rem; color:#8a8378; }
.abm-sel-ci-price{ flex:0 0 auto; font-size:.85rem; font-weight:600; color:var(--gold); white-space:nowrap; }
.abm-sel-cart-actions{ display:flex; gap:.5rem; padding:.6rem; border-top:1px solid var(--border); background:var(--cream); }
.abm-sel-cart-clear{ flex:1; padding:.55rem; border-radius:8px; border:1.5px solid var(--border); background:#fff; color:#b03a2e; font-weight:600; font-size:.85rem; cursor:pointer; }
.abm-sel-cart-clear:hover{ background:#fdecea; border-color:#b03a2e; }
.abm-sel-cart-checkout{ flex:2; padding:.55rem; border-radius:8px; border:1.5px solid var(--gold); background:var(--gold); color:#fff; font-weight:700; font-size:.85rem; cursor:pointer; }
.abm-sel-cart-checkout:hover{ filter:brightness(1.08); }

/* Toast */
.abm-sel-toast{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%); padding:.7rem 1.2rem; border-radius:10px; font-size:.9rem; font-weight:600; color:#fff; z-index:99999; box-shadow:0 4px 16px rgba(0,0,0,.2); }
.abm-sel-toast.ok{ background:#2f855a; }
.abm-sel-toast.err{ background:#b03a2e; }

/* Responsivo */
@media (max-width:560px){
    .abm-sel-grid{ grid-template-columns:1fr !important; }
    .abm-sel-h2{ font-size:1.4rem; }
    #abm-sel-cart.abm-sel-cart{
        left:16px !important; right:auto !important;
        bottom:var(--abm-dock-offset-mobile,5.5rem) !important;
        width:min(340px, calc(100vw - 32px)) !important; max-width:none !important;
        border-radius:12px !important;
    }
    #abm-help #abm-help-panel{ max-width:calc(100vw - 32px) !important; min-width:0 !important; }
}
