/* Sidebar single-tile rotator constraints */
.checkout-suggestions-sidebar .suggestion-products,
.checkout-suggestions-sidebar .suggestion-products-inline {
  position: relative;
}
.checkout-suggestions-sidebar .suggestion-product,
.checkout-suggestions-sidebar .suggestion-product-inline {
  width: 100%;
}
/**
 * Product Suggestor CSS
 * 
 * @package css
 * @copyright Copyright 2024
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version 1.0.0
 */

/* Popup Styles */
.product-suggestion-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
}

.suggestion-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    z-index: 99999;
}

.suggestion-content {
    position: relative;
    background: #fff;
    margin: 5% auto;
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
    z-index: 99999;
}

.suggestion-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.4em;
    font-weight: 600;
    line-height: 1.4;
}

.suggestion-header h3 .suggestion-sale-name {
    display: inline-block;
}

.suggestion-sale-link {
    color: #006edf;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    padding: 0 2px;
}

.suggestion-sale-link:hover {
    color: #0056c7;
    border-bottom-color: #0056c7;
}

.suggestion-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestion-close:hover {
    color: #333;
}

.suggestion-products {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.suggestion-product {
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    transition: all 0.2s ease;
    background: #fff;
}

.suggestion-product:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
    transform: translateY(-2px);
}

.suggestion-product .product-image {
    margin-bottom: 8px;
}

.suggestion-product .product-image img {
    max-width: 100%;
    max-height: 120px;
    height: auto;
    border-radius: 3px;
    object-fit: contain;
}

.suggestion-product .product-info h4 {
    margin: 0 0 6px 0;
    font-size: 0.9em;
    color: #333;
    line-height: 1.2;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.4em;
}

.suggestion-product .product-info h4 a {
    color: #333;
    text-decoration: none;
}

.suggestion-product .product-info h4 a:hover {
    color: #006edf;
}

.suggestion-product .product-price {
    font-weight: 600;
    color: #e74c3c;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.add-to-cart-btn {
    background: #006edf;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
    width: 100%;
    font-weight: 500;
}

.add-to-cart-btn:hover {
    background: #0056c7;
}

.suggestion-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.suggestion-close-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.suggestion-close-btn:hover {
    background: #7f8c8d;
}

/* Inline Styles */
.product-suggestion-inline {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.product-suggestion-inline h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.4em;
}

.suggestion-products-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.suggestion-product-inline {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: box-shadow 0.3s ease;
}

.suggestion-product-inline:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.suggestion-product-inline .product-image {
    flex-shrink: 0;
    width: 80px;
}

.suggestion-product-inline .product-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.suggestion-product-inline .product-info {
    flex: 1;
}

.suggestion-product-inline .product-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    color: #333;
}

.suggestion-product-inline .product-price {
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 10px;
}

.suggestion-product-inline .add-to-cart-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
}

/* Sidebar Styles */
.product-suggestion-sidebar {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.product-suggestion-sidebar h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
}

.suggestion-products-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.suggestion-product-sidebar {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: box-shadow 0.3s ease;
}

.suggestion-product-sidebar:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.suggestion-product-sidebar .product-image {
    flex-shrink: 0;
    width: 60px;
}

.suggestion-product-sidebar .product-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.suggestion-product-sidebar .product-info {
    flex: 1;
}

.suggestion-product-sidebar .product-info h4 {
    margin: 0 0 6px 0;
    font-size: 1em;
    color: #333;
    line-height: 1.3;
}

.suggestion-product-sidebar .product-price {
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.suggestion-product-sidebar .add-to-cart-btn {
    width: auto;
    padding: 6px 12px;
    font-size: 12px;
}

/* Message Styles */
.suggestion-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.suggestion-message.alert-success {
    background: #27ae60;
}

.suggestion-message.alert-error {
    background: #e74c3c;
}

/* Body class for popup open */
body.suggestion-popup-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .suggestion-content {
        margin: 2% auto;
        width: 95%;
    }
    
    .suggestion-products {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .suggestion-products-inline {
        grid-template-columns: 1fr;
    }
    
    .suggestion-product-inline {
        flex-direction: column;
        text-align: center;
    }
    
    .suggestion-product-inline .product-image {
        width: 120px;
    }
    
    .suggestion-product-sidebar .product-info h4 {
        font-size: 0.9em;
    }
    
    .suggestion-message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .suggestion-header {
        padding: 15px;
    }
    
    .suggestion-header h3 {
        font-size: 1.3em;
    }
    
    .suggestion-products {
        padding: 15px;
    }
    
    .suggestion-product {
        padding: 12px;
    }
    
    .suggestion-footer {
        padding: 15px;
    }
}
