/**
 * Get1Buy1 - Buy 1 Get 1 Free Promotion Styles
 */

/* Badge Styles */
.get1buy1-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 10;
    position: relative;
    animation: get1buy1-pulse 2s ease-in-out infinite;
}

.get1buy1-badge-single {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.get1buy1-badge-loop {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    font-size: 11px;
    padding: 6px 12px;
}

.get1buy1-icon {
    font-size: 16px;
    line-height: 1;
}

.get1buy1-text {
    line-height: 1;
}

/* Pulse Animation */
@keyframes get1buy1-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    }
}

/* Quantity Input Styles */
.get1buy1-quantity {
    position: relative;
}

.get1buy1-quantity::after {
    content: "B1G1";
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 10px;
    color: #667eea;
    font-weight: 600;
    text-transform: uppercase;
}

.get1buy1-quantity input.qty {
    border-color: #667eea !important;
    box-shadow: 0 0 0 1px rgba(102, 126, 234, 0.2) !important;
}

.get1buy1-quantity input.qty:focus {
    border-color: #764ba2 !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3) !important;
}

/* Cart Badge Styles */
.get1buy1-cart-badge {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.4;
}

.get1buy1-cart-badge .b1g1-paid {
    color: #333;
    font-weight: 500;
}

.get1buy1-cart-badge .b1g1-free {
    color: #28a745;
    font-weight: 600;
}

/* Price Display Styles */
.get1buy1-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.get1buy1-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9em;
    font-weight: normal;
}

.get1buy1-discounted-price {
    color: #e74c3c;
    font-weight: 600;
    font-size: 1.1em;
}

.get1buy1-subtotal {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.get1buy1-original-total {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85em;
    font-weight: normal;
}

.get1buy1-discounted-total {
    color: #e74c3c;
    font-weight: 600;
    font-size: 1.05em;
}

/* Cart table price styling */
.woocommerce-cart .cart_item .get1buy1-price,
.woocommerce-cart .cart_item .get1buy1-subtotal {
    line-height: 1.4;
}

.woocommerce-cart .cart_item td.product-price .get1buy1-price {
    text-align: left;
}

.woocommerce-cart .cart_item td.product-subtotal .get1buy1-subtotal {
    text-align: right;
}

/* Notification Styles */
.get1buy1-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ffffff;
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-width: 350px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.get1buy1-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.get1buy1-notification-success {
    border-left-color: #28a745;
}

.get1buy1-notification-success::before {
    content: "✓ ";
    color: #28a745;
    font-weight: bold;
    margin-right: 5px;
}

.get1buy1-notification-info {
    border-left-color: #667eea;
}

.get1buy1-notification-info::before {
    content: "ℹ ";
    color: #667eea;
    font-weight: bold;
    margin-right: 5px;
}

/* Product Page Enhancements */
.single-product .get1buy1-badge {
    margin-bottom: 15px;
}

/* Shop Loop Enhancements */
.woocommerce ul.products li.product {
    position: relative;
}

.woocommerce ul.products li.product .get1buy1-badge-loop {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Cart Table Enhancements */
.woocommerce-cart .cart_item .get1buy1-cart-badge {
    margin-top: 8px;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    display: inline-block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .get1buy1-badge-single {
        position: relative;
        top: auto;
        right: auto;
        display: inline-block;
        margin-bottom: 15px;
    }
    
    .get1buy1-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .get1buy1-notification.show {
        transform: translateY(0);
    }
}

/* Admin Product Edit Page */
.woocommerce_options_panel .get1buy1-field {
    padding: 10px 0;
}

.woocommerce_options_panel .get1buy1-field label {
    font-weight: 600;
    color: #23282d;
}

.woocommerce_options_panel .get1buy1-field .description {
    margin-top: 5px;
    font-style: italic;
    color: #666;
}

/* Hover Effects */
.get1buy1-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
    transition: all 0.3s ease;
}

/* Loading State */
.get1buy1-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Accessibility */
.get1buy1-badge:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Info Box on Product Page */
.get1buy1-info-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.get1buy1-info-text {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.get1buy1-info-text strong {
    color: #667eea;
    font-size: 16px;
}

/* Checkout Price Display */
.get1buy1-checkout-price {
    margin-top: 5px;
    font-size: 0.9em;
}

.get1buy1-checkout-price del {
    color: #999;
    margin-right: 5px;
}

.get1buy1-checkout-price ins {
    color: #e74c3c;
    font-weight: 600;
    text-decoration: none;
}

/* Print Styles */
@media print {
    .get1buy1-badge,
    .get1buy1-cart-badge,
    .get1buy1-notification,
    .get1buy1-info-box {
        display: none;
    }
}

