/**
 * Wishlist Destinații - CSS Front-end
 * 
 * Stiluri pentru buton inimioară, trigger header, pop-up și carduri.
 * Design responsive, minimalist, ușor de customizat.
 * 
 * Prefix clase: wld- (Wishlist Destinații) pentru evitarea conflictelor CSS
 */

/* ========================================
   1. BUTON INIMIOARĂ (.wld-heart-button)
   ======================================== */

.wld-heart-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    position: relative;
    z-index: 10;
}

.wld-heart-button:hover {
    transform: scale(1.1);
}

.wld-heart-button:active {
    transform: scale(0.95);
}

.wld-heart-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.wld-heart-button__icon {
    width: 24px;
    height: 24px;
    stroke: #333;
    fill: transparent;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.wld-heart-button.is-active .wld-heart-button__icon {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* ========================================
   2. TRIGGER HEADER (.wld-header-trigger)
   ======================================== */

.wld-header-trigger {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50px;
    padding: 10px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
    position: relative;
}

.wld-header-trigger:hover {
    background: #f9f9f9;
    border-color: #bbb;
}

.wld-header-trigger:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.wld-header-trigger__icon {
    width: 20px;
    height: 20px;
    stroke: #e74c3c;
    fill: #e74c3c;
}

.wld-header-trigger__count {
    background: #e74c3c;
    color: #fff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.wld-header-trigger__count[data-count="0"] {
    display: none;
}

/* ========================================
   3. POP-UP (.wld-wishlist-popup)
   ======================================== */

.wld-wishlist-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.wld-wishlist-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.wld-wishlist-popup__panel {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 1100px;
    max-height: 85vh;
    margin: 5vh auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 10000;
}

.wld-wishlist-popup__panel:focus {
    outline: none;
}

.wld-wishlist-popup__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid #eee;
}

.wld-wishlist-popup__title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.wld-wishlist-popup__close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.wld-wishlist-popup__close:hover {
    background: #f0f0f0;
}

.wld-wishlist-popup__close svg {
    width: 24px;
    height: 24px;
    stroke: #333;
}

.wld-wishlist-popup__body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

/* ========================================
   4. CARDURI (.wld-wishlist-cards & .wld-wishlist-card)
   ======================================== */

.wld-wishlist-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .wld-wishlist-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .wld-wishlist-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.wld-wishlist-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.wld-wishlist-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.wld-wishlist-card__image-wrap {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* Aspect ratio 3:2 */
    background: #f5f5f5;
    overflow: hidden;
}

.wld-wishlist-card__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wld-wishlist-card__img--placeholder {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wld-wishlist-card__img--placeholder::before {
    content: '📷';
    font-size: 48px;
    opacity: 0.3;
}

/* Buton X de ștergere - vizibil doar la hover pe card */
.wld-wishlist-card__remove {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 20;
}

.wld-wishlist-card:hover .wld-wishlist-card__remove {
    opacity: 1;
}

.wld-wishlist-card__remove:hover {
    background: rgba(231, 76, 60, 0.9);
}

.wld-wishlist-card__remove svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
}

.wld-wishlist-card__content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.wld-wishlist-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.wld-wishlist-card__location {
    margin: 0;
    font-size: 14px;
    color: #777;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wld-wishlist-card__location::before {
    content: '📍';
    font-size: 14px;
}

.wld-wishlist-card__details {
    margin: 8px 0 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.wld-wishlist-card__link {
    display: inline-block;
    margin-top: auto;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: background 0.2s ease;
}

.wld-wishlist-card__link:hover {
    background: #005a87;
}

.wld-wishlist-card__link:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ========================================
   5. STĂRI SPECIALE
   ======================================== */

.wld-wishlist-empty,
.wld-wishlist-loading,
.wld-wishlist-error {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #777;
}

.wld-wishlist-loading {
    font-style: italic;
}

.wld-wishlist-error {
    color: #e74c3c;
}

/* ========================================
   6. BODY LOCK (când pop-up este deschis)
   ======================================== */

body.wld-wishlist-popup-open {
    overflow: hidden;
}

/* ========================================
   7. RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 767px) {
    .wld-wishlist-popup__panel {
        width: 95%;
        max-height: 90vh;
        margin: 2.5vh auto;
    }
    
    .wld-wishlist-popup__head {
        padding: 20px;
    }
    
    .wld-wishlist-popup__title {
        font-size: 20px;
    }
    
    .wld-wishlist-popup__body {
        padding: 20px;
    }
    
    .wld-wishlist-card__remove {
        opacity: 1; /* Pe mobil, X-ul e vizibil mereu */
    }
}

/* ========================================
   8. ACCESSIBILITY
   ======================================== */

.wld-heart-button:focus-visible,
.wld-header-trigger:focus-visible,
.wld-wishlist-popup__close:focus-visible,
.wld-wishlist-card__link:focus-visible,
.wld-wishlist-card__remove:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Reducere mișcare pentru utilizatori cu preferințe de accesibilitate */
@media (prefers-reduced-motion: reduce) {
    .wld-heart-button,
    .wld-header-trigger,
    .wld-wishlist-card,
    .wld-wishlist-card__remove,
    .wld-wishlist-card__link,
    .wld-wishlist-popup__close {
        transition: none;
    }
}

/* ========================================
   9. STILURI INIMIOARE - CARD + HEADER
   ======================================== */

/* ===== CONTAINER GENERAL (CARD + HEADER) ===== */
.wld-heart-button,
.wld-header-trigger {
  background: transparent !important;
  padding: 5px !important;
  border: 0 !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #FF5A5F; /* pentru SVG-uri care folosesc stroke="currentColor" */
}

/* ===== DIMENSIUNI ICON ===== */
.wld-heart-button .wld-heart-button__icon,
.wld-header-trigger .wld-header-trigger__icon {
  width: 22px;
  height: 22px;
  display: inline-block;
}

/* ===== STARE IMPLICITĂ — DOAR CONTUR ===== */
.wld-heart-button .wld-heart-button__icon,
.wld-heart-button .wld-heart-button__icon * {
  fill: transparent !important;     /* override pentru fill inline */
  stroke: #FF5A5F !important;       /* culoare contur */
  stroke-width: 1.8 !important;
  transition: all .25s ease;
}

/* ===== HEADER — STARE IMPLICITĂ ===== */
.wld-header-trigger .wld-header-trigger__icon,
.wld-header-trigger .wld-header-trigger__icon * {
  fill: transparent !important;
  stroke: #FF5A5F !important;
  stroke-width: 1.8 !important;
  transition: all .25s ease;
}

/* ===== CARD — HOVER + ACTIV: UMPLERE COMPLETĂ ===== */
.wld-heart-button:hover .wld-heart-button__icon,
.wld-heart-button:hover .wld-heart-button__icon *,
.wld-heart-button.is-active .wld-heart-button__icon,
.wld-heart-button.is-active .wld-heart-button__icon * {
  fill: #FF5A5F !important;
  stroke: #FF5A5F !important;
}

/* ===== HEADER — HOVER ===== */
.wld-header-trigger:hover .wld-header-trigger__icon,
.wld-header-trigger:hover .wld-header-trigger__icon * {
  fill: #FF5A5F !important;
  stroke: #FF5A5F !important;
}

/* ===== HEADER — CÂND EXISTĂ LOCAȚII SALVATE ===== */
.wld-header-trigger.has-items .wld-header-trigger__icon,
.wld-header-trigger.has-items .wld-header-trigger__icon * {
  fill: #FF5A5F !important;
  stroke: #FF5A5F !important;
}

/* ===== CONTOR (NUMĂR LOCAȚII) ===== */
.wld-header-trigger__count {
  background: #FF5A5F;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  padding: 2px 6px;
  margin-left: 6px;
  line-height: 1;
  display: none; /* ascuns implicit */
}

/* Afișează contorul doar când există locații salvate */
.wld-header-trigger.has-items .wld-header-trigger__count {
  display: inline-block;
}

/* =========================================================
   10. FONT IMPLICIT — DM Sans
   ========================================================= */

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* Aplicăm fontul în toate componentele pluginului */
.wld-wishlist-popup,
.wld-wishlist-card,
.wld-wishlist-card *,
.wld-header-trigger,
.wld-heart-button,
.wld-heart-button *,
.wld-wishlist-popup__head,
.wld-wishlist-popup__body,
.wld-wishlist-popup__close,
.wld-wishlist-card__remove,
.wld-wishlist-card__link {
  font-family: 'DM Sans', sans-serif !important;
}

/* =========================================================
   11. BUTOANE X — ÎNCHIDERE POP-UP & ELIMINARE DESTINAȚIE
   ========================================================= */

/* Asigurăm contextul pentru poziționare */
.wld-wishlist-card {
  position: relative;
}

/* === X Pop-up Close === */
.wld-wishlist-popup__head {
  position: relative;
}

.wld-wishlist-popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF5A5F !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: none !important;
}

/* Stilizăm SVG-ul X să fie alb */
.wld-wishlist-popup__close svg {
  width: 12px !important;
  height: 12px !important;
  stroke: #ffffff !important;
  stroke-width: 2.5 !important;
  fill: none !important;
  display: block;
}

/* Fără efecte la hover/focus */
.wld-wishlist-popup__close:hover,
.wld-wishlist-popup__close:focus {
  background: #FF5A5F !important;
}

/* === X Remove Destination (Card) === */
.wld-wishlist-card__remove {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF5A5F !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: none !important;
  opacity: 1 !important; /* Mereu vizibil */
}

/* Stilizăm SVG-ul X să fie alb */
.wld-wishlist-card__remove svg {
  width: 12px !important;
  height: 12px !important;
  stroke: #ffffff !important;
  stroke-width: 2.5 !important;
  fill: none !important;
  display: block;
}

/* Fără efecte la hover/focus */
.wld-wishlist-card__remove:hover,
.wld-wishlist-card__remove:focus {
  background: #FF5A5F !important;
}

/* Override regula de hover din secțiunea anterioară */
.wld-wishlist-card:hover .wld-wishlist-card__remove {
  opacity: 1 !important;
}

/* =========================================================
   12. BUTON „VEZI DETALII" — STIL IMPLICIT
   ========================================================= */

.wld-wishlist-card__link {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid #FF5A5F;
  color: #FF5A5F;
  background: #ffffff;
  border-radius: 6px;
  padding: 10px 20px;
  transition: all 0.25s ease;
  cursor: pointer;
  margin-top: auto;
}

/* Hover: inversăm culorile */
.wld-wishlist-card__link:hover {
  background: #FF5A5F !important;
  color: #ffffff !important;
  border-color: #FF5A5F !important;
}

/* Focus state pentru accesibilitate */
.wld-wishlist-card__link:focus {
  outline: 2px solid #FF5A5F;
  outline-offset: 2px;
}

/* =========================================================
   13. BUTOANE X - 30×30px, ROTUNDE, X CENTRAT (DEFAULT)
   ========================================================= */

/* === Buton X din POP-UP === */
.wld-wishlist-popup__close {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: #FF5A5F !important;
  border: none !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
}

/* X-ul centrat în buton */
.wld-wishlist-popup__close svg {
  width: 14px !important;
  height: 14px !important;
  stroke: #ffffff !important;
  stroke-width: 2.5 !important;
  fill: none !important;
  display: block !important;
  margin: auto !important;
}

/* === Buton X din CARDURI === */
.wld-wishlist-card__remove {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: #FF5A5F !important;
  border: none !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  opacity: 1 !important;
}

/* X-ul centrat în buton */
.wld-wishlist-card__remove svg {
  width: 14px !important;
  height: 14px !important;
  stroke: #ffffff !important;
  stroke-width: 2.5 !important;
  fill: none !important;
  display: block !important;
  margin: auto !important;
}

/* =========================================================
   14. BUTON HEADER WISHLIST - DESIGN AJUSTABIL (DEFAULT)
   ========================================================= */

/* === CONTAINER BUTON === */
.wld-header-trigger {
  background: transparent !important;
  border: none !important;
  padding: 5px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  position: relative !important;
}

/* === WRAPPER ICON (pentru poziționare relativă) === */
.wld-header-trigger__icon {
  /* 🔧 AJUSTARE DIMENSIUNE INIMIOARĂ */
  /* Original: 28px → 15% mai mic = 23.8px ≈ 24px */
  width: 24px !important;
  height: 24px !important;
  display: inline-block !important;
  position: relative !important;
}

/* === INIMIOARĂ - MEREU DOAR CONTUR (stroke) ÎN AMBELE STĂRI === */
.wld-header-trigger .wld-header-trigger__icon svg,
.wld-header-trigger.has-items .wld-header-trigger__icon svg {
  width: 100% !important;
  height: 100% !important;
  fill: transparent !important; /* 🔒 MEREU transparent - NU se umple niciodată */
  stroke: #FF5A5F !important;
  stroke-width: 2 !important;
  transition: transform 0.2s ease !important;
}

/* 🔒 ASIGURARE EXPLICITĂ: inima nu se umple în stare activă */
.wld-header-trigger.has-items .wld-header-trigger__icon svg,
.wld-header-trigger.has-items .wld-header-trigger__icon svg * {
  fill: transparent !important;
  stroke: #FF5A5F !important;
}

/* === BADGE NUMERIC - ASCUNS IMPLICIT === */
.wld-header-trigger__count {
  display: none !important;
  position: absolute !important;
  
  /* 🔧 AJUSTARE POZIȚIE BADGE */
  /* Modifică aceste valori pentru a muta badge-ul:
     - bottom: distanța de la margine jos (valori mai mari = badge mai sus)
     - right: distanța de la margine dreapta (valori mai mari = badge mai la stânga)
  */
  bottom: -5px !important;
  right: -5px !important;
  
  /* 🔧 AJUSTARE DIMENSIUNE BADGE */
  /* Original: 20px → 15% mai mic = 17px */
  width: 17px !important;
  height: 17px !important;
  
  /* Stilizare badge */
  background: #FF5A5F !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  
  /* 🔧 AJUSTARE FONT SIZE BADGE */
  /* Original: 12px → 15% mai mic = 10.2px ≈ 10px */
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 17px !important; /* Trebuie să fie = height pentru centrare verticală */
  
  text-align: center !important;
  font-family: 'DM Sans', sans-serif !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
  z-index: 2 !important;
}

/* === STARE ACTIVĂ - BADGE VIZIBIL === */
.wld-header-trigger.has-items .wld-header-trigger__count {
  display: inline-block !important;
  animation: wldBadgeFadeIn 0.3s ease !important;
}

/* === HOVER === */
.wld-header-trigger:hover .wld-header-trigger__icon svg {
  transform: scale(1.08) !important;
}

.wld-header-trigger:hover .wld-header-trigger__count {
  transform: scale(1.08) !important;
}

/* === ANIMAȚIE FADE IN PENTRU BADGE === */
@keyframes wldBadgeFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* =========================================================
   📝 INSTRUCȚIUNI DE AJUSTARE MANUALĂ (prin Custom CSS)
   =========================================================
   
   🔧 1. DIMENSIUNE INIMIOARĂ:
      Modifică: width și height la .wld-header-trigger__icon
      Exemplu: width: 30px !important; (mai mare)
               width: 20px !important; (mai mic)
   
   🔧 2. DIMENSIUNE BADGE:
      Modifică: width, height și line-height la .wld-header-trigger__count
      IMPORTANT: line-height TREBUIE să fie = height pentru centrare
      Exemplu: width: 20px !important;
               height: 20px !important;
               line-height: 20px !important;
   
   🔧 3. POZIȚIE BADGE (sus/jos, stânga/dreapta):
      Modifică: bottom și right la .wld-header-trigger__count
      
      Pentru a muta badge-ul:
      - Mai JOS: scade valoarea bottom (ex: bottom: -8px)
      - Mai SUS: crește valoarea bottom (ex: bottom: 0px)
      - Mai la DREAPTA: scade valoarea right (ex: right: -8px)
      - Mai la STÂNGA: crește valoarea right (ex: right: 0px)
   
   🔧 4. MĂRIME FONT BADGE:
      Modifică: font-size la .wld-header-trigger__count
      Exemplu: font-size: 12px !important; (mai mare)
               font-size: 9px !important; (mai mic)
   
   🔧 5. GROSIME CONTUR INIMIOARĂ:
      Modifică: stroke-width la svg
      Exemplu: stroke-width: 2.5 !important; (mai gros)
               stroke-width: 1.5 !important; (mai subțire)
   
   🔧 6. CULORI:
      Modifică: #FF5A5F cu orice altă culoare
      - stroke: #FF5A5F (culoare contur inimă)
      - background: #FF5A5F (culoare badge)
      - color: #ffffff (culoare text badge)
   
   🔧 7. BUTOANE X (30×30px):
      Pentru a modifica dimensiunea butoanelor X:
      .wld-wishlist-popup__close,
      .wld-wishlist-card__remove {
        width: 35px !important;
        height: 35px !important;
      }
      
      .wld-wishlist-popup__close svg,
      .wld-wishlist-card__remove svg {
        width: 16px !important;
        height: 16px !important;
      }
   
   ========================================================= */