/**
 * 2007-2024 PrestaShop.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License 3.0 (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:
 * https://opensource.org/licenses/AFL-3.0
 *
 * @author    Forwix <contact@forwix.com>
 * @copyright 2007-2024 Forwix
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 */

.forwix-affiliate-actions {
    margin: 0;
    display: block;
    visibility: visible;
    opacity: 1;
}

.forwix-affiliate-btn {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
}

.forwix-affiliate-btn:focus,
.forwix-affiliate-btn:active {
    outline: none;
    text-decoration: none;
}

.forwix-affiliate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.forwix-affiliate-btn i {
    vertical-align: middle;
    margin-right: 5px;
}

.forwix-affiliate-info {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.forwix-affiliate-info p {
    margin: 5px 0;
}

.forwix-marketplace-name,
.forwix-external-id,
.forwix-commission {
    font-size: 14px;
    color: #333;
}

/* Hide add to cart button and quantity input for affiliate products */
/* This works by hiding elements that are siblings or parents of the affiliate button */
.product-quantity:has(.forwix-affiliate-actions) .add,
.product-quantity:has(.forwix-affiliate-actions) .qty,
.product-add-to-cart:has(.forwix-affiliate-actions) .add,
.product-add-to-cart:has(.forwix-affiliate-actions) .qty,
.js-product-actions:has(.forwix-affiliate-actions) .add,
.js-product-actions:has(.forwix-affiliate-actions) .qty {
    display: none !important;
}

/* Fallback for browsers that don't support :has() - use sibling selector */
.forwix-affiliate-actions ~ .add,
.forwix-affiliate-actions ~ .qty {
    display: none !important;
}

/* Hide add to cart button when affiliate button is present in same container */
.product-quantity .forwix-affiliate-actions ~ .add,
.product-quantity .forwix-affiliate-actions ~ .qty {
    display: none !important;
}

/* Hide control label (Quantity) when affiliate button is present */
.product-add-to-cart:has(.forwix-affiliate-actions) .control-label {
    display: none !important;
}

