#wishlist {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

#wishlist-header {
  margin-bottom: 24px;
  padding: 16px 24px;
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  font-weight: 600;
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  display: grid;
  grid-template-columns: 120px 1fr 120px 150px;
  align-items: center;
  pointer-events: none;
  column-gap: 8px;
}

#wishlist-header > div {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
}

#wishlist-header > div:nth-child(1) {
  padding-left: 0;
}

#wishlist-header > div:nth-child(3) {
  text-align: center;
  padding-right: 8px;
}

#wishlist-header > div:nth-child(4) {
  text-align: center;
  border-left: 1px solid var(--border-color);
  padding-left: 16px;
}

.wish {
  display: flex;
  margin-bottom: 24px;
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.wish:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wish-img {
  flex: 0 0 120px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.03);
}

.wish-img > img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
}

.wish-content {
  display: flex;
  flex: 1;
  padding: 16px;
}

.wish-content > div {
  margin: 0 8px;
}

.wish-text {
  flex-grow: 1;
  min-width: 0;
}

.wish-text > div {
  margin-bottom: 12px;
  text-align: left;
}

.wish-text-header {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  margin-bottom: 12px;
  line-height: 1.2;
}

.wish-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
  margin-right: auto;
  margin-bottom: 0;
  padding: 0;
  line-height: inherit;
}

.wish-actions {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-shrink: 0;
}

.inline-form {
  margin: 0;
  padding: 0;
  display: inline;
  background: none;
  box-shadow: none;
}

.wish-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.2;
  height: auto;
}

.edit-btn {
  background-color: var(--background-color);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.edit-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

.delete-btn {
  background-color: var(--background-color);
  border: 1px solid #e53935;
  color: #e53935;
}

.delete-btn:hover {
  background-color: #e53935;
  color: white;
}

.wish-text-header > a,
.wish-text-header form a {
  cursor: pointer;
}

.wish-text-desc {
  font-size: 14px;
  color: var(--text-light);
  white-space: pre-wrap;
  margin-top: 12px;
  margin-bottom: 12px;
}

.wish-text-links {
  margin-top: 8px;
}

.wish-text-links > a {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--primary-color);
}

.wish-price {
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.02);
}

.wish-price .amount {
  font-weight: 600;
  font-size: 18px;
}

.wish-price .currency {
  font-size: 14px;
  color: var(--text-light);
}

.usd-price {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

.wish-reserve {
  flex: 0 0 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-left: 1px solid var(--border-color);
  text-align: center;
}

.wish-reserve div {
  width: 100%;
  text-align: center;
}

.wish-reserve a {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: var(--transition);
  width: 100%;
  white-space: nowrap;
}

.wish-reserve a:hover {
  background-color: var(--primary-hover);
  text-decoration: none;
}

/* Reserved items styling */
.reserved {
  opacity: 0.7;
}

.reserved .wish-title,
.reserved .wish-text-desc,
.reserved .wish-text-links,
.reserved .wish-price .amount,
.reserved .wish-price .currency,
.reserved .wish-price .usd-price {
  text-decoration: line-through;
}

.reserved .wish-img img {
  filter: grayscale(1);
}

.reserved .wish-reserve div {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
}

/* User-reserved items styling */
.user-reserved {
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color), var(--shadow);
}

.user-reserved .wish-reserve {
  background-color: rgba(55, 120, 194, 0.1);
}

.user-reserved .wish-reserve div {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 8px;
  text-align: center;
}

.user-reserved .wish-reserve a {
  background-color: #e53935;
  border-color: #e53935;
}

.user-reserved .wish-reserve a:hover {
  background-color: #c62828;
  border-color: #c62828;
  color: white;
}

@media (max-width: 768px) {
  .wish {
    flex-direction: column;
  }

  .wish-img {
    flex: 0 0 auto;
    height: 160px;
  }

  .wish-img > img {
    max-height: 100%;
    width: auto;
  }

  .wish-content {
    flex-direction: column;
  }

  .wish-content > div {
    margin: 0 0 16px 0;
    width: 100%;
  }

  /* Last div in wish-content should have no bottom margin */
  .wish-content > div:last-child {
    margin-bottom: 0;
  }

  /* Remove flex/grid for price section */
  .wish-price {
    display: block;
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    margin-bottom: 0 !important;
    /* Reset all flex properties */
    flex: initial;
    flex-direction: initial;
    align-items: initial;
    justify-content: initial;
    /* Center the content */
    text-align: center;
  }

  .wish-price .amount {
    display: inline-block;
    font-size: 16px;
    margin-right: 4px;
    vertical-align: middle;
  }

  .wish-price .currency {
    display: inline-block;
    font-size: 14px;
    margin-right: 8px;
    vertical-align: middle;
  }

  .usd-price {
    display: inline-block;
    margin-top: 0;
    font-size: 14px;
    vertical-align: middle;
  }

  /* Remove flex for reserve section */
  .wish-reserve {
    border-left: none;
    display: block;
    padding: 12px 16px 8px;
    border-top: none;
    margin-top: -8px;
    margin-bottom: 0 !important;
    /* Reset all flex properties */
    flex: initial;
    flex-direction: initial;
    align-items: initial;
    justify-content: initial;
    /* Center text for consistent appearance */
    text-align: center;
  }

  .wish-reserve div {
    display: inline-block;
    width: auto;
    vertical-align: middle;
    margin-right: 12px;
    font-size: 14px;
  }

  .wish-reserve a {
    display: inline-block;
    width: auto;
    margin-top: 0;
    vertical-align: middle;
  }

  /* Hide wishlist header on mobile */
  #wishlist-header {
    display: none;
  }
}

@media (max-width: 480px) {
  /* Wishlist header is already hidden at 768px */

  .wish-text-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .wish-title {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .wish-actions {
    margin-left: 0;
  }
}

/* Style for add wish button */
#wishlist > a.button {
  margin-bottom: 16px;
  padding: 8px 16px;
  display: inline-block;
  text-decoration: none !important;
}
