/* ===== OFFCANVAS CART STYLES ===== */

/* Offcanvas general settings */
.offcanvas {
  --bs-offcanvas-width: 420px !important;
  border: none;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
}

.offcanvas-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.offcanvas-title {
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  color: #333;
  margin: 0;
  display: flex;
  align-items: center;
}

.offcanvas-title i {
  color: #474747;
}

.btn-close {
  font-size: 1.2rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-close:hover {
  opacity: 1;
}

/* Offcanvas body */
.offcanvas-body {
  padding: 1rem 1.5rem;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Cart items */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
  transition: box-shadow 0.2s;
  position: relative;
}

.cart-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cart-item-image {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.cart-item-title a {
  font-size: 0.9em;
}

.cart-item-description {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.cart-item-price {
  font-size: 1rem;
  font-weight: normal;
  color: #474747;
  margin-bottom: 0.5rem;
}

/* Quantity controls */
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0;
  width: fit-content;
}

.btn-quantity {
  background: #f8f9fa;
  border: 1px solid #ddd;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-quantity:hover {
  background: #204136 !important;
  color: white;
  border-color: #204136 !important;
}

.btn-quantity.minus {
  border-radius: 4px 0 0 4px;
}

.btn-quantity.plus {
  border-radius: 0 4px 4px 0;
}

.quantity-input {
  border: 1px solid #ddd;
  border-left: none;
  border-right: none;
  width: 45px;
  height: 30px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  background: white;
}

.quantity-input:focus {
  outline: none;
  border-color: #b68299;
  box-shadow: 0 0 0 2px rgba(182, 130, 153, 0.1);
}

.btn-tienda{
  background-color:#474747 !important;
  border-color:#474747 !important;
  color:#fff !important;
}

/* Remove item button */
.btn-remove-item {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: #999;
  font-size: 1rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.btn-remove-item:hover {
  background: #fee;
  color: #dc3545;
}

/* Empty cart */
.empty-cart {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.empty-cart-icon {
  font-size: 3rem;
  color: #ddd;
  margin-bottom: 1rem;
}

.empty-cart h6 {
  color: #333;
  margin-bottom: 0.5rem;
}

.empty-cart p {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Offcanvas footer */
.offcanvas-footer {
  padding: 1.5rem;
  border-top: 1px solid #eee;
  background: #f8f9fa;
}

/* Cart summary */
.cart-summary {
  margin-bottom: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.summary-row:last-child {
  margin-bottom: 0;
}

.summary-label {
  font-size: 0.95rem;
  color: #666;
}

.summary-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

.shipping-free {
  color: #28a745 !important;
  font-weight: 700;
}

.total-row {
  padding-top: 0.75rem;
  border-top: 1px solid #ddd;
  margin-top: 0.75rem;
}

.total-row .summary-label,
.total-row .summary-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
}

/* Cart actions */
.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-checkout {
  background: #204136 !important;
  border-color: #204136 !important;
  color: white;
  font-weight: 600;
  padding: 1rem 1.5rem !important;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-checkout:hover {
  background: #a0718a;
  border-color: #a0718a;
  color: white;
  transform: translateY(-1px);
}

.btn-view-cart {
  background: transparent;
  border: 1px solid #ddd;
  color: #666;
  font-weight: 500;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-view-cart:hover {
  border-color: #b68299;
  color: #b68299;
  background: rgba(182, 130, 153, 0.05);
}

/* Responsive design */
@media (max-width: 576px) {
  .offcanvas {
    --bs-offcanvas-width: 100vw !important;
  }

  .cart-item {
    padding: 0.75rem;
  }

  .cart-item-image {
    width: 50px;
    height: 50px;
  }

  .cart-item-title {
    font-size: 0.8rem;
  }

  .cart-item-description {
    font-size: 0.75rem;
  }

  .offcanvas-header,
  .offcanvas-body,
  .offcanvas-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Animation for cart count badge */
@keyframes bounce {
  0%,
  20%,
  60%,
  100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-10px) translateX(-50%);
  }
  80% {
    transform: translateY(-5px) translateX(-50%);
  }
}

#cart-count.animate {
  animation: bounce 0.6s ease-in-out;
}

/* Scrollbar para el offcanvas */
.offcanvas-body::-webkit-scrollbar {
  width: 4px;
}

.offcanvas-body::-webkit-scrollbar-track {
  background: transparent;
}

.offcanvas-body::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

.offcanvas-body::-webkit-scrollbar-thumb:hover {
  background: #b68299;
}
