/* Styles for Product Popup - TioSam Scripts */
/* Usando as mesmas cores do site */
#productInfoModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    z-index: 9999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#productInfoModal.show {
    display: flex !important;
    opacity: 1;
}

.ts-popup-content {
    background-color: #2d2d2d !important; /* Cinza neutro claro */
    border-radius: 0.75rem;
    max-width: 56rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
    border: 1px solid #404040;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    font-family: 'Poppins', sans-serif;
}

.ts-popup-content::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ts-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #404040;
    background-color: #252525 !important; /* Cinza neutro escuro */
}

.ts-popup-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600;
    color: white;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.02em;
}

.ts-popup-close {
    color: #9ca3af; /* text-gray-400 */
    background: rgba(255, 255, 255, 0.05);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-popup-close:hover {
    color: white;
    background: rgba(246, 95, 0, 0.2);
    transform: rotate(90deg);
}

.ts-popup-body {
    padding: 2rem;
}

.ts-popup-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .ts-popup-grid {
        flex-direction: row;
    }
    .ts-popup-col-left {
        width: 45%; /* Expandido de 35% */
        flex-shrink: 0;
    }
    .ts-popup-col-right {
        width: 55%; /* Ajustado de 65% */
        flex-grow: 1;
    }
}

.ts-popup-image {
    width: 100%;
    max-height: 420px; /* Aumentado de 350px */
    border-radius: 0.5rem;
    display: block;
    object-fit: contain;
    background-color: #1a1a1a;
}

.ts-popup-product-name {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    font-family: 'Poppins', sans-serif;
}

.ts-popup-price-box {
    background-color: #222222 !important; /* Cinza neutro bem escuro */
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #404040;
}

.ts-popup-price-label {
    color: #d1d5db; /* text-gray-300 */
    margin: 0;
}

.ts-popup-price-value {
    color: #f97316; /* text-orange-500 */
    font-weight: 700;
    font-size: 1.2rem;
}

.ts-popup-desc-label {
    font-size: 1.125rem; /* text-lg */
    font-weight: 500;
    color: white;
    margin-bottom: 0.5rem;
    display: block;
}

.ts-popup-desc-text {
    color: #9ca3af; /* text-gray-400 */
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    white-space: pre-line; /* Preserves line breaks */
}

.ts-popup-btn {
    width: 100%;
    background-color: #f97316; /* bg-orange-500 */
    color: white;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    text-transform: uppercase;
    font-family: 'Poppins', sans-serif;
    display: block;
    text-align: center;
    text-decoration: none;
}

.ts-popup-btn:hover {
    background-color: #ea580c; /* hover:bg-orange-600 */
    color: white;
    text-decoration: none;
}

/* Video Section */
.ts-popup-video-container {
    margin-top: 1.5rem;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 0.5rem;
    background: #000;
}

.ts-popup-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Gallery Thumbnails */
.ts-popup-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.ts-popup-thumb {
    width: 80px;
    height: 80px;
    border-radius: 0.375rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background-color: #1a1a1a;
}

.ts-popup-thumb:hover {
    border-color: #f97316;
    transform: translateY(-2px);
}

.ts-popup-thumb.active {
    border-color: #f97316;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

.ts-popup-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================
   Ajustes específicos do popup
   para reutilizar layout de product.ejs
   dentro de um modal menor
   ========================= */

/* Modal mais largo para caber galeria + card lado a lado */
#productInfoModal .ts-popup-content {
    max-width: 1280px !important;
    width: 92% !important;
}

@media (min-width: 1920px) {
    #productInfoModal .ts-popup-content {
        max-width: 1350px !important;
    }
}

/* Remover margem extra do bloco de produto dentro do modal */
#productInfoModal .ts-product-area {
    margin-top: 0;
}

/* Altura um pouco menor que a página de produto para caber melhor no modal */
#productInfoModal .ts-product-area > .ts-product-main-img {
    min-height: 380px;
    max-height: 380px;
}

/* Garantir que IMG/IFRAME respeitem a altura e centralizem bem dentro do modal */
#productInfoModal .ts-product-area > .ts-product-main-img > img,
#productInfoModal .ts-product-area > .ts-product-main-img > iframe {
    min-height: 380px;
    max-height: 380px;
    width: 100%;
    object-fit: contain;
}

/* Descrição abaixo da galeria com fundo coerente ao tema */
#productInfoModal .ts-card-bordered.ts-description-product {
    background-color: var(--bg-color-dark-medium);
    border-radius: 10px;
}

/* Ajustar tamanho da fonte e leitura da descrição dentro do modal */
#productInfoModal .ts-description-product .ts-text-desc {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Dar um respiro maior entre a imagem principal e as miniaturas no popup */
#productInfoModal .ts-product-listen-imgs {
    margin-top: 18px;
}

/* Em telas pequenas, reduzir um pouco mais a altura da mídia para caber no viewport */
@media (max-width: 768px) {
  #productInfoModal .ts-product-area > .ts-product-main-img {
      min-height: 320px;
      max-height: 320px;
  }

  #productInfoModal .ts-product-area > .ts-product-main-img > img,
  #productInfoModal .ts-product-area > .ts-product-main-img > iframe {
      min-height: 320px;
      max-height: 320px;
  }
}
