/* Wishlist Page CSS */

/* Container */
.wishlist-container {
  padding-top: 120px; /* Account for fixed header */
  padding-bottom: 60px;
  min-height: 80vh;
}

/* Page Header */
.wishlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.wishlist-title {
  font-family: "DM Sans", sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: #303030;
}

/* Toggle Switch / Tabs */
.wishlist-tabs {
  background: #eaf8ff;
  border-radius: 100px;
  padding: 5px;
  display: flex;
  position: relative;
  width: fit-content;
}

.wishlist-tab-btn {
  border: none;
  background: transparent;
  padding: 10px 30px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;

  color: #303030;
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.3s ease;
  min-width: 120px;
  position: relative;
  z-index: 1;
}

.wishlist-tab-btn.active {
  color: #ffffff;
}

/* Sliding pill behind the active tab — JS positions it on init / resize /
   tab click. Width 0 + translateX(0) is the pre-paint state; JS swaps both
   to the active button's offsetWidth/offsetLeft inside requestAnimationFrame. */
.wishlist-tab-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  background: #303030;
  border-radius: 100px;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

/* Grid Layout */
.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  justify-items: center;
}

/* Skeleton Loading */
.wishlist-skeleton-card {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  width: 420px;
  border: 1px solid #e7eef1;
}

.wishlist-skeleton-img {
  width: 100%;
  height: 300px;
  border-bottom: 1px solid #e7eef1;
}

.wishlist-skeleton-content {
  padding: 15px 18px;
}

.wishlist-skeleton-title {
  height: 20px;
  width: 70%;
  margin-bottom: 12px;
}

.wishlist-skeleton-subtitle {
  height: 14px;
  width: 50%;
  margin-bottom: 15px;
}

.wishlist-skeleton-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.wishlist-skeleton-price {
  height: 24px;
  width: 80px;
}

.wishlist-skeleton-pill {
  height: 32px;
  width: 100px;
  border-radius: 40px;
}

@media (max-width: 767px) {
  .wishlist-grid.is-cycles .wishlist-skeleton-card {
    width: 100%;
    display: flex;
    gap: 12px;
    padding: 0px 10px 18px 10px;
    border-bottom: 1px solid #dce6ec;
    border: none;
    border-radius: 0;
  }

  .wishlist-grid.is-cycles .wishlist-skeleton-img {
    width: 160px;
    min-width: 160px;
    height: 102px;
    border-radius: 18px;
    border: 1px solid #e7eef1;
  }

  .wishlist-grid.is-cycles .wishlist-skeleton-content {
    flex: 1;
    padding: 2px 0;
  }

  .wishlist-grid.is-accessories .wishlist-skeleton-card {
    width: 158px;
    height: 247px;
    border: none;
    background: transparent;
  }

  .wishlist-grid.is-accessories .wishlist-skeleton-img {
    height: 130px;
    width: 100%;
    border-radius: 20px;
    border: 1px solid #e7eef1;
  }
}

/* Empty State */
.empty-wishlist {
  text-align: center;
  padding: 60px 0;
  width: 100%;
  grid-column: 1 / -1;
}

.empty-wishlist img {
  width: 180px;
  opacity: 0.6;
  /* margin-bottom: 20px; */
}

/* Cycle Card Component */
.wishlist-card {
  position: relative;
  width: 420px;
  /* height: 480px;  */
  background: #ffffff;

  /* overflow: hidden; */ /* Removed to allow tenure dropdown to overflow */
  transition: box-shadow 0.3s ease;
  z-index: 1;
}

.wishlist-card.is-tenure-open {
  z-index: 1000; /* Ensure active card is above others */
}

/* .wishlist-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
} */

/* Image Area */
.wishlist-card-img-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e7eef1;
}

.wishlist-grid.is-cycles .wishlist-card-img-wrapper {
  aspect-ratio: 53 / 37;
  overflow: hidden;
}

.wishlist-card-img {
  max-width: 100%;
  max-height: 100%;
  /* object-fit: contain; */
}

.wishlist-grid.is-cycles .wishlist-card-img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Heart Icon (Red) */
.wishlist-heart-btn {
  position: absolute !important;
  top: 5px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #f60004;
  transition: transform 0.2s;
}

/* .wishlist-heart-btn:hover {
  transform: scale(1.1);
} */

/* Yellow Tag (Non Gear) */
.wishlist-tag {
  position: absolute;
  top: 14px;
  left: 15px;
  min-width: 70px;
  height: 24px;
  background: linear-gradient(88.74deg, #f9ffa1 0.67%, #fefff7 98.92%);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.wishlist-tag span {
  font-family: "DM Sans", sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 12px;
  color: #9f9400;
}

.wishlist-tag icon {
  /* Lightning icon if needed, can use text or svg */
  margin-right: 4px;
  font-size: 12px;
}

/* Gear-type tag pill on each wishlist cycle card (reuses .featured-item .tag) */
.wishlist-card-img-wrapper.featured-item .tag {
  top: 4%;
  left: 4%;
      background: linear-gradient(88.74deg, #f9ffa1 0.67%, #fefff7 98.92%) !important;
}

.wishlist-gear-tag-text {
  color: #686100;
  font-weight: 600;
  font-size: 12px;
  margin: 5px;
    margin-left: 0px;
  line-height: 1;
}

.wishlist-gear-tag-icon {
  font-size: 10px;
  margin-right: 2px;
}

/* Content Area */
.wishlist-card-content {
  padding: 15px 18px; 
  position: relative;
}

.wishlist-card-title {
  font-family: "DM Sans", sans-serif;
  /* font-weight: 800; */
  font-size: 18px;
  line-height: 21px;
  color: #000000;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wishlist-card-subtitle {
  font-family: "DM Sans", sans-serif;
  /* font-weight: 900; */
  font-size: 14px;
  line-height: 18px;
  color: #303030;
  margin-bottom: 12px;
}

/* Pricing & Tenure */
.wishlist-pricing-content {
  display: flex;
  flex-direction: column;
  gap: 0px;
  margin-top: 0px;
}

.wishlist-pricing-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* Match product.php similar-products price card:
   ₹ symbol uses Courier New (typewriter look), number uses Poppins 700.
   !important wins over inherited DM Sans on the card. */
.wishlist-card .wishlist-price {
  font-size: 20px;
  color: #303030;
  line-height: 1.1;
  letter-spacing: 0.2px;
}
.wishlist-card .wishlist-price .wishlist-currency {
  font-family: "Courier New", Courier, monospace !important;
  font-weight: 700 !important;
  font-size: 22px;
}
.wishlist-card .wishlist-price .wishlist-amount {
  font-family: "Poppins", sans-serif !important;
  font-weight: 700 !important;
  font-size: 20px;
}

.wishlist-period {
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: #8f999e;              /* grey secondary label, matches .duration-per-month */
  margin-left: 0;
  line-height: 1;
}

.wishlist-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  position: relative;
}

/* Tenure Selector (Source of truth: cart.php) */
.wishlist-tenure-pill {
  display: inline-flex;
  align-items: center;
  border: 2px solid #00a5f1;
  border-radius: 50px;
  padding: 8px 10px;
  background: #ffffff;
  color: #00a5f1;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.25px;
  cursor: pointer;
  width: fit-content;
  position: relative;
  transition: all 0.3s ease;
  z-index: 10;
}

.wishlist-tenure-pill span {
  line-height: 1;
}

.wishlist-tenure-pill i {
  margin-left: 8px;
  font-size: 10px;
}

.wishlist-tenure-menu {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  background: #ffffff;
  border: 1px solid #e7eef1;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1001;
  min-width: 140px;
  padding: 8px 0;
  max-height: 250px;
  overflow-y: auto;
  pointer-events: auto; /* Ensure menu items are clickable despite stretched-link */
}

.tenure-option {
  padding: 8px 16px;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  color: #303030;
  transition: background 0.2s;
}

.tenure-option:hover {
  background: #f0faff;
}

.tenure-option .tenure-opt-price {
  font-size: 11px;
  color: #707070;
  margin-top: 2px;
}

/* Trash/Delete Action */
.wishlist-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #95a1a7; /* Gray default */
  transition: color 0.2s;
}

/* .wishlist-delete-btn:hover {
  color: #f60004; 
} */

/* Accessory Card Specifics if needed (similar to cycle card) */
.wishlist-card.accessory-card {
  height: 300px; /* Accessories might be smaller if desired, or keep same */
}

.wishlist-heart-btn,
.wishlist-delete-btn {
  z-index: 5;
}

@media (max-width: 767px) {
  .wishlist-container {
    padding-top: 68px;
    padding-bottom: 30px;
    padding-right: 10px;
    padding-left: 10px;
    min-height: calc(100vh - 68px);
  }

  .wishlist-header {
    margin-bottom: 20px;
    gap: 14px;
  }

  .wishlist-title {
    display: none;
  }

  .wishlist-tabs {
    width: 100%;
    padding: 3px;
  }

  /* Match the smaller mobile padding so the pill hugs the tab edges. */
  .wishlist-tab-indicator {
    top: 3px;
    bottom: 3px;
  }

  /* Shrink gear-type tag on mobile so it fits the 160x102 image tile */
  .wishlist-gear-tag-text {
    font-size: 10px;
    margin: 5px;
    margin-left: 0px;
  }

  .wishlist-gear-tag-icon {
    font-size: 7px;
    margin-right: 1px;
  }

  .wishlist-card-img-wrapper.featured-item .tag {
    padding-left: 5px;
    padding-right: 5px;
    top: 6%;
    left: 6% !important;
  }

  .wishlist-tab-btn {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    padding: 10px 14px;
  }

  .wishlist-grid {
    gap: 14px;
  }

  .wishlist-grid.is-cycles {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  .wishlist-grid.is-cycles .wishlist-card {
    width: 100%;
    display: flex;
    gap: 12px;
    padding: 0px 10px 18px 10px;
    border-bottom: 1px solid #dce6ec;
  }

  .wishlist-grid.is-cycles .wishlist-card-img-wrapper {
    width: 160px;
    min-width: 160px;
    height: 102px;
    border-radius: 18px;
    padding: 0px !important;
    border: 1px solid #e7eef1;
    flex-shrink: 0;
  }

  .wishlist-grid.is-cycles .wishlist-card-content {
    flex: 1;
    padding: 5px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
  }

  .wishlist-grid.is-cycles .wishlist-card-title {
    font-size: 16px;
    line-height: 1.2;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
  }

  .wishlist-grid.is-cycles .wishlist-card-subtitle {
    font-size: 14px;
    line-height: 1.2;
    color: #303030;
    margin-bottom: 12px;
  }

  .wishlist-grid.is-cycles .wishlist-price {
    font-size: 16px;
    line-height: 1;
  }
  .wishlist-grid.is-cycles .wishlist-price .wishlist-currency {
    font-family: "Courier New", Courier, monospace !important;
    font-weight: 700 !important;
    font-size: 17px;
  }
  .wishlist-grid.is-cycles .wishlist-price .wishlist-amount {
    font-family: "Poppins", sans-serif !important;
    font-weight: 700 !important;
    font-size: 16px;
  }

  .wishlist-grid.is-cycles .wishlist-period {
    font-size: 13px;
    margin-left: 0;
  }

  .wishlist-grid.is-cycles .wishlist-delete-btn {
    padding: 8px;
    margin-top: 0;
  }

  .wishlist-grid.is-cycles .wishlist-delete-btn img {
    width: 18px !important;
  }

  .wishlist-grid.is-cycles .wishlist-heart-btn {
    top: 0px;
    right: 10px;
  }

  .wishlist-grid.is-cycles .wishlist-heart-btn img {
    width: 16px;
  }

  .wishlist-grid.is-cycles .wishlist-tag {
    top: 10px;
    left: 10px;
    height: 22px;
    min-width: 64px;
  }

  .wishlist-grid.is-cycles .wishlist-tag span {
    font-size: 11px;
  }

  .wishlist-grid.is-accessories {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 12px;
    justify-items: center;
    width: 100%;
  }

  .wishlist-grid.is-accessories .wishlist-card {
    width: 158px;
    height: 247px;
    background: transparent;
    border: none;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 0;
  }

  .wishlist-grid.is-accessories .wishlist-card-img-wrapper {
    height: 130px;
    width: 100%;
    border-radius: 20px;
    border: 1px solid #e7eef1;
    padding: 10px;
    background: #fff;
    position: relative;
    overflow: hidden;
  }

  .wishlist-grid.is-accessories .wishlist-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .wishlist-grid.is-accessories .wishlist-card-content {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
  }

  .wishlist-grid.is-accessories .wishlist-card-title {
    font-size: 13px;
    line-height: 1.2;
    margin-bottom: 4px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 500;
  }

  .wishlist-grid.is-accessories .wishlist-card-subtitle {
    font-size: 11px;
    line-height: 1.2;
    color: #707070;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .wishlist-grid.is-accessories .wishlist-price {
    font-size: 15px;
    line-height: 1;
  }

  .wishlist-grid.is-accessories .wishlist-period {
    font-size: 11px;
    margin-left: 0;
  }

  .wishlist-grid.is-accessories .wishlist-delete-btn {
    position: static; /* Remove absolute positioning */
    display: flex;
    padding: 0;
    z-index: 5;
  }

  .wishlist-price-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: auto;
  }

  .wishlist-pricing-row {
    margin-top: 0px;
    display: flex;
    align-items: baseline;
  }
}

#empty-cart-msg {
  min-height: 0vh !important;
}
