/* FORMULARIO */
.glass-form {
  max-width: 350px;
  margin: 40px auto;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #333;
  transition: all 0.3s ease;
}

.glass-form input,
.glass-form select {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  background-color: #fafafa !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.glass-form input:focus,
.glass-form select:focus {
  border-color: #25D366;
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.15);
  outline: none;
  background-color: #fff;
}

.glass-form button {
  display: block;
  width: 100%;
  background: linear-gradient(90deg, #25D366, #20bd5a);
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.glass-form button:hover {
  background: linear-gradient(90deg, #20bd5a, #1fae53);
}

.glass-form label {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 6px;
  display: block;
  color: #444;
}

#glass-result {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  color: #2e7d32;
}


.loading,
.success,
.error {
	text-align: center;
	padding: 10px;
	border-radius: 4px;
}

.loading {
	background: #fff3cd;
	color: #856404;
}

.success {
	background: #d4edda;
	color: #155724;
}

.error {
	background: #f8d7da;
	color: #721c24;
}
.glass-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 15px;
}

.glass-col {
  flex: 1 1 calc(50% - 7.5px);
  min-width: 200px;
  min-width: 0;
}

input,
select,
button {
	width: 100%;
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

label {
	display: block;
	margin-bottom: 5px;
	font-weight: bold;
}

button {
	background-color: #0073aa;
	color: #fff;
	border: none;
	cursor: pointer;
	padding: 12px;
}

button:hover {
	background-color: #005a87;
}

.glass-form input,
.glass-form select {
  font-size: 13px; 
}

.glass-form input::placeholder,
.glass-form select::placeholder {
  color: rgba(0, 0, 0, 0.4); 
  font-weight: 400;
}

.glass-form input::-webkit-input-placeholder,
.glass-form select::-webkit-input-placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.glass-form input::-moz-placeholder,
.glass-form select::-moz-placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.glass-form input:-ms-input-placeholder,
.glass-form select:-ms-input-placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.glass-form input:-moz-placeholder,
.glass-form select:-moz-placeholder {
  color: rgba(0, 0, 0, 0.4);
}

/* Responsive para móviles */
@media (max-width: 600px) {
	.glass-col {
		flex: 1 1 100%;
	}
  .glass-form {
    padding: 15px;
  }

  .glass-form input,
  .glass-form select {
    font-size: 14px;
  }

  .glass-form button {
    font-size: 15px;
  }
}

	.glass-form button.loading {
		background-color: #999 !important;
		cursor: not-allowed;
		position: relative;
	}

	.glass-form button .spinner {
		display: inline-block;
		width: 16px;
		height: 16px;
		margin-right: 8px;
		border: 2px solid #fff;
		border-top: 2px solid transparent;
		border-radius: 50%;
		animation: spin 0.8s linear infinite;
		vertical-align: middle;
	}

	@keyframes spin {
		0% {
			transform: rotate(0deg);
		}

		100% {
			transform: rotate(360deg);
		}
	}

/* --- Bolsa flotante mejorada --- */
.glass-bag {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #fff;
  border: 2px solid #25D366;
  border-radius: 12px;
  width: 340px;
  max-height: 80vh; /* Altura dinámica según pantalla */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

.glass-bag .bag-icon {
  font-size: 24px;
  text-align: center;
  cursor: pointer;
  background: #25D366;
  color: #fff;
  padding: 10px;
  border-radius: 12px 12px 0 0;
  font-weight: bold;
  user-select: none;
}
.glass-bag .bag-icon:hover {
  background: #20b958;
}

.glass-bag .bag-content {
  display: none;
  padding: 12px;
  height: calc(100% - 50px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.glass-bag.active .bag-content {
  display: block;
}

/* --- Encabezado --- */
.glass-bag h4 {
  text-align: center;
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* --- Lista de productos --- */
#bag-items {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  max-height: 250px;
  overflow-y: auto;
}

#bag-items li {
  border-bottom: 1px solid #e0e0e0;
  padding: 6px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

#bag-items li .remove-item {
  background: none;
  border: none;
  color: #999;
  font-size: 16px;
  cursor: pointer;
}

#bag-items li .remove-item:hover {
  color: #d33;
}

/* --- Inputs y selects --- */
#bag-step-form input,
#bag-step-form select {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
}

/* --- Botones --- */
.bag-form-buttons {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
}

#next-to-form,
#send-bag,
#back-to-list {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  font-weight: 500;
  transition: background 0.2s ease;
}

#next-to-form {
  background: #25D366;
}

#next-to-form:hover {
  background: #1ebe5a;
}

#back-to-list {
  background: #888;
}

#back-to-list:hover {
  background: #666;
}

#send-bag {
  background: #25D366;
}

#send-bag:hover {
  background: #1ebe5a;
}

/* --- Transición tipo "slider" --- */
#bag-step-list,
#bag-step-form {
  transition: transform 0.4s ease, opacity 0.4s ease;
}

#bag-step-list.hidden,
#bag-step-form.hidden {
  opacity: 0;
  transform: translateX(100%);
  pointer-events: none;
}

/* --- Texto del aviso --- */
#bag-step-form p {
  font-size: 12.5px;
  color: #555;
  line-height: 1.4;
  margin-top: 5px;
  text-align: left;
}

/* --- Toasts --- */
.glass-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(100%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.4;
  opacity: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10000;
  pointer-events: none;
  animation: glass-toast-in 0.4s ease-out forwards;
}

@keyframes glass-toast-in {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
  }
  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Cuando desaparece */
.glass-toast.hide {
  animation: glass-toast-out 0.35s ease-in forwards;
}

@keyframes glass-toast-out {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
  }
}

.glass-product-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Estilo base de los botones */
.glass-product-actions a,
.glass-product-actions button {
  background: rgb(177,188,0);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  width: auto;
}

/* Hover elegante */
.glass-product-actions a:hover,
.glass-product-actions button:hover {
  background: rgb(150,160,0);
  transform: translateY(-2px);
}

/* Evitar que crezcan a todo el ancho */
.glass-product-actions button,
.glass-product-actions a {
  flex: 0 0 auto;
}

/* Loader centrado */
.glass-add-bag-btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.glass-add-bag-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  margin-left: -9px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: glass-spin 0.7s linear infinite;
}

@keyframes glass-spin {
  to { transform: rotate(360deg); }
}
button.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

button.loading .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/**/
.glass-toggle-form {
  background: #f9fafb;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 25px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.glass-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* --- Switch elegante --- */
.glass-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}
.glass-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.glass-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 34px;
}
.glass-switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

/* Estado activo */
.glass-switch input:checked + .slider {
  background-color: #25D366;
}
.glass-switch input:checked + .slider:before {
  transform: translateX(22px);
}

/* Etiqueta de texto */
.toggle-label {
  font-weight: 500;
  color: #2c3338;
}