/* ===============================
   AMEJBA - INICIO.CSS (LIMPIO)
   =============================== */

/* ---------- Variables ---------- */
:root{
  --amejba-bg: #F7FBFF;
  --amejba-primary: #1B4965;    /* títulos */
  --amejba-secondary: #2A6F97;  /* acentos */
  --amejba-muted: #5A6E7D;      /* cuerpo */
  --amejba-cta: #C3E850;        /* botón CTA */
  --amejba-cta-text: #142B3C;   /* texto CTA */
  --amejba-highlight: #D23636;  /* “DISPONIBLE” */
  --card-border: #eeeeee;
  --card-shadow: 0 4px 12px rgba(0,0,0,.08);
  --card-shadow-hover: 0 8px 16px rgba(0,0,0,.12);
}

/* ---------- Contenedores base ---------- */
.main-content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 4%;
  width: 100%;
}

.container.mt-2 {
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 0 4% !important;
  width: 100% !important;
}

.container.mt-2 .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  margin-bottom: 1.5rem;
}
.container.mt-2 .row:last-child { margin-bottom: 0; }
.container.mt-2 .col-12 { padding-left: 0 !important; padding-right: 0 !important; }

/* Márgenes de cards forzados una sola vez */
.container .card,
.container.mt-2 .card,
.main-content-wrapper .card,
.paso-card { margin: 0 !important; }

/* ---------- Banner superior (HTML + Bootstrap) ---------- */
.banner-amejba{
  position: relative;
  background: var(--amejba-bg);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
}
.banner-amejba::before,
.banner-amejba::after{
  content:"";
  position:absolute;
  border-radius:50%;
  pointer-events:none;
}
.banner-amejba::before{
  width: 520px; height: 520px;
  right: -160px; top: -140px;
  background: rgba(66,128,168,0.14);
}
.banner-amejba::after{
  width: 360px; height: 360px;
  right: 40px; bottom: -120px;
  background: rgba(120,170,210,0.16);
}
.banner-title{
  color: var(--amejba-primary);
  font-weight: 800;
  line-height: 1.05;
  font-size: clamp(36px, 4.8vw, 72px);
  letter-spacing: .2px;
}
.banner-title .thin{ color: var(--amejba-secondary); font-weight: 800; }
.banner-text p{
  color: var(--amejba-muted);
  margin-bottom: .35rem;
  font-size: clamp(15px, 1.2vw, 18px);
}
.banner-text .subhead{ color: var(--amejba-secondary); font-weight: 700; }
.banner-text .emph{ color: var(--amejba-secondary); font-weight: 700; }
.banner-text .highlight{ color: var(--amejba-highlight); font-weight: 800; }
.btn-amejba{
  background: var(--amejba-cta);
  color: var(--amejba-cta-text);
  border: 0;
  font-weight: 800;
  padding: .9rem 1.25rem;
  border-radius: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
  box-shadow: 0 6px 14px rgba(195,232,80,.3);
  white-space: normal;
}
.btn-amejba:hover{ filter: brightness(.96); }
.badge-amejba h6, .badge-amejba small{ margin:0; text-align:right; }
.badge-amejba h6{
  color: var(--amejba-primary);
  font-weight: 800;
  font-size: clamp(14px, 1.2vw, 18px);
}
.badge-amejba small{
  color: var(--amejba-secondary);
  font-size: clamp(12px, 1vw, 14px);
}
.banner-amejba .col-left{ padding-right: .75rem; }
.banner-amejba .col-center{ padding: .5rem 1rem; }
.banner-amejba .col-right{ padding-left: .75rem; }
@media (max-width: 992px){
  .badge-amejba h6, .badge-amejba small{ text-align:left; }
}

/* ---------- Carousel principal (sin duplicados) ---------- */
.main-carousel {
  margin: 20px auto 30px;
  width: 100% !important;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.main-carousel .carousel-inner { aspect-ratio: 16/4; }
.main-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 992px){
  .main-carousel .carousel-inner { aspect-ratio: 16/4.5; }
}
@media (max-width: 768px){
  .main-carousel { margin: 15px auto 25px; }
  .main-carousel .carousel-inner { aspect-ratio: 16/5; }
  .main-content-wrapper, .container.mt-2 { padding: 0 3% !important; }
}
@media (max-width: 576px){
  .main-carousel .carousel-inner { aspect-ratio: 16/3; }
  .main-content-wrapper, .container.mt-2 { padding: 0 2% !important; }
}

/* ---------- Grid de productos (flex limpio) ---------- */
#productsGrid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 15px;
  width: 100%;
  margin-top: 20px;
}
#productsGrid .col-12,
#productsGrid .col-sm-6,
#productsGrid .col-md-4,
#productsGrid .col-lg-3 {
  flex: 0 0 calc(20% - 12px);
  max-width: calc(20% - 12px);
}

/* < 1400px => 4 por fila */
@media (max-width: 1400px){
  #productsGrid .col-lg-3 {
    flex: 0 0 calc(25% - 12px);
    max-width: calc(25% - 12px);
  }
}
/* < 992px => 3 por fila */
@media (max-width: 992px){
  #productsGrid .col-md-4 {
    flex: 0 0 calc(33.333% - 12px);
    max-width: calc(33.333% - 12px);
  }
}
/* < 768px => 2 por fila */
@media (max-width: 768px){
  #productsGrid .col-sm-6 {
    flex: 0 0 calc(50% - 12px);
    max-width: calc(50% - 12px);
  }
}
/* < 576px => 1 por fila */
@media (max-width: 576px){
  #productsGrid .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ---------- Cards de producto ---------- */
#productsGrid .card { transition: all .3s ease; }
#productsGrid .card:hover {
  border-color: #ddd;
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-3px);
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box !important;
}
.container .card { transition: none; border: 1px solid var(--card-border); }
.container .card:hover { border-color: var(--card-border); box-shadow: none; transform: none; }

.product-img-container{
  height: 180px;
  background: #f9f9f9;
  padding: 10px;
  display: flex; align-items: center; justify-content: center;
}
.card-img-top{
  max-height: 100%;
  max-width: 100%;
  height: auto; width: auto;
  object-fit: contain;
}
.card-body{ padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title{ font-size: 1rem; margin-bottom: 8px; }
.card-text{ margin-top: auto; font-size: .9rem; }

@media (max-width: 768px){
  .card-img-top { height: 220px !important; }
}
@media (max-width: 576px){
  .card-img-top { height: 200px !important; }
  .col-12.col-md-6 { margin-bottom: 15px; }
}
