/* ==========================================================================
   JOMO — Quote Cart (Drawer + Modal) — Mobile First
   Arquivo: /assets/css/quote-cart.css
   Inclui: Badge header, CTA card, Drawer, Lista, Modal robusto (não corta)
   ========================================================================== */

/* Base safety */
.jomo-quote-drawer,
.jomo-quote-modal,
.jomo-quote-drawer *,
.jomo-quote-modal *{
  box-sizing:border-box;
}

/* ==========================================================================
   Header icon + badge
   ========================================================================== */

.jomo-quote-icon-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:0;
  background:transparent;
  cursor:pointer;
  padding:8px;
  border-radius:999px;
}

.jomo-quote-icon-btn:focus{
  outline:2px solid #000;
  outline-offset:2px;
}

.jomo-quote-badge{
  display:inline-flex;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  align-items:center;
  justify-content:center;
  font-size:12px;
  line-height:1;
  background:#111;
  color:#fff;
}

/* ==========================================================================
   CTA no card (opcional, mas recomendado)
   ========================================================================== */

.jomo-quote-add{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  margin-top:10px;
  padding:12px 14px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.18);
  background:#fff;
  color:#111;
  cursor:pointer;
}

.jomo-quote-add:hover{
  border-color:rgba(0,0,0,.35);
}

.jomo-quote-add:focus{
  outline:2px solid #000;
  outline-offset:2px;
}

/* ==========================================================================
   Overlay + Drawer
   ========================================================================== */

.jomo-quote-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.5);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
  z-index:9998;
}

.jomo-quote-overlay.is-open{
  opacity:1;
  pointer-events:auto;
}

.jomo-quote-drawer{
  position:fixed;
  top:0;
  right:0;
  height:100%;
  width:min(420px, 92vw);
  background:#fff;

  transform:translateX(100%);
  transition:transform .22s ease;

  z-index:9999;
  display:flex;
  flex-direction:column;

  overscroll-behavior:contain;
  overflow-x:hidden;
}

.jomo-quote-drawer.is-open{
  transform:translateX(0);
}

.jomo-quote-drawer__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px;
  border-bottom:1px solid rgba(0,0,0,.08);
}

.jomo-quote-drawer__head strong{
  font-size:16px;
}

.jomo-quote-drawer__body{
  padding:12px 16px;
  overflow:auto;
  overflow-x:hidden;
  flex:1;
  -webkit-overflow-scrolling:touch;
}

.jomo-quote-drawer__foot{
  padding:16px;
  border-top:1px solid rgba(0,0,0,.08);
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* ==========================================================================
   Itens do drawer (FIX: não corta no mobile)
   ========================================================================== */

/* 2 colunas: thumb + conteúdo (conteúdo pode encolher) */
.jomo-quote-item{
  display:grid;
  grid-template-columns:72px minmax(0, 1fr);
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid rgba(0,0,0,.08);
  align-items:start;
}

/* Thumb */
.jomo-quote-item__thumb{
  width:72px;
  height:72px;
  object-fit:contain;
  background:#f7f7f7;
  border-radius:10px;
}

/* Conteúdo precisa encolher sem estourar */
.jomo-quote-item > div{
  min-width:0;
  position:relative;
}

.jomo-quote-item__title{
  font-size:14px;
  margin:0 34px 4px 0; /* espaço pro remover no canto */
  font-weight:600;

  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.jomo-quote-item__meta{
  font-size:12px;
  opacity:.75;
  margin:0;

  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Quantidade: quebra no mobile sem estourar */
.jomo-quote-qty{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:8px;
  flex-wrap:wrap;
}

.jomo-quote-qty input{
  width:min(140px, 52vw);
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.15);
}

.jomo-quote-qty input:focus{
  outline:2px solid #000;
  outline-offset:2px;
}

/* Botão remover flutuando no canto */
.jomo-quote-item [data-quote-remove]{
  position:absolute;
  top:0;
  right:0;
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  background:transparent;
  cursor:pointer;
  border-radius:10px;
}

.jomo-quote-item [data-quote-remove]:focus{
  outline:2px solid #000;
  outline-offset:2px;
}

/* Em telas um pouco maiores, input volta ao tamanho fixo */
@media (min-width:480px){
  .jomo-quote-qty input{ width:140px; }
}

/* ==========================================================================
   Botões principais
   ========================================================================== */

.jomo-quote-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:14px 16px;
  border-radius:999px;
  text-decoration:none;
  border:0;
  background:#111;
  color:#fff;
  cursor:pointer;
}

.jomo-quote-btn:hover{
  background:#000;
}

.jomo-quote-btn:focus{
  outline:2px solid #000;
  outline-offset:2px;
}

.jomo-quote-help{
  font-size:12px;
  opacity:.75;
  margin:8px 0 0;
}

/* ==========================================================================
   Modal robusto (centraliza e não corta)
   ========================================================================== */

.jomo-quote-modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:20000;      /* acima do drawer */
  isolation:isolate;  /* reduz conflitos de stacking */
}

.jomo-quote-modal.is-open{
  display:block;
}

/* Overlay do modal acima de tudo */
.jomo-quote-modal [data-quote-modal-overlay]{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:20001;
}

/* Mobile-first: painel ocupa quase toda tela e scrolla internamente */
.jomo-quote-modal__panel{
  position:fixed;
  inset:16px;                  /* top/right/bottom/left */
  background:#fff;
  border-radius:18px;
  padding:16px;
  z-index:20002;

  max-width:560px;
  margin:0 auto;

  overflow:auto;               /* <- não corta */
  -webkit-overflow-scrolling:touch;
}

/* Desktop: centraliza */
@media(min-width:768px){
  .jomo-quote-modal__panel{
    inset:auto;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    width:min(560px, 92vw);
    max-height:calc(100vh - 32px); /* continua seguro */
  }
}

.jomo-quote-modal__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.jomo-quote-modal__title{
  margin:0 0 6px;
}

/* ==========================================================================
   Form
   ========================================================================== */

.jomo-quote-form{
  margin-top:14px;
}

.jomo-quote-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:12px;
}

.jomo-quote-field input,
.jomo-quote-field textarea{
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.15);
}

.jomo-quote-field input:focus,
.jomo-quote-field textarea:focus{
  outline:2px solid #000;
  outline-offset:2px;
}

/* Acessibilidade */
.jomo-sr-only{
  position:absolute!important;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
