/* 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: all 0.3s ease;
  min-width: 120px;
}

.wishlist-tab-btn.active {
  background: #303030;
  color: #ffffff;
  /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); */
}

/* 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%;
  height: 300px; /* Give appropriate space for image */
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  padding: 10px;
  border-radius: 20px;

  border: 1px solid #e7eef1;
}

.btn-browse-cycles {
  width: 200px;
  height: 45px;
  background: linear-gradient(180deg, #21b9ff 0%, #00a5f1 100%);
  border-radius: 200px;
  border: none;
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  /* box-shadow: 0 4px 15px rgba(0, 165, 241, 0.3); */
  transition: transform 0.2s;
  text-decoration: none !important;
}

.btn-browse-cycles:active {
  /* transform: scale(1.05); */
  color: #ffffff !important;
}

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

/* Heart Icon (Red) */
.wishlist-heart-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  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: 20px;
  left: 20px;
  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;
}

/* Content Area */
.wishlist-card-content {
  padding: 15px 18px; /* Based on left: 33px (approx 20px) */
  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;
}

.wishlist-price {
  font-family: "Courier New", monospace; /* Courier New as requested */
  font-weight: 700;
  font-size: 20px;
  color: #303030;
}

.wishlist-period {
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #303030;
  margin-left: 5px;
}

.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: 1px solid #00a5f1;
  border-radius: 40px;
  padding: 4px 10px;
  background: #ffffff;
  color: #00a5f1;
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  width: fit-content;
  position: relative;
  transition: all 0.2s 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: 86px;
    padding-bottom: 30px;
    padding-right: 10px;
    padding-left: 10px;
    min-height: calc(100vh - 86px);
  }

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

  .wishlist-title {
    display: none;
  }

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

  .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: 2px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
  }

  .wishlist-grid.is-cycles .wishlist-card-title {
    font-size: 14px;
    line-height: 1.1;
    margin-bottom: 6px;
    white-space: nowrap;
  }

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

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

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

  .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: 4px;
  }

  .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;
  }
}
