/* ========================================================================
   WISHLIST PANEL - Diseño Exacto según Mockup
   ======================================================================== */

/* Panel principal */
#wishlist-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

#wishlist-panel.open {
  right: 0;
}

/* Header del panel */
.wishlist-header {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#wishlist-header-title {
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.5px;
  color: #000;
  margin: 0;
  text-align: left;
  line-height: 1.2;
}

#close-wishlist-panel {
  font-size: 28px;
  font-weight: 300;
  color: #000;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

#close-wishlist-panel:hover {
  opacity: 0.6;
}

/* Contenido del panel */
.wishlist-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
}

/* Cada producto */
.wishlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 12px;
  background: #f8f8f8;
  border-radius: 12px;
  transition: all 0.2s ease;
  opacity: 1;
  transform: translateX(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.wishlist-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wishlist-item:last-child {
  margin-bottom: 0;
}

/* Columna de imagen */
.wishlist-img-col {
  width: 85px;
  height: 85px;
  background: #f8f8f8;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #f0f0f0;
}

.wishlist-img-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Columna de información */
.wishlist-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 100px;
}

.wishlist-item .nombre {
  font-size: 15px;
  font-weight: 500;
  color: #000;
  margin: 0 0 4px 0;
  letter-spacing: -0.2px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.wishlist-item .precio {
  font-size: 14px;
  color: #666;
  margin: 0;
  font-weight: 400;
}

/* Acciones del producto - Iconos a la derecha */
.wishlist-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.btn-carrito-mini,
.btn-remove-wishlist {
  background: #f5f5f5;
  color: #000;
  border: none;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-carrito-mini:hover {
  background: #e8e8e8;
}

.btn-remove-wishlist:hover {
  background: #ffe6e6;
  color: #e74c3c;
}

.btn-carrito-mini i,
.btn-remove-wishlist i {
  pointer-events: none;
}

.btn-carrito-mini.fade-out {
  animation: fadeOut 0.3s forwards;
}

.in-cart-note {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #2ecc71;
  background: #e8f8f0;
  border-radius: 10px;
  flex-shrink: 0;
}

.in-cart-note.fade-in {
  animation: fadeIn 0.3s forwards;
}

/* ========================================================================
   ESTADOS VACÍOS
   ======================================================================== */

.wishlist-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
}

.wishlist-empty-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 30px;
  color: #ddd;
}

.wishlist-empty-icon svg {
  width: 100%;
  height: 100%;
}

.wishlist-empty-state h3 {
  font-size: 20px;
  font-weight: 400;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.4;
}

.wishlist-sub {
  font-size: 15px;
  color: #999;
  margin-bottom: 24px;
}

.wishlist-links {
  font-size: 15px;
  color: #666;
}

.wishlist-link {
  color: #000;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid #000;
  transition: opacity 0.2s;
}

.wishlist-link:hover {
  opacity: 0.6;
}

.wishlist-hint {
  background: #fff;
  padding: 20px;
  margin-top: 30px;
  border-radius: 12px;
  font-size: 14px;
  color: #666;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ========================================================================
   SELECTOR DE TALLAS
   ======================================================================== */

.size-picker {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: slideUp 0.3s ease-out;
}

.size-picker.slide-up-full {
  animation: slideUpFull 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.size-picker.fade-out-down {
  animation: fadeOutDown 0.25s ease-in forwards;
}

.size-picker.fade-out-side {
  animation: fadeOutSide 0.3s ease-in forwards;
}

.size-picker-inner {
  background: #fff;
  padding: 40px 30px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  max-width: 90%;
  width: 380px;
  position: relative;
}

.size-picker-inner h3 {
  font-size: 22px;
  font-weight: 500;
  color: #000;
  margin-bottom: 25px;
  text-align: center;
  letter-spacing: -0.3px;
}

.size-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.size-option {
  background: #f5f5f5;
  border: none;
  padding: 16px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  color: #000;
  letter-spacing: -0.2px;
}

.size-option:hover {
  background: #e8e8e8;
}

.size-option.chosen {
  background: #000;
  color: #fff;
  transform: scale(1.05);
}

.close-size-picker {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.close-size-picker:hover {
  color: #000;
}

/* Blur del contenido cuando se abre picker */
.wishlist-content.blurred {
  filter: blur(3px);
  pointer-events: none;
}

/* ========================================================================
   TOAST MESSAGES
   ======================================================================== */

.toast-message {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 16px 32px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.2px;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: bottom 0.3s ease;
}

.toast-message.show {
  bottom: 40px;
}

/* ========================================================================
   CONTADOR DEL BADGE
   ======================================================================== */

.wishlist-count {
  position: absolute;
  top: -5px;
  right: -8px;
  background: #ff4d6d;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  transition: transform 0.2s;
}

.wishlist-count.changed {
  animation: bounce 0.4s ease;
}

.wishlist-count[hidden] {
  display: none;
}

/* ========================================================================
   ANIMACIONES
   ======================================================================== */

@keyframes slideUpFull {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes fadeOutDown {
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

@keyframes fadeOutSide {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 768px) {
  #wishlist-panel {
    max-width: 100%;
  }

  .wishlist-header {
    padding: 12px;
  }

  #wishlist-header-title {
    font-size: 32px;
  }

  #close-wishlist-panel {
    font-size: 26px;
  }

  .wishlist-content {
    padding: 10px;
  }

  .wishlist-item {
    gap: 12px;
    padding: 10px;
    margin-bottom: 10px;
  }

  .wishlist-img-col {
    width: 90px;
    height: 90px;
  }

  .btn-carrito-mini,
  .btn-remove-wishlist,
  .in-cart-note {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .size-picker {
    max-width: 100%;
  }

  .size-picker-inner {
    width: calc(100% - 40px);
  }
}

@media (max-width: 480px) {
  .wishlist-header {
    padding: 10px;
  }

  #wishlist-header-title {
    font-size: 28px;
  }

  #close-wishlist-panel {
    font-size: 24px;
  }

  .wishlist-content {
    padding: 8px;
  }

  .wishlist-item {
    gap: 10px;
    padding: 8px;
  }

  .wishlist-img-col {
    width: 80px;
    height: 80px;
  }

  .wishlist-item .nombre {
    font-size: 15px;
  }

  .wishlist-item .precio {
    font-size: 14px;
  }

  .btn-carrito-mini,
  .btn-remove-wishlist,
  .in-cart-note {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .wishlist-actions {
    gap: 8px;
  }
}
