/* ============================================
   СТИЛИ ДЛЯ ПОПАПА ТОВАРОВ
   ============================================ */

/* ----- Оверлей (СКРЫТ ПО УМОЛЧАНИЮ) ----- */
#productPopup {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    overflow-y: auto;
    padding: 20px;
    cursor: pointer;
}

/* ----- Оверлей КОГДА ОТКРЫТ (центрируем) ----- */
#productPopup.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.popup_button {
    margin-top: 15px;
    padding: 15px;
    background: #E53935;
    color: #ffffff !important;
    text-decoration: none !important;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-sizing: border-box;
    width: 80%;
}

.popup_button:hover {
    background-color: #000;
    color: white;
    border: 1px solid red;
}

/* ----- Контент попапа (БЕЗ ПАДДИНГОВ) ----- */
#productPopup .product-popup-content {
    background: #ffffff;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 0; /* ⚠️ Убрали все паддинги */
    position: relative;
    cursor: default;
    margin: 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ----- Кнопка закрытия (поверх картинки) ----- */
.close-popup {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s;
    line-height: 1;
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.close-popup:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

/* ============================================
   ИЗОБРАЖЕНИЕ (ВО ВСЮ ШИРИНУ, БЕЗ ОТСТУПОВ)
   ============================================ */

.popup-product-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px 12px 0 0;
    margin: 0;
    padding: 0;
}

/* ============================================
   КОНТЕНТ ПОСЛЕ КАРТИНКИ (БЕЛЫЙ ФОН)
   ============================================ */

.popup-product-title {
    font-size: 26px;
    margin: 0;
    color: #222;
    clear: both;
    padding: 20px 30px 5px 30px;
}

.popup-product-price {
    font-size: 25px;
    font-weight: bold;
    color: #e67e22;
    margin: 0;
    padding: 0 30px 15px 30px;
}

.popup-product-description {
    font-size: 22px;
    line-height: 1.6;
    color: #555;
    margin: 0;
    padding: 0 30px 20px 30px;
}

.popup-product-description p {
    margin: 0 0 10px 0;
}

.popup-product-description p:last-child {
    margin-bottom: 0;
}

/* ----- Кнопка "В корзину" ----- */
.popup-product-actions {
    text-align: center;
    padding: 15px 30px 30px 30px;
    border-top: 1px solid #eee;
}

/* ----- Лоадер ----- */
.popup-loader-wrapper {
    text-align: center;
    padding: 40px 20px;
}

.popup-loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   КНОПКА "ПОКАЗАТЬ ВСЕ" (для товаров)
   ============================================ */

.toggle-products-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 20px 0;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    color: #333;
}

.toggle-products-btn:hover {
    background: #e8e8e8;
}

/* ============================================
   АДАПТИВ
   ============================================ */

@media (max-width: 768px) {
    #productPopup .product-popup-content {
        max-width: 95%;
        margin: 20px;
    }
    
    .popup-product-title {
        font-size: 26px;
        padding: 15px 20px 5px 20px;
    }
    
    .popup-product-price {
        font-size: 25px;
        padding: 0 20px 10px 20px;
    }
    
    .popup-product-description {
        font-size: 22px;
        padding: 0 20px 15px 20px;
    }
    
    .popup-product-actions {
        padding: 15px 20px 20px 20px;
    }
    
    .close-popup {
        top: 12px;
        right: 15px;
        width: 38px;
        height: 38px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    #productPopup {
        padding: 10px;
    }
    
    #productPopup .product-popup-content {
        max-width: 100%;
        margin: 10px;
        border-radius: 8px;
    }
    
    .popup-product-title {
        font-size: 20px;
        padding: 12px 15px 5px 15px;
    }
    
    .popup-product-price {
        font-size: 19px;
        padding: 0 15px 10px 15px;
    }
    
    .popup-product-description {
        font-size: 16px;
        padding: 0 15px 12px 15px;
    }
    
    .popup-product-actions {
        padding: 12px 15px 15px 15px;
    }
    
    .close-popup {
        top: 10px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}