.complementary-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 15px;
    margin: 0;
}

.complementary-popup-overlay.show {
    display: flex;
}

.complementary-popup-content {
    background: #fff;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.complementary-popup-header {
    padding: 18px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: #f8f9fa;
}

.complementary-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.complementary-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.complementary-popup-close:hover {
    color: #000;
}

.complementary-popup-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.complementary-popup-body::-webkit-scrollbar {
    width: 6px;
}

.complementary-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.complementary-popup-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.complementary-popup-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.complementary-group {
    margin-bottom: 30px;
}

.complementary-group:last-child {
    margin-bottom: 0;
}

.complementary-group-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e5e5;
}

.complementary-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.complementary-product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
    height: 100%;
}

.complementary-product-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.complementary-product-item.out-of-stock {
    opacity: 0.85;
}

.complementary-product-item.out-of-stock:hover {
    border-color: #e5e5e5;
    box-shadow: none;
    transform: none;
}

.complementary-product-item.out-of-stock .complementary-product-image img {
    opacity: 0.6;
}

.complementary-product-image {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 6px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.complementary-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.complementary-out-of-stock-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
    line-height: 1.2;
}

.complementary-product-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.complementary-product-name {
    font-size: 11px;
    font-weight: 400;
    height: 50px;
    color: #666;
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.6em;
    margin-bottom: 4px;
}

.complementary-product-price {
    font-size: 10px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.complementary-product-price del {
    color: #999;
    font-size: 11px;
    margin-left: 5px;
}

.complementary-product-price ins {
    text-decoration: none;
    color: #e74c3c;
    font-weight: 700;
}

.complementary-add-to-cart-btn {
    width: 100%;
    padding: 8px 12px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.complementary-add-to-cart-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.complementary-add-to-cart-btn:active {
    transform: translateY(0);
}

.complementary-add-to-cart-btn:disabled {
    background-color: #dc3545;
    cursor: not-allowed;
    opacity: 0.8;
    color: #fff;
}

.complementary-add-to-cart-btn:disabled:hover {
    background-color: #dc3545;
    transform: none;
    box-shadow: none;
}

.complementary-popup-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
    background: #f8f9fa;
}

.complementary-continue-shopping {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
    background-color: #28a745;
    color: #fff;
}

.complementary-continue-shopping:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.complementary-popup-close-btn {
    background-color: #6c757d;
    color: #fff;
}

.complementary-popup-close-btn:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

@media (max-width: 768px) {
    .complementary-popup-overlay {
        padding: 10px;
    }
    
    .complementary-popup-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
    }
    
    .complementary-popup-header {
        padding: 15px;
    }
    
    .complementary-popup-header h3 {
        font-size: 16px;
    }
    
    .complementary-popup-body {
        padding: 15px;
    }
    
    .complementary-products-grid {
        display: block;
        gap: 12px;
    }
    
    .complementary-product-item {
        display: block;
        width: 100%;
        margin-bottom: 12px;
    }
    
    .complementary-product-item {
        padding: 10px;
    }
    
    .complementary-product-image {
        margin-bottom: 8px;
    }
    
    .complementary-product-price {
        font-size: 12px;
        min-height: 28px;
    }
    
    .complementary-add-to-cart-btn {
        padding: 7px 10px;
        font-size: 11px;
    }
    
    .complementary-popup-footer {
        padding: 12px 15px;
        flex-direction: column;
        gap: 8px;
    }
    
    .complementary-continue-shopping,
    .complementary-popup-close-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .complementary-popup-body {
        padding: 12px;
    }
    
    .complementary-products-grid {
        display: block;
        gap: 10px;
    }
    
    .complementary-product-item {
        display: block;
        width: 100%;
        padding: 8px;
        margin-bottom: 10px;
    }
}

