/**
 * Public CSS - Promotion Products Display
 *
 * @package CanhcamPromotion_Order_Value
 * @since 1.0.0
 */

/* ===== Promotion Section ===== */
.ccpov-promotion-section {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
    margin: 30px 0;
}

.ccpov-promotion-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f3f4f6;
}

.ccpov-promotion-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #171717;
}

.ccpov-cart-total {
    margin: 0;
    font-size: 14px;
    color: #737373;
}

.ccpov-cart-total strong {
    color: #171717;
    font-weight: 600;
}

/* ===== Threshold Group ===== */
.ccpov-threshold-group {
    margin-bottom: 24px;
    padding: 20px;
    background: #f9fafb;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ccpov-threshold-group.qualified {
    border-color: #10b981;
    background: #f0fdf4;
}

.ccpov-threshold-group.not-qualified {
    opacity: 0.7;
}

.ccpov-threshold-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ccpov-threshold-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #171717;
}

.ccpov-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.ccpov-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ccpov-badge-success {
    background: #10b981;
    color: #fff;
}

.ccpov-badge-warning {
    background: #f59e0b;
    color: #fff;
}

.ccpov-remaining {
    margin: 0;
    font-size: 13px;
    color: #f59e0b;
    font-weight: 500;
}

/* ===== Products Grid ===== */
.ccpov-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

@media (max-width: 768px) {
    .ccpov-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}

/* ===== Product Card ===== */
.ccpov-product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ccpov-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ccpov-product-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.ccpov-product-image {
    position: relative;
    overflow: hidden;
    background: #f9fafb;
}

.ccpov-product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.ccpov-product-card:hover .ccpov-product-image img {
    transform: scale(1.05);
}

.ccpov-discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dc2626;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    z-index: 1;
}

.ccpov-product-info {
    padding: 12px;
}

.ccpov-product-name {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.ccpov-product-name a {
    color: #171717;
    text-decoration: none;
    transition: color 0.2s;
}

.ccpov-product-name a:hover {
    color: #0073aa;
}

.ccpov-product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ccpov-regular-price {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
}

.ccpov-sale-price {
    font-size: 16px;
    font-weight: 700;
    color: #dc2626;
}

.ccpov-max-qty {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: #737373;
}

/* ===== Add to Cart Button ===== */
.ccpov-add-to-cart-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: #171717;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ccpov-add-to-cart-btn:hover:not(:disabled) {
    background: #404040;
    transform: translateY(-1px);
}

.ccpov-add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ccpov-add-to-cart-btn.added {
    background: #10b981;
}

.ccpov-add-to-cart-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ccpov-add-to-cart-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ===== Loading Spinner ===== */
.ccpov-add-to-cart-btn.loading .dashicons {
    animation: ccpov-spin 1s linear infinite;
}

@keyframes ccpov-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .ccpov-promotion-section {
        padding: 16px;
        margin: 20px 0;
    }
    
    .ccpov-promotion-header h3 {
        font-size: 18px;
    }
    
    .ccpov-threshold-group {
        padding: 16px;
    }
    
    .ccpov-threshold-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ccpov-product-card {
        font-size: 13px;
    }
    
    .ccpov-product-info {
        padding: 10px;
    }
}

