/**
 * 2007-2023 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2023 PrestaShop SA
 * @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 */

/* Overlay */
.psx-es-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050; /* Above PrestaShop's typical z-index for modals */
    overflow-y: auto; /* Allow scrolling for long content */
}

/* Modal Content */
.psx-es-modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    position: relative;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.3s ease-out;
}

/* Close Button */
.psx-es-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0;
}
.psx-es-modal-close:hover {
    color: #333;
}

/* Modal Header */
.psx-es-modal-title {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: #333;
    text-align: center;
}

/* Modal Body - Offer List */
.psx-es-modal-body {
    max-height: 70vh; /* Max height to allow scrolling if many offers */
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 15px; /* For scrollbar space */
}

#psx-es-offer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.psx-es-offer-item {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}
.psx-es-offer-item:last-child {
    border-bottom: none;
}

.psx-es-offer-details {
    flex-grow: 1;
    margin-bottom: 0.8rem;
}

.psx-es-offer-title {
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
    color: #007bff; /* Primary color */
}

.psx-es-offer-description {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.psx-es-offer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem; /* Space between price and button */
}

.psx-es-offer-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #28a745; /* Success color */
}

.psx-es-add-service-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 5px;
}

/* Modal Footer */
.psx-es-modal-footer {
    text-align: right;
    padding-top: 1rem;
}

.psx-es-modal-close-btn {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    border-radius: 5px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .psx-es-modal-content {
        padding: 1rem;
        width: 95%;
    }
    .psx-es-modal-title {
        font-size: 1.5rem;
    }
    .psx-es-offer-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .psx-es-offer-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.5rem;
    }
    .psx-es-add-service-btn {
        width: 100%;
    }
}

/* Body class for preventing scroll when modal is open */
body.psx-es-modal-open {
    overflow: hidden;
    padding-right: 15px; /* Adjust for scrollbar width */
}

/* PDP Offer Block */
.psx-es-product-offer {
    border: 1px dashed #dbe0e3;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}
.psx-es-product-offer .h6 {
    color: #007bff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.psx-es-product-offer .material-icons {
    font-size: 1.5rem;
}
.psx-es-product-offer ul {
    margin-top: 10px;
    margin-bottom: 5px;
}
.psx-es-product-offer li {
    padding: 3px 0;
}
.psx-es-product-offer a {
    color: #007bff;
    text-decoration: none;
}
.psx-es-product-offer a:hover {
    text-decoration: underline;
}
.psx-es-product-offer small {
    display: block;
    margin-top: 10px;
    color: #777;
}

/* Cart Upsell Block */
.psx-es-cart-upsell-block .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}
.psx-es-cart-upsell-block .card-title {
    margin-bottom: 0;
    font-size: 1.25rem;
    color: #333;
}
.psx-es-cart-upsell-block .media {
    align-items: center;
}
.psx-es-cart-upsell-block .media-body {
    padding-left: 1rem;
}
.psx-es-cart-upsell-block .media-body h6 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}
.psx-es-cart-upsell-block .media-body p {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.psx-es-cart-upsell-block .price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #28a745;
}
.psx-es-cart-upsell-block .btn {
    min-width: 120px;
}