/* Wishlist page — definitive styles matching wishlist.html and global tokens */

/* Ensure spacing below sticky header */
.wishlist-page.container {
  margin-top: calc(var(--header-height) + var(--space-6));
}

/* Header/nav: make wishlist header links look like pills/buttons (Home/About/Compare/Login) */
.site-header .site-nav{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Fix: wishlist.html uses a legacy header structure. Ensure it doesn't blow up layout. */
.site-header .header-inner{
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
}

.site-header .logo{
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.site-header .logo img{
  max-height: 44px;
  width: auto;
  object-fit: contain;
}

/* Ensure nav wraps instead of pushing content off-screen */
.site-header .site-nav{
  flex: 1 1 auto;
  justify-content: flex-end;
}

@media (max-width: 768px){
  .site-header .header-inner{
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .site-header .site-nav{
    width: 100%;
    justify-content: flex-start;
  }
  #auth-controls{ width: 100%; margin-left: 0 !important; }
}

.site-header .site-nav a,
.site-header .site-nav button{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 38px;
  padding: 0 14px;
  border-radius: 999px;

  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;

  background: color-mix(in srgb, var(--surface) 78%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  color: var(--text);

  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.18);
  transition: transform .15s ease, filter .15s ease, background .15s ease, border-color .15s ease;
}

.site-header .site-nav a:visited{ color: inherit; }

.site-header .site-nav a:hover,
.site-header .site-nav button:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  text-decoration: none;
}

/* Active page */
.site-header .site-nav a.active{
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #061427;
  border-color: transparent;
}

/* Auth block buttons */
#auth-controls #auth-login{
  text-decoration: none;
}

#auth-controls #auth-logout{
  cursor: pointer;
}

/* Page title */
.wishlist-page h1 {
  margin: 0 0 var(--space-6);
  font-size: clamp(24px, 3.5vw, 32px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Empty state */
.wishlist-empty { text-align: center; color: var(--muted-2); margin: var(--space-8) 0; }
.wishlist-empty .btn, .wishlist-empty .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-4);

  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #081226;

  border: none;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 900;
  text-decoration: none;
  line-height: 1;
  min-height: 46px;

  -webkit-appearance: none;
  appearance: none;
}

.wishlist-empty .btn:hover, .wishlist-empty .btn-primary:hover {
  text-decoration: none;
  filter: brightness(1.03);
}

.wishlist-empty .btn:focus-visible, .wishlist-empty .btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 40%, transparent);
}

/* If the empty-state CTA is an <a>, prevent global link underline */
.wishlist-empty a.btn, .wishlist-empty a.btn-primary {
  text-decoration: none;
}

/* Grid that holds wishlist items */
#wishlist-items.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

@media (max-width: 520px){
  #wishlist-items.wishlist-grid{
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Card shell (reuse product card visuals for consistency) */
.wishlist-page .product-card {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface) 80%, #ffffff),
    color-mix(in srgb, var(--surface-2) 72%, #ffffff)
  );
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  backdrop-filter: saturate(var(--glass-sat)) blur(calc(var(--glass-blur) - 6px));
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.18);
}
.wishlist-page .product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary-600) 70%, var(--border));
}

/* Media */
.wishlist-page .product-media {
  width: 100%;
  height: clamp(150px, 26vw, 200px);
  background: radial-gradient(circle at top, rgba(30, 94, 255, 0.18), color-mix(in srgb, var(--surface) 86%, #ffffff));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
}
.wishlist-page .product-image { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Body */
.wishlist-page .product-info { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.wishlist-page .product-title { font-size: 1.05rem; font-weight: 800; margin: 0; line-height: 1.35; }
.wishlist-page .product-meta { color: var(--muted); font-size: .9rem; }

/* Actions */
.wishlist-page .product-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }

@media (max-width: 420px){
  .wishlist-page .product-actions{ grid-template-columns: 1fr; }
}
.wishlist-page .product-actions .btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, #000);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;

  /* Fix underlined link styles and inconsistent button rendering */
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;

  /* Ensure readability regardless of body theme */
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  color: var(--text);

  box-shadow:
    0 14px 34px rgba(2, 6, 23, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.10);

  transition:
    transform .15s ease,
    box-shadow .15s ease,
    filter .15s ease,
    background .15s ease,
    border-color .15s ease;
}

/* If action buttons are anchors, prevent global link underline */
.wishlist-page .product-actions a.btn {
  text-decoration: none;
}

.wishlist-page .product-actions .btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow:
    0 18px 46px rgba(2, 6, 23, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

.wishlist-page .product-actions .btn:active {
  transform: translateY(0);
}

.wishlist-page .product-actions .btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary) 40%, transparent),
    0 18px 46px rgba(2, 6, 23, 0.42);
}

.wishlist-page .product-actions .btn-secondary {
  background: color-mix(in srgb, var(--surface-2) 88%, #ffffff);
  color: var(--text);
}

.wishlist-page .product-actions .btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #061427;
  border-color: transparent;
  box-shadow: 0 18px 46px rgba(56, 189, 248, 0.28);
}

.wishlist-page .product-actions .btn-primary:hover {
  box-shadow: 0 26px 66px rgba(56, 189, 248, 0.38);
}

/* Prevent global button filters/overrides from washing out wishlist buttons */
.wishlist-page .product-actions .btn,
.wishlist-page .product-actions .btn * {
  filter: none !important;
}
