/**
 * Public CSS
 *
 * @package CanhcamPromotion_Product_Promotion
 * @since 1.0.0
 */

/* ===== Price Display ===== */
.ccppp-price-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ccppp-regular-price {
    color: #6b7280;
    font-size: 0.9em;
}

.ccppp-sale-price {
    color: #dc2626;
    font-weight: 600;
    font-size: 1.1em;
    text-decoration: none;
}

.ccppp-discount-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
}

/* ===== Gift Info ===== */
.ccppp-gift-info {
    margin-top: 20px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.ccppp-gift-info.ccppp-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.ccppp-gift-info.ccppp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #dc2626;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ccppp-spin 0.6s linear infinite;
}

@keyframes ccppp-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.ccppp-gift-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ccppp-gift-header strong {
    color: #171717;
    font-size: 14px;
}

.ccppp-gift-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.ccppp-gift-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #fff;
}

/* Discount Gift Icon */
.ccppp-gift-discount .ccppp-gift-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef3c7;
    border: 1px solid #fde047;
    border-radius: 4px;
    flex-shrink: 0;
}

.ccppp-gift-discount .ccppp-gift-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #92400e;
}

.ccppp-gift-discount .ccppp-gift-discount-amount {
    color: #dc2626;
    font-weight: 600;
    font-size: 0.95em;
}

.ccppp-gift-item {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.ccppp-gift-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.ccppp-gift-details {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ccppp-gift-name {
    color: #171717;
    font-size: 13px;
    font-weight: 500;
}

.ccppp-gift-quantity {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

/* ===== Gift Badge in Cart/Order ===== */
.ccppp-gift-badge {
    display: inline-block;
    background: #10b981;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
    vertical-align: middle;
}

/* ===== Gift Info in Cart ===== */
.ccppp-cart-gift-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0fdf4;
    border-left: 3px solid #10b981;
    border-radius: 4px;
}

.ccppp-gift-item-cart {
    font-size: 13px;
    color: #166534;
    line-height: 1.6;
}

.ccppp-gift-label {
    font-weight: 600;
    color: #10b981;
}

.ccppp-gift-name {
    font-weight: 500;
    color: #166534;
}

.ccppp-gift-qty {
    color: #059669;
    font-weight: 600;
}

.ccppp-campaign-name {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* Hide gift items from cart display */
.ccppp-hidden-gift-item {
    display: none !important;
}

/* ===== Gift Radio Button ===== */
.ccppp-gift-radio-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    cursor: pointer;
}

.ccppp-gift-radio {
    margin: 0 !important;
    cursor: pointer;
}

.ccppp-gift-item:has(.ccppp-gift-radio-wrapper) {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ccppp-gift-item:has(.ccppp-gift-radio-wrapper):hover {
    background-color: #f3f4f6;
}

/* ===== Additional Benefits ===== */
.ccppp-additional-benefits {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
}

.ccppp-benefits-header {
    margin-bottom: 12px;
}

.ccppp-benefits-header strong {
    color: #171717;
    font-size: 14px;
}

.ccppp-benefits-content {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
}

.ccppp-benefits-content p {
    margin: 0 0 12px 0;
}

.ccppp-benefits-content p:last-child {
    margin-bottom: 0;
}

.ccppp-benefits-content ul,
.ccppp-benefits-content ol {
    margin: 0 0 12px 0;
    padding-left: 24px;
}

.ccppp-benefits-content li {
    margin-bottom: 6px;
}

.ccppp-benefits-content strong {
    font-weight: 600;
    color: #171717;
}

.ccppp-benefits-content a {
    color: #2563eb;
    text-decoration: none;
}

.ccppp-benefits-content a:hover {
    text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .ccppp-price-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .ccppp-gift-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

