/* Estilos para el carrito en español */
.cart-trigger {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--color-secondary);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  max-width: 400px;
  background-color: white;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.cart-drawer.active {
  transform: translateX(0);
  opacity: 1;
}

.cart-header {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.cart-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-secondary);
  padding: 0.25rem;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 1.5rem;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 2rem;
}

.cart-empty-icon {
  font-size: 3rem;
  color: #ddd;
  margin-bottom: 1rem;
}

.cart-item {
  display: flex;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-right: 1rem;
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 0.25rem;
  line-height: 1;
}

.cart-item-variant {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.cart-item-price {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 0.5rem;
}

.cart-item-actions {
  display: flex;
  justify-content: space-between;
  align-items: last baseline;
}

.cart-item-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.quantity-control {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.quantity-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-secondary);
}

.quantity-input {
  width: 40px;
  height: 32px;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  text-align: center;
  -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.remove-item {
  background-color: var(--color-primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 100%;
}

.remove-item:hover {
  background-color: var(--color-secondary);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid #eee;
  background-color: white;
  position: sticky;
  bottom: 0;
}

.cart-item.removing {
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.2s ease, transform 0.3s ease;
}

@media (max-width: 575px) {
  .cart-drawer {
    max-width: 100%;
  }

  .cart-item {
    flex-direction: column;
  }

  .cart-item-image {
    width: 100%;
    height: auto;
    max-height: 150px;
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .cart-item-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .remove-item {
    align-self: flex-end;
  }
}

.add-to-cart-animation {
  animation: addToCart 0.5s ease;
}

@keyframes addToCart {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid #eee;
  background-color: white;
  position: sticky;
  bottom: 0;
}

.discount-form {
  flex: 1;
  display: flex;
  margin-bottom: 1rem;
}

.discount-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  border-right: none;
}

.discount-apply {
  background-color: var(--color-secondary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.discount-feedback {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  min-height: 1.2rem;
}

.discount-valid {
  color: #28a745;
}

.discount-invalid {
  color: var(--color-primary);
}

.cart-summary {
  margin-bottom: 1rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.summary-total {
  font-weight: 600;
  font-size: 1.1rem;
  border-top: 1px solid #eee;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .cart-actions {
    /*flex-direction: row;*/
  }
}

.btn-checkout {
  background-color: #e10600;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  text-align: center;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 500;
  flex: 1;
  border-radius: 50px;
  cursor: pointer;
}

.btn-checkout:hover {
  background-color: #c10600;
}