/* static/css/garantia/garantia.css */

/* ===== Vars / base ===== */
:root{
  --sms-blue:#2b6cf6;
  --ink:#1b1b1f;
  --muted:#7a7a89;
  --stroke:#e8e8ef;
}

/* Container do formulário (um pouco mais largo p/ caber tudo em 1 linha) */
.form-max{
  max-width:1120px;
}

/* Headings/top copy */
.page-eyebrow{
  font-size:.8rem;
  color:#9aa0aa;
  margin-bottom:.25rem;
}
.page-title{
  color:#4CA7E0;
  text-align:center;
  font-size:40px;
  font-weight:700;
  margin:0 0 1rem;
}
.section-title{
  color:var(--sms-blue);
  font-weight:800;
  margin:2.5rem 0 1rem;
  text-align:center;
}
.hint{
  font-size:.78rem;
  color:#9aa0aa;
  margin-top:.25rem;
}

/* Inputs “flat” */
.input-flat,
.select-flat{
  border:1px solid var(--stroke) !important;
  border-radius:6px;
  height:44px;
  background:#fff;
}
.input-flat[readonly]{
  background:#f7f7fb;
  color:#76768a;
}

/* Select2 ajustes (seta custom e rotação) */
.select2-container--default .select2-selection--single{
  width:100%;
  min-height:38px;
  font-size:.9rem;
  border-radius:0;
  align-content:center;
  border:1px solid #E2E4E6;
  background:#FFF;
  height:48px;
  padding:12.5px 12px;
}
.select2-container--default .select2-selection .select2-selection__rendered{
  position:relative;
  top:-3px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b{
  display:none;
}
.select2-container--default .select2-selection--single .select2-selection__arrow::after{
  content:'';
  position:absolute;
  top:50%;
  right:8px;
  transform:translateY(-50%);
  width:20px;
  height:21px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='21' viewBox='0 0 20 21' fill='none'%3E%3Cpath d='M10 14.25L3.75 8L4.625 7.125L10 12.5L15.375 7.125L16.25 8L10 14.25Z' fill='%2373757B'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-size:contain;
  pointer-events:none;
}
.select2-container--open .select2-selection--single .select2-selection__arrow::after{
  transform:translateY(-50%) rotate(180deg);
}
.select2-container--default .select2-selection--single .select2-selection__arrow{
  top:10px;
}

/* ===== Campo Nº de Série + botão Adicionar ===== */
.input-group > .form-control#numero_serie{
  height:44px;
  border-radius:6px 0 0 6px;
}
#btn-add-item.btn.btn-primary{
  height:44px;
  border-radius:0 6px 6px 0;
  padding:0 100px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#4CA7E0;
  border-color:#4CA7E0;
  box-shadow:none;
}
#btn-add-item.btn.btn-primary:hover{
  filter:brightness(0.96);
}
#btn-add-item .dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#fff;
  display:inline-block;
}

/* Wrapper de itens */
.items-wrap{
  display:grid;
  gap:14px;
  margin-top:18px;
}

/* ===== Card do produto (BS5 + uma linha) ===== */
.card-garantia{
  border-color:#EDEDF2;
}
.card-garantia .card-body{
  padding:14px 16px;
}

/* linha única */
.card-line{
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap:nowrap;
}

/* colunas */
.card-line .thumb-col{
  flex:0 0 64px;
}
.card-line .thumb-col img{
  width:64px;
  height:64px;
  object-fit:cover;
  border-radius:8px;
  background:#F4F6F8;
}
.card-line .meta-col{
  flex:1 1 252px;
  min-width:223px;
}
.meta-col .top{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:6px;
}
.serie{
  font-size:12px;
  color:#9AA1AE;
  letter-spacing:.1px;
}
.badge-sms{
  background:#F2F3F5;
  color:#6B7280;
  border:1px solid #E9ECEF;
  font-size:11px;
  font-weight:700;
  padding:3px 8px;
  border-radius:999px;
  line-height:1;
}
.title-16{
  font-size:16px;
  font-weight:700;
  line-height:1.2;
  color:#1B1B1F;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.item-sub{
  font-size:12.5px;
  color:#8A8FA3;
  margin-bottom:6px;
}
.link-extensao{
  display:inline-block;
  font-size:13px;
  font-weight:700;
  color:#4CA7E0;
  text-decoration:none;
  white-space:nowrap;
}
.link-extensao:hover{
  text-decoration:underline;
}

/* specs (3 colunas fixas) */
.card-line .spec-col{
  flex:0 0 150px;
}
.spec-label{
  font-size:12px;
  color:#8A8FA3;
  white-space:nowrap;
}
.spec-value{
  display:inline-block;
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis; }

/* limita só a 3ª coluna (Tensão saída) por ~14 caracteres */
/* permite os filhos encolherem dentro da linha */
.card-line{
  min-width:0;
}

/* cada coluna de spec pode encolher */
.card-line .spec-col{
  flex:0 1 150px;
  min-width:0;
}

/* mantém as regras base das specs */
.spec-value{
  font-size:13px;
  font-weight:600;
  color:#1B1B1F;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  display:inline-block;
}
.card-line .spec-col .spec-value{
  width:14ch;
}

/* limita a “Tensão saída” a ~14 caracteres com reticências */
.card-line .spec-col:nth-of-type(3) .spec-value{
  width:14ch;
}

.actions-col .termo-btn{
  background:#2B6CF6;
  border-color:#2B6CF6;
  color:#fff;
  padding:8px 14px;
  border-radius:8px;
  font-weight:700;
  white-space:nowrap;
}
.btn-trash{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:80px;
  border:1px solid transparent!important;
  background:#fff;
  color:#6B7280;
  border-radius:8px;
  cursor:pointer;
}
.btn-trash:hover{
  background:#F9FAFB;
}

.btn-lixo{

}

/* ===== Compactações para caber tudo (desktop) ===== */
@media (min-width:992px){
  .card-garantia .card-body{
    padding:10px 12px;
  }
  .card-line{
    gap:10px;
  }
  .card-line .thumb-col{
    flex-basis:56px;
  }
  .card-line .thumb-col img{
    width:56px;
    height:56px;
  }
  .card-line .meta-col{
    flex:1 1 240px;
    min-width:220px;
    max-width:360px;
  }
  .title-16{
    font-size:15px;
  }
  .item-sub{
    margin-bottom:4px;
  }
  .card-line .spec-col{
    flex-basis:110px;
  }
  .spec-label{
    font-size:11.5px;
  }
  .spec-value{
    font-size:12.5px;
  }
  .actions-col{
    gap:8px;
  }
  .actions-col .termo-btn{
    padding:6px 12px;
    border-radius:6px;
    font-size:13px;
  }
  .btn-trash{
    width:80px;
    height:30px;
    padding:0;
  }
}

/* Quebra organizada em telas menores */
@media (max-width:992px){
  .card-line{
    flex-wrap:wrap;
  }
  .card-line .meta-col{
    flex:1 1 100%;
    min-width:100%;
  }
  .card-line .spec-col{
    flex:1 1 50%;
  }
  .card-line .actions-col{
    width:100%;
    margin-left:0;
  }
}

/* Botão “Adicionar” mais curto no mobile */
@media (max-width:768px){
  #btn-add-item.btn.btn-primary{
    padding:0 20px;
  }
}
