/**
 * BOGO Frontend Styles
 *
 * @package Dynamic_BOGO
 */

/* CSS Variables */
:root {
    --bogo-primary-color: #7c3aed;
    --bogo-success-color: #10b981;
    --bogo-info-color: #3b82f6;
    --bogo-promo-color: #f59e0b;
    --bogo-text-color: #000000;
}

/* ================================
   Product Page Notification
   ================================ */
.bogo-product-notification {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    animation: bogo-pulse 2s infinite;
}

.bogo-product-notification .bogo-icon {
    font-size: 20px;
}

.bogo-product-notification .bogo-text {
    flex: 1;
    color: var(--bogo-text-color);
}

@keyframes bogo-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

/* ================================
   Shop Loop Notification
   ================================ */
.bogo-loop-notification {
    margin-top: 10px;
    text-align: center;
}

.bogo-loop-notification .bogo-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    animation: bogo-shake 0.5s ease-in-out infinite alternate;
}

@keyframes bogo-shake {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

/* ================================
   Cart Notices
   ================================ */
.bogo-cart-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
}

.bogo-cart-notice .bogo-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.bogo-cart-notice .bogo-message {
    flex: 1;
}

/* Success Notice - Offer Applied */
.bogo-cart-notice.bogo-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    color: #166534;
}

/* Info Notice - Add Another Item */
.bogo-cart-notice.bogo-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    color: #1e40af;
}

/* Promo Notice - Buy Above Threshold */
.bogo-cart-notice.bogo-promo {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    color: #92400e;
}

/* ================================
   Checkout Notice
   ================================ */
.bogo-checkout-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 2px solid #c084fc;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    color: #6b21a8;
}

.bogo-checkout-notice .bogo-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.bogo-checkout-notice .bogo-message {
    flex: 1;
}

/* ================================
   Cart Price Display
   ================================ */
.bogo-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.bogo-original-price {
    color: #9ca3af;
    font-size: 0.9em;
}

.bogo-free-price {
    color: #10b981;
    font-weight: 700;
    font-size: 1.1em;
}

.bogo-free-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin-left: 6px;
}

/* ================================
   Cart Subtotal Display
   ================================ */
.bogo-subtotal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.bogo-original-subtotal {
    color: #9ca3af;
    font-size: 0.85em;
}

.bogo-free-subtotal {
    color: #10b981;
    font-weight: 700;
    font-size: 1.1em;
}

.bogo-partial-subtotal {
    font-weight: 600;
}

.bogo-qty-note {
    color: #10b981;
    font-style: italic;
}

/* ================================
   Mini Cart Badge
   ================================ */
.bogo-mini-cart-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #10b981;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ================================
   Cart Fee Display
   ================================ */
.cart-discount .bogo-discount-label,
.fee .bogo-discount-label {
    color: #10b981;
    font-weight: 600;
}

/* ================================
   Animations
   ================================ */
@keyframes bogo-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bogo-cart-notice,
.bogo-checkout-notice,
.bogo-product-notification {
    animation: bogo-fade-in 0.3s ease-out;
}

/* ================================
   Responsive Adjustments
   ================================ */
@media screen and (max-width: 768px) {
    .bogo-product-notification {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .bogo-cart-notice,
    .bogo-checkout-notice {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .bogo-price-wrapper,
    .bogo-subtotal-wrapper {
        align-items: center;
    }
}

/* ================================
   WooCommerce Theme Compatibility
   ================================ */
.woocommerce .bogo-product-notification,
.woocommerce-page .bogo-product-notification {
    clear: both;
}

.woocommerce table.shop_table .bogo-price-wrapper,
.woocommerce-page table.shop_table .bogo-price-wrapper {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.woocommerce table.shop_table .bogo-subtotal-wrapper,
.woocommerce-page table.shop_table .bogo-subtotal-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bogo-cart-notice.bogo-success {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
        border-color: #059669;
        color: #a7f3d0;
    }
    
    .bogo-cart-notice.bogo-info {
        background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
        border-color: #3b82f6;
        color: #bfdbfe;
    }
    
    .bogo-cart-notice.bogo-promo {
        background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
        border-color: #d97706;
        color: #fde68a;
    }
}

/* Print Styles */
@media print {
    .bogo-cart-notice,
    .bogo-checkout-notice,
    .bogo-product-notification,
    .bogo-loop-notification {
        animation: none;
        box-shadow: none;
    }
    
    .bogo-free-badge,
    .bogo-mini-cart-badge {
        border: 1px solid #000;
        background: #fff !important;
        color: #000 !important;
    }
}
