/* Estilos mejorados para el popup */
.product-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: relative;
    background-color: #2e7d32; /* Verde principal de Greenwoods */
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: popupFadeIn 0.3s ease-out;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #F5F5FA;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.media-container {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.main-media {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.imagen-producto-popup {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.3s;
    opacity: 1;
}

.imagen-producto-popup.hidden {
    opacity: 0;
    position: absolute;
}

.media-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #FFC107 transparent;
}

.media-thumbnails::-webkit-scrollbar {
    height: 5px;
}

.media-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.media-thumbnails::-webkit-scrollbar-thumb {
    background-color: #FFC107;
    border-radius: 10px;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail.active-thumbnail {
    border-color: #FFC107;
    transform: scale(1.05);
}

.media-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

.media-container:hover .media-nav {
    opacity: 1;
}

.prev-media {
    left: 15px;
}

.next-media {
    right: 15px;
}

.content {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #F5F5FA;
    gap: 12px;
}

#popup-title {
    font-size: 28px;
    margin-bottom: 0;
    color: #F5F5FA;
    font-weight: 600;
    line-height: 1.2;
}

.product-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: rgba(245, 245, 250, 0.7);
    margin-bottom: 8px;
}

.product-rating {
    color: #FFC107;
}

#popup-description {
    font-size: 16px;
    line-height: 1.6;
    margin: 8px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    max-height: 120px;
    overflow-y: auto;
    flex-shrink: 0;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 8px 0;
}

.precio-producto-popup {
    font-size: 28px;
    font-weight: bold;
    color: #FFC107;
}

.discount-price {
    font-size: 18px;
    color: rgba(245, 245, 250, 0.7);
    text-decoration: line-through;
}

.contador-personalizado-popup {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px;
    width: fit-content;
}

.input-cantidad-popup {
    width: 50px;
    text-align: center;
    padding: 8px;
    border: none;
    background: transparent;
    color: #F5F5FA;
    font-size: 18px;
    font-weight: bold;
}

.btn-reducir-popup, 
.btn-aumentar-popup {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #F5F5FA;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-reducir-popup:hover, 
.btn-aumentar-popup:hover {
    background: rgba(255, 255, 255, 0.2);
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-carrito-popup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    background-color: #FFC107;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    flex: 1;
}

.btn-carrito-popup:hover {
    background-color: #ffd54f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.btn-carrito-popup svg {
    width: 20px;
    height: 20px;
}

.product-details {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.detail-label {
    color: rgba(245, 245, 250, 0.7);
}

.detail-value {
    font-weight: 500;
}

/* Estilos para móvil */
@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        padding: 15px;
        max-height: 85vh;
    }
    
    .detail {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .main-media {
        height: 300px;
    }
    
    .media-nav {
        opacity: 1;
        width: 35px;
        height: 35px;
    }
    
    #popup-title {
        font-size: 24px;
    }
    
    .precio-producto-popup {
        font-size: 24px;
    }
    
    .buttons {
        flex-direction: column;
    }
    
    .btn-carrito-popup {
        width: 100%;
    }
}

/* Efecto de swipe para móviles */
@media (hover: none) {
    .media-nav {
        opacity: 1;
        background: rgba(0, 0, 0, 0.7);
    }
}

.popup-content .content .des {
    margin: 15px 0;
    line-height: 1.6;
    white-space: pre-line;
    overflow-y: auto;
    max-height: 200px;
}