/* ================================================================
   CARD-POPUP.CSS - Layout Profissional Marketplace (ATUALIZADO)
   ================================================================ */

   :root {
    --popup-backdrop: rgba(0, 0, 0, 0.8);
    --popup-bg: #ffffff;
    --popup-radius: 16px;
    --accent-color: #2563eb;
    --text-main: #1a1a1a;
    --text-secondary: #6b7280;
  }
  
  /* Fundo Escuro (Backdrop) */
  #product-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--popup-backdrop);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px) saturate(180%);
    -webkit-backdrop-filter: blur(8px) saturate(180%);
  }
  
  #product-popup.visible {
    display: flex;
    opacity: 1;
  }
  
  /* O Cartão do Popup */
  .popup-content-card {
    background: var(--popup-bg);
    width: min(90vw, 850px);
    max-height: 90vh;
    border-radius: var(--popup-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
  }
  
  #product-popup.visible .popup-content-card {
    transform: scale(1);
  }
  
  /* Layout Desktop (Lado a Lado) */
  @media (min-width: 768px) {
    .popup-content-card {
      flex-direction: row;
      min-height: 450px;
      max-height: 80vh; /* Ajuste para desktop */
    }
  }
  
  /* --- COLUNA ESQUERDA: IMAGEM --- */
  .popup-image-container {
    position: relative;
    flex: 1;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 300px;
    overflow: hidden;
  }
  
  .popup-img {
    max-width: 70vh;
    max-height: 350px;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.3s ease;
  }
  
  .popup-image-container:hover .popup-img {
    transform: scale(1.05);
  }
  
  /* Botão Fechar */
  .close-popup-card {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 30;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
  }
  
  .close-popup-card:hover {
    transform: scale(1.1);
    background: white;
  }
  
  /* Botão Favorito no Popup */
  .favorite-btn.pos-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 30;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
  }
  
  .favorite-btn.pos-popup:hover {
    background: white;
    transform: scale(1.1);
  }
  
  .favorite-btn.pos-popup svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
  }
  
  .favorite-btn.pos-popup.favorited svg {
    fill: #ef4444;
    stroke: #ef4444;
  }
  
  /* Selo da Plataforma */
  .platform-badge {
    position: absolute;
    top: 15px;
    left: 60px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 25;
  }
  
  .platform-ml { background-color: #ffe600; color: #2d3277; }
  .platform-amz { background-color: #232f3e; }
  .platform-sh { background-color: #ee4d2d; }
  
  /* --- COLUNA DIREITA: DETALHES --- */
  .popup-details {
    flex: 1.2;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    overflow-y: auto;
    max-height: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Título com Limitação de Linhas */
  .popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    margin: 0;
    padding: 0;
    
    /* Limita a 3 linhas com ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    
    /* Garante altura mínima */
    min-height: calc(1.4em * 3);
  }
  
  /* Seção de Preço */
  .price-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin: 10px 0;
  }
  
  .price-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 5px;
  }
  
  .price-installments {
    font-size: 1rem;
    color: #10b981;
    font-weight: 600;
  }
  
  /* Botão Comprar */
  .buy-button-pop {
    margin-top: 0;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    text-decoration: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    text-align: center;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
    display: block;
    cursor: pointer;
  }
  
  .buy-button-pop:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -1px rgba(37, 99, 235, 0.3);
    color: white;
  }
  
  /* Disclaimer */
  .popup-disclaimer {
    font-size: 0.75rem;
    color: #000;
    text-align: center;
    margin-top: 10px;
    line-height: 1.4;
    padding: 0 10px;
  }

  .popup-disclaimer strong {
    color: #000;
  }
  
  /* --- SCROLLBAR PERSONALIZADA --- */
  .popup-details::-webkit-scrollbar {
    width: 6px;
  }
  
  .popup-details::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }
  
  .popup-details::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
  }
  
  .popup-details::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
  }
  
  /* --- RESPONSIVIDADE --- */
  
@media (max-height: 600px) {
  .popup-content-card {
    max-height: 95vh;
  }
  
  .popup-image-container {
    min-height: 200px !important;
  }
  
  .popup-details {
    max-height: calc(95vh - 200px) !important;
  }
}

/* Suporte para modo retrato em mobile */
@media (orientation: portrait) and (max-width: 768px) {
  .popup-content-card {
    flex-direction: column;
    width: 95vw;
    max-height: 90vh;
  }
  
  .popup-image-container {
    flex: none;
    height: 40vh;
    min-height: 40vh !important;
  }
  
  .popup-details {
    flex: 1;
    max-height: 50vh !important;
  }
}

/* Suporte para modo paisagem em mobile */
@media (orientation: landscape) and (max-height: 600px) {
  .popup-content-card {
    flex-direction: row;
    max-height: 95vh;
  }
  
  .popup-image-container {
    flex: 1;
    min-height: auto !important;
    max-height: 95vh;
  }
  
  .popup-details {
    flex: 1;
    max-height: 95vh !important;
  }
}

  @media (max-width: 767px) {
    .popup-content-card {
      width: 95vw;
      max-height: 85vh;
    }
    
    .popup-details {
      padding: 20px;
      gap: 12px;
    }
    
    .popup-title {
      font-size: 1.25rem;
      -webkit-line-clamp: 2;
      min-height: calc(1.4em * 2);
    }
    
    .price-amount {
      font-size: 1.75rem;
    }
    
    .price-section {
      padding: 15px;
    }
    
    .buy-button-pop {
      padding: 14px 20px;
      font-size: 1rem;
    }
  }
  
  /* --- ANIMAÇÃO DE ENTRADA --- */
  @keyframes popupSlideIn {
    from {
      opacity: 0;
      transform: translateY(20px) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
  
  #product-popup.visible .popup-content-card {
    animation: popupSlideIn 0.3s ease-out;
  }
  
  /* --- TOAST NOTIFICATION --- */
  .toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .toast-notification.visible {
    transform: translateX(0);
  }
  
  .toast-notification.error {
    background: #ef4444;
  }
  
  .toast-notification.warning {
    background: #f59e0b;
  }