/**
 * LNC Wishlist Styles
 *
 * Complete styles for wishlist feature:
 * - Side drawer
 * - Full page grid
 * - PLP heart buttons
 * - Header badge
 *
 * @package LNC_Alpine_Store
 * @version 1.0.0
 */

/* ========================================
   UTILITIES
   ======================================== */

/* Scroll lock (iOS-safe) */
html.lnc-scroll-lock {
  overflow: hidden;
  overflow-y: scroll; /* Keep scrollbar gutter visible to prevent layout shift */
}

/* Hide elements before Alpine initializes */
[x-cloak] {
  display: none !important;
}

/* ========================================
   OVERLAY
   ======================================== */

.lnc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  cursor: pointer;
}

/* ========================================
   SIDE DRAWER
   ======================================== */

.lnc-side-wishlist {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background: #fff;
  box-shadow: -2px 0 16px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  outline: none;
}

/* Drawer Header */
.lnc-side-wishlist__header,
.lnc-side-wishlist__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.lnc-side-wishlist__footer {
  border-bottom: 0;
  border-top: 1px solid #e5e7eb;
}

.lnc-side-wishlist__header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #111827;
}

.lnc-side-wishlist__header .lnc-btn--icon {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  color: #6b7280;
  transition: color 0.2s ease;
}

.lnc-side-wishlist__header .lnc-btn--icon:hover {
  color: #111827;
}

/* Drawer Body */
.lnc-side-wishlist__body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
}

/* Scrollbar styling */
.lnc-side-wishlist__body::-webkit-scrollbar {
  width: 8px;
}

.lnc-side-wishlist__body::-webkit-scrollbar-track {
  background: #f9fafb;
}

.lnc-side-wishlist__body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.lnc-side-wishlist__body::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ========================================
   EMPTY STATE (DRAWER)
   ======================================== */

.lnc-side-wishlist__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 1rem;
  text-align: center;
  color: #6b7280;
  min-height: 300px;
}

.lnc-side-wishlist__empty p {
  margin: 0;
  font-size: 0.95rem;
}

/* ========================================
   ITEMS LIST (DRAWER)
   ======================================== */

.lnc-side-wishlist__items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lnc-wishlist-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  transition: box-shadow 0.2s ease;
}

.lnc-wishlist-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lnc-wishlist-item__image {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: #f9fafb;
}

.lnc-wishlist-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lnc-wishlist-item__details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.lnc-wishlist-item__name {
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.lnc-wishlist-item__name:hover {
  color: #2563eb;
}

.lnc-wishlist-item__variation {
  font-size: 0.875rem;
  color: #6b7280;
}

.lnc-wishlist-item__price {
  font-weight: 600;
  color: #111827;
  margin-top: 0.25rem;
}

.lnc-wishlist-item__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-self: center;
}

/* ========================================
   FULL PAGE
   ======================================== */

.lnc-wishlist-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.lnc-wishlist-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.lnc-wishlist-page__header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

.lnc-wishlist-page__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ========================================
   EMPTY STATE (PAGE)
   ======================================== */

.lnc-wishlist-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 1rem;
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
  text-align: center;
  min-height: 400px;
}

.lnc-wishlist-page__empty h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.lnc-wishlist-page__empty p {
  color: #6b7280;
  margin: 0;
  font-size: 1rem;
}

/* ========================================
   PRODUCT GRID (PAGE)
   ======================================== */

.lnc-wishlist-page__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.lnc-wishlist-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.lnc-wishlist-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.lnc-wishlist-card__image {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f9fafb;
  position: relative;
}

.lnc-wishlist-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.lnc-wishlist-card:hover .lnc-wishlist-card__image img {
  transform: scale(1.05);
}

.lnc-wishlist-card__content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lnc-wishlist-card__title {
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.lnc-wishlist-card__title:hover {
  color: #2563eb;
}

.lnc-wishlist-card__variation {
  font-size: 0.875rem;
  color: #6b7280;
}

.lnc-wishlist-card__price {
  font-weight: 600;
  font-size: 1.125rem;
  color: #111827;
  margin-top: auto;
}

.lnc-wishlist-card__actions {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

/* ========================================
   PLP HEART BUTTON
   ======================================== */

.lnc-wishlist-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6b7280;
  z-index: 10;
  padding: 0;
}

.lnc-wishlist-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.lnc-wishlist-btn.is-active {
  background: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
}

.lnc-wishlist-btn svg {
  pointer-events: none;
}

/* ========================================
   HEADER ICON & BADGE
   ======================================== */

.lnc-header__wishlist {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.lnc-header__wishlist:hover {
  color: #ef4444;
}

.lnc-header__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 0.3rem;
  line-height: 1;
}

/* ========================================
   BUTTONS
   ======================================== */

.lnc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 0.625rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.lnc-btn:hover {
  background: #f9fafb;
}

.lnc-btn--primary {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.lnc-btn--primary:hover {
  background: #1f2937;
  border-color: #1f2937;
}

.lnc-btn--outline {
  background: transparent;
  border-color: #d1d5db;
}

.lnc-btn--outline:hover {
  border-color: #111827;
  background: #f9fafb;
}

.lnc-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: #6b7280;
}

.lnc-btn--ghost:hover {
  background: #f3f4f6;
  color: #111827;
}

.lnc-btn--block {
  width: 100%;
}

.lnc-btn--sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.lnc-btn--lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

.lnc-btn:disabled,
.lnc-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .lnc-wishlist-page {
    padding: 1.5rem 1rem;
  }

  .lnc-wishlist-page__header h1 {
    font-size: 1.5rem;
  }

  .lnc-wishlist-page__grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .lnc-side-wishlist {
    width: 100vw;
  }

  .lnc-wishlist-item {
    grid-template-columns: 64px 1fr;
    gap: 0.75rem;
  }

  .lnc-wishlist-item__actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .lnc-wishlist-page__header {
    flex-direction: column;
    align-items: stretch;
  }

  .lnc-wishlist-page__actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .lnc-overlay,
  .lnc-side-wishlist,
  .lnc-wishlist-btn,
  .lnc-wishlist-card__actions,
  .lnc-wishlist-page__actions {
    display: none !important;
  }
}
