/*arma tu kit*/

/* Contenedor principal */
.simagic-builder-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1200px;
  margin: auto;
  padding: 2rem;
}

/* Barra de progreso */
.progress-bar {
  display: flex;
  justify-content: space-between;
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 8px;
}

.progress-bar .step {
  text-align: center;
  flex: 1;
  font-size: 14px;
  position: relative;
  color: #999;
}

.progress-bar .step .step-number {
  display: inline-block;
  background: #ccc;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  line-height: 30px;
  font-weight: bold;
  margin-bottom: 5px;
}

/* Estado activo 
.progress-bar .step.active .step-number {
  background: #dd3333;
}*/
.progress-bar .step.active {
  color: #000;
  font-weight: bold;
}

/* Completado */
.progress-bar .step.completed .step-number {
  background: #28a745;
}
.progress-bar .step.completed {
  color: #000;
  font-weight: bold;
}

/* Omitido */
.progress-bar .step.skipped .step-number {
  background: orange;
}
.progress-bar .step.skipped {
  color: orange;
}

/* Cuerpo principal */
.builder-body {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}


/* Contenedor de cabecera de productos */
.kit-product-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  gap: 1rem;
}

.kit-product-count {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
  text-align: left;
  width: 48%;
}

.kit-product-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 48%;
  justify-content: flex-end;
}

.kit-product-sort label {
  font-size: 14px;
  font-weight: 500;
}

.kit-product-sort select {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Grid de productos */
.kit-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
  width: 100%;
}

/* Card de producto */
.kit-product-card {
  border: 1px solid #ddd;
  padding: 15px;
  text-align: center;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kit-product-card:hover {
  transform: scale(1.02);
}

.kit-product-card img {
  max-width: 100%;
  height: auto;
  margin-bottom: 10px;
}

.kit-product-card h4 {
  font-size: 1rem;
  margin: 0 0 5px 0;
}

.kit-product-card p {
  font-weight: bold;
  color: #333;
  margin: 0 0 10px;
}

.kit-product-card button {
  background-color: #dd3333;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

/* Carrito lateral */
.kit-cart-sidebar {
    flex: 0 0 28%;
    min-width: 250px;
    background: #f9f9f9;
    padding: 15px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.kit-cart-sidebar h3 {
  margin-top: 0;
  font-size: 17px;
  margin-bottom: 1rem;
}

.kit-cart-sidebar ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
}

.kit-cart-sidebar ul li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #ddd;
}

.kit-cart-sidebar button {
    width: 100%;
    margin-top: 1rem;
    background: inherit;
    color: #fff;
    padding: 0.75rem;
    border: 1px solid #dd3333;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    background: #dd3333 !important;
}

.kit-cart-sidebar button:hover {
  background-color: #b22828;
  color: #fff;
}

.kit-cart-sidebar a#reset-builder {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 14px;
  color: #c00;
  text-decoration: underline;
}

#total-price {
  font-size: 18px;
  color: #000;
}

#discount-info {
  color: green;
  font-size: 14px;
}

/* Navegación por pasos */
.builder-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.builder-nav button {
  padding: 10px 16px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
}

#next-step {
  background-color: #0073aa;
  color: white;
}

#next-step:hover {
  background-color: #005f8a;
}

#prev-step {
  background-color: #eee;
  color: #fff;
}

#prev-step:hover {
  background-color: #ddd;
}

/* Paginación solo con números */
.kit-pagination {
  margin-top: 20px;
  text-align: center;
}

.kit-pagination button {
  margin: 0 5px;
  padding: 6px 10px;
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}

.kit-pagination button:hover {
  background-color: #ddd;
}
.product-image {
    width: 30px; /* Ajusta según el tamaño que necesites */
    height: auto;
    margin-right: 10px;
}
/**/
/* El LI debe ser flex fila para que el botón quede al lado */
.selected-product-item, /* O reemplaza por el selector correcto, ej: #selected-products li */
#selected-products li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* La imagen ya la tienes ajustada */
.kit-thumb {
  width: 50px;
  height: auto;
  margin-right: 10px;
  border-radius: 6px;
  object-fit: contain;
}

/* Info en columna */
.product-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* que ocupe el espacio que pueda */
}

/* Botón con tamaño fijo y sin margen-top */
button.remove-product {
    width: 30px; /* fijo y pequeño */
    height: 30px;
    margin-top: 0;
    background: #000 !important;
    color: #fff;
    padding: 0;
    border: 1px solid #000;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    margin-left: 10px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}


/**/
.kit-builder-discount-msg {
    color: #28a745;
    font-weight: 600;
    font-size: 14px;
    margin-top: 8px;
}
.builder-nav button{
    background: #871414 !important;
}
/**/
.progress-bar .step .step-number {
    background-color: #d3d3d3; /* gris claro por defecto */
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    transition: background-color 0.3s ease;
    opacity: 0.5; /* efecto disuelto por defecto */
}

.progress-bar .step.active .step-number {
    background-color: #dd3333;
    opacity: 1;
}

.progress-bar .step.done .step-number {
    background-color: #2ecc71; /* verde */
    opacity: 1;
}

.progress-bar .step.skipped .step-number {
    background-color: #e67e22; /* naranja */
    opacity: 1;
}
/**/
.kit-product-card .tag {
    background-color: #ff9800;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}
.kit-product-card.from-previous-step {
    opacity: 0.7;
}

/* Layout general para desktop */
.builder-body {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.products-area {
    flex: 0 0 68%;
    min-width: 300px;
}

.kit-cart-sidebar {
    flex: 0 0 30%;
    min-width: 250px;
    background: #f9f9f9;
    padding: 15px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}


#selected-products {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: hidden; /* sin scroll cuando vacío */
  max-height: 0;
  transition: max-height 0.3s ease;
  position: relative;
}

/* Cuando hay productos */
#selected-products.has-products {
  overflow-y: auto;
  padding-left: 0;
  scrollbar-width: thin;
  scrollbar-color: #000 #f1f1f1;
  -webkit-overflow-scrolling: touch;
  max-height: calc(2 * 70px);
  border: 2px solid #000;
  border-radius: 6px;
  background: #fff;
}

@media (min-width: 769px) {
  .kit-cart-sidebar {
    position: sticky;
    top: 130px;
    align-self: flex-start;
    height: fit-content;
    max-height: 100vh;
  }
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .builder-body {
    flex-direction: column;
  }

  .products-area,
  .kit-cart-sidebar {
    flex: 1 1 100%;
    min-width: auto;
  }

  .kit-cart-sidebar {
    position: fixed !important;
    bottom: 1%;
    left: 0;
    right: 0;
    width: 95%;
    max-width: 100vw;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    padding: 0.5rem;
    border-radius: 12px;
    background: #fafafa;
    box-sizing: border-box;
    display: block;
    margin: auto;
  }

  .kit-cart-sidebar h3 {
    margin-top: 0;
    font-size: 17px;
    margin-bottom: 0;
    font-weight: bold;
    text-align: center;
  }

  .kit-cart-sidebar p {
    margin-bottom: 0;
  }

  .kit-cart-sidebar button {
    margin-top: 0.6rem;
    margin-bottom: 0;
  }

  .kit-cart-sidebar a#reset-builder {
    margin-top: 0.5rem;
    margin-bottom: 0;
  }

  .kit-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .builder-nav button {
    padding: 6px 0px;
  }

  .progress-bar {
    padding: 0.8rem;
  }

  .simagic-builder-container {
    padding: 2rem;
  }

  #selected-products.has-products {
    max-height: 70px;
    border: 2px solid #000;
    border-radius: 6px;
  }
}

/* Scrollbar WebKit (Chrome, Safari, iOS) */
#selected-products.has-products::-webkit-scrollbar {
  width: 8px;
}

#selected-products.has-products::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#selected-products.has-products::-webkit-scrollbar-thumb {
  background-color: #000;
  border-radius: 4px;
  border: 2px solid #f1f1f1;
}

#selected-products.has-products::-webkit-scrollbar-thumb:hover {
  background-color: #333;
}

/* Estilos para cada producto */
#selected-products li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #ddd;
}

/* Botón eliminar */
button.remove-product {
  width: 30px;
  height: 30px;
  background: #000 !important;
  color: #fff;
  border: 1px solid #000;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  margin-left: auto;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin-top: 0;
}
