/* =============================================
   Favoritos: FAB + Modal + List/Grid styles
   ============================================= */

.favorites-fab {
  position: fixed;
  top: 110px;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, #ff4d6d 0%, #c9184a 100%);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(201, 24, 74, 0.35);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  z-index: 1055;
}

.favorites-fab[hidden] {
  display: none !important;
}

.favorites-fab:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.7);
  outline-offset: 4px;
}

.favorites-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(201, 24, 74, 0.45);
}

.favorites-fab__icon {
  font-size: 1.2rem;
  line-height: 1;
}

.favorites-fab__count {
  min-width: 1.8rem;
  height: 1.8rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.favorites-fab__pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffe5ec;
  position: absolute;
  top: -6px;
  right: -6px;
  box-shadow: 0 0 0 rgba(255, 229, 236, 0.8);
  transform-origin: center;
  animation: favorites-pulse 1.8s ease-out infinite;
  pointer-events: none;
}

.favorites-fab--attention {
  animation: favorites-buzz 4.2s ease infinite;
}

@keyframes favorites-pulse {
  0% {
    transform: scale(0.6);
    box-shadow: 0 0 0 0 rgba(255, 229, 236, 0.65);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(255, 229, 236, 0);
  }
  100% {
    transform: scale(0.6);
    box-shadow: 0 0 0 0 rgba(255, 229, 236, 0);
  }
}

@keyframes favorites-buzz {
  0%, 92%, 100% {
    transform: translate3d(0, 0, 0);
  }
  94% {
    transform: translate3d(-2px, 0, 0);
  }
  96% {
    transform: translate3d(2px, 0, 0);
  }
  98% {
    transform: translate3d(-1px, 0, 0);
  }
}

/* ===== Modal ===== */

.favorites-modal .modal-content {
  position: relative;
  border-radius: 22px;
  border: none;
  box-shadow: 0 32px 70px rgba(16, 24, 40, 0.22);
  overflow: hidden;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 248, 255, 0.98) 55%, rgba(255, 247, 252, 0.95) 100%);
  backdrop-filter: blur(6px);
}

.favorites-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 88, 120, 0.12);
  color: #d6336c;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  z-index: 2;
}

.favorites-modal__close:hover,
.favorites-modal__close:focus-visible {
  transform: scale(1.08);
  background: rgba(214, 51, 108, 0.18);
  color: #ad1457;
}

.favorites-modal__header {
  padding: 2.25rem 2.25rem 1.5rem;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.favorites-modal__heading {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.favorites-modal__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f06595, #d6336c);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(214, 51, 108, 0.35);
}

.favorites-modal__titles {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.favorites-modal__header .modal-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
}

.favorites-modal__subtitle {
  color: #667085;
  font-size: 0.97rem;
}

.favorites-modal__btn-close {
  position: relative;
  top: 4px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, background 0.2s ease;
}

.favorites-modal__btn-close:hover,
.favorites-modal__btn-close:focus-visible {
  background: rgba(15, 23, 42, 0.08);
  transform: scale(1.05);
}

.favorites-modal .modal-body {
  padding: 0 2.25rem 2.25rem;
}

.favorites-view-toggle {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255, 240, 246, 0.85);
  padding: 0.35rem;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 16px rgba(214, 51, 108, 0.12);
}

.favorites-view-toggle__btn {
  border: none;
  background: transparent;
  color: #c9184a;
  font-weight: 600;
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95rem;
}

.favorites-view-toggle__btn:focus-visible {
  outline: 2px solid rgba(214, 51, 108, 0.5);
  outline-offset: 2px;
}

.favorites-view-toggle__btn.is-active {
  background: #ffffff;
  color: #d6336c;
  box-shadow: 0 14px 28px rgba(214, 51, 108, 0.18);
}

.favorites-empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2.5rem 1rem;
  color: #6c757d;
  border: 1px dashed rgba(201, 24, 74, 0.25);
  border-radius: 16px;
  background: rgba(255, 229, 236, 0.25);
}

.favorites-empty__icon {
  font-size: 2.6rem;
  margin-bottom: 0.75rem;
}

.favorites-items {
  display: grid;
  gap: 1rem;
  position: relative;
}

.favorites-items[data-view="grid"] {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
}

.favorites-items[data-view="list"] {
  grid-template-columns: 1fr;
}

.favorites-item {
  display: flex;
  gap: 1rem;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(249, 244, 255, 0.9));
  border-radius: 18px;
  border: 1px solid rgba(214, 51, 108, 0.08);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
  padding: 1rem;
  align-items: flex-start;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.favorites-items[data-view="grid"] .favorites-item {
  flex-direction: column;
  align-items: stretch;
}

.favorites-items[data-view="list"] .favorites-item {
  flex-direction: row;
}

.favorites-item:hover {
  transform: translateY(-4px);
  border-color: rgba(214, 51, 108, 0.18);
  box-shadow: 0 26px 45px rgba(15, 23, 42, 0.15);
}

.favorites-item__image-wrap {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 240, 246, 0.95), rgba(238, 246, 255, 0.9));
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.favorites-items[data-view="grid"] .favorites-item__image-wrap {
  width: 100%;
  max-width: 240px;
  height: 180px;
  margin: 0 auto;
}

.favorites-item__image {
  width: auto;
  height: auto;
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  display: block;
}

.favorites-item__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.25rem;
}

.favorites-item__title {
  font-weight: 600;
  color: #101828;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.favorites-item__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: #667085;
  flex-wrap: wrap;
}

.favorites-item__price {
  font-weight: 700;
  color: #c9184a;
}

.favorites-item__price-original {
  font-weight: 600;
  color: #adb5bd;
  text-decoration: line-through;
}

.favorites-item__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.favorites-item__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.favorites-item__btn--primary {
  background: linear-gradient(135deg, #38b000, #0f7b0f);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(15, 123, 15, 0.28);
}

.favorites-item__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(15, 123, 15, 0.35);
}

.favorites-item__btn--ghost {
  background: rgba(214, 51, 108, 0.12);
  color: #d6336c;
}

.favorites-item__btn--ghost:hover {
  background: rgba(214, 51, 108, 0.18);
  transform: translateY(-1px);
}

.favorites-item__btn svg,
.favorites-item__btn i {
  font-size: 1rem;
}

/* ===== Responsive tweaks ===== */

@media (max-width: 992px) {
  .favorites-fab {
    right: 1rem;
  }

  .favorites-modal__header,
  .favorites-modal .modal-body {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }
}

@media (max-width: 768px) {
  .favorites-fab {
    top: 90px;
    padding: 0.6rem 0.9rem;
  }

  .favorites-fab__count {
    min-width: 1.6rem;
    height: 1.6rem;
    font-size: 0.85rem;
  }

  .favorites-modal__header,
  .favorites-modal .modal-body {
    padding-left: 1.35rem;
    padding-right: 1.35rem;
  }

  .favorites-modal__heading {
    gap: 0.75rem;
  }

  .favorites-modal__icon {
    width: 46px;
    height: 46px;
    font-size: 1.5rem;
  }

  .favorites-items[data-view="grid"] {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .favorites-item {
    padding: 0.85rem;
  }

  .favorites-items[data-view="grid"] .favorites-item__image-wrap {
    height: 160px;
  }
}

@media (max-width: 576px) {
  .favorites-fab {
    top: 82px;
    right: 0.75rem;
    padding: 0.55rem 0.8rem;
  }

  .favorites-item__image-wrap {
    width: 80px;
    height: 80px;
  }

  .favorites-items[data-view="grid"] .favorites-item__image-wrap {
    height: 150px;
  }

  .favorites-item__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .favorites-item__btn {
    width: 100%;
  }
}
