/* ================================
   ADVANCED PRODUCT SEARCH - CSS
   Estilo profesional (blanco/rojo/negro)
   Select 65% / Input 35% + botón aparte
   ================================ */

:root{
  --aps-red:#ad0000;
  --aps-red-2:#c80000;
  --aps-black:#111111;
  --aps-white:#ffffff;
  --aps-border:#d1d5db;
  --aps-border-2:#e5e7eb;
  --aps-radius:6px;
  --aps-h:44px;
  --aps-shadow:0 6px 18px rgba(0,0,0,.08);
}

.aps-search-widget{
  width:100%;
  max-width:100%;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.aps-error{
  padding:10px 12px;
  border:1px solid #fecaca;
  background:#fff5f5;
  color:#991b1b;
  border-radius:10px;
}

/* ===== Layout: GRID para respetar 65/35 aunque exista botón ===== */
.aps-form{
  width:100%;
  display:grid;
  grid-template-columns: 65fr 35fr auto; /* <- 65/35 reales + botón */
  gap:12px;
  align-items:center;
}

/* ===== SELECT ===== */
.aps-select{
  width:100%;
  height:var(--aps-h);
  border:1px solid var(--aps-border);
  background:var(--aps-white);
  color:var(--aps-black);
  border-radius:var(--aps-radius);
  padding:0 14px;
  font-size:14px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}

.aps-select:focus{
  border-color:var(--aps-red);
  box-shadow:0 0 0 3px rgba(173,0,0,.12);
}

/* ===== INPUT (sin lupita) ===== */
.aps-inputwrap{
  position:relative;
  width:100%;
}

.aps-input{
  width:100%;
  height:var(--aps-h);
  border:1px solid var(--aps-border);
  background:var(--aps-white);
  color:var(--aps-black);
  border-radius:var(--aps-radius);
  padding:0 14px; /* <- sin espacio para icono */
  font-size:14px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}

.aps-input::placeholder{ color:#9ca3af; }

.aps-input:focus{
  border-color:var(--aps-red);
  box-shadow:0 0 0 3px rgba(173,0,0,.12);
}

/* ===== BOTÓN (blanco con borde rojo, como tu captura) ===== */
.aps-submit-button{
  height:var(--aps-h);
  padding:0 18px;
  border-radius:var(--aps-radius);
  border:1px solid var(--aps-red);
  background:var(--aps-white);
  color:var(--aps-red);
  font-weight:800;
  cursor:pointer;
  transition:background .15s ease, color .15s ease, box-shadow .15s ease, transform .12s ease;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
  white-space:nowrap;
}

.aps-submit-button:hover{
  background:var(--aps-red);
  color:var(--aps-white);
  box-shadow: 0 12px 26px rgba(173,0,0,.18);
  transform: translateY(-1px);
}

/* ===== SUGERENCIAS ===== */
.aps-suggestions{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  right:0;
  background:var(--aps-white);
  border:1px solid var(--aps-border-2);
  border-radius:10px;
  box-shadow: var(--aps-shadow);
  overflow:hidden;
  display:none;
  z-index:999999;
}

.aps-suggestions.is-visible{ display:block; }

.aps-sg-empty{
  padding:12px;
  font-weight:700;
  color:#6b7280;
}

.aps-suggestion{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  text-decoration:none;
  color:var(--aps-black);
  border-bottom:1px solid rgba(0,0,0,.06);
  transition:background .12s ease, color .12s ease;
}

.aps-suggestion:last-child{ border-bottom:none; }

.aps-suggestion:hover,
.aps-suggestion.is-active{
  background:#111111;
  color:#ffffff;
}

.aps-suggestion img{
  width:34px;
  height:34px;
  border-radius:8px;
  object-fit:cover;
  background:#f3f4f6;
  border:1px solid rgba(0,0,0,.06);
}

.aps-sg-ph{
  width:34px;
  height:34px;
  border-radius:8px;
  background:#f3f4f6;
  border:1px solid rgba(0,0,0,.06);
}

.aps-sg-title{
  font-weight:750;
  line-height:1.15;
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.aps-sg-code{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:3px 10px;
  border-radius:999px;
  background:var(--aps-red);
  color:#fff;
  font-size:12px;
  font-weight:900;
}

/* ===== SINGLE ===== */
.aps-single{
  width:100%;
  max-width:1100px;
  margin:0 auto;
  padding:20px 14px;
}

.aps-single-top{
  margin-bottom:14px;
}

.aps-single-back{
  display:inline-block;
  text-decoration:none;
  font-weight:800;
  color:var(--aps-red);
}

.aps-single-card{
  background:#fff;
  border:1px solid var(--aps-border-2);
  border-radius:12px;
  box-shadow: var(--aps-shadow);
  overflow:hidden;
  display:grid;
  grid-template-columns: 360px 1fr;
}

.aps-single-img img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.aps-single-info{
  padding:18px;
}

.aps-single-title{
  margin:0 0 10px;
  font-size:24px;
  font-weight:900;
  color:var(--aps-black);
}

.aps-single-code{
  font-weight:800;
  margin-bottom:12px;
}

.aps-single-code span{
  display:inline-block;
  margin-left:8px;
  padding:4px 10px;
  border-radius:999px;
  background:var(--aps-red);
  color:#fff;
  font-size:12px;
  font-weight:900;
}

.aps-single-desc{
  color:#374151;
  line-height:1.55;
}

/* ===== Responsive ===== */
@media (max-width: 992px){
  .aps-form{
    grid-template-columns: 1fr;
  }
  .aps-submit-button{
    width:100%;
  }
  .aps-single-card{
    grid-template-columns: 1fr;
  }
}
