/**
 * BBWA Cart Totals Widget Styles
 *
 * @package BB_WooAutomate
 * @since 2.0.0
 */

/* ============================================
   Container
   ============================================ */

.bbwa-cart-totals {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
}

.bbwa-cart-totals-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 20px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

/* ============================================
   Coupon Form
   ============================================ */

.bbwa-coupon-form {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.bbwa-coupon-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
}

.bbwa-coupon-toggle:hover {
    color: #764ba2;
}

.bbwa-coupon-toggle svg {
    transition: transform 0.2s ease;
}

.bbwa-coupon-toggle.active svg {
    transform: rotate(45deg);
}

.bbwa-coupon-input-wrapper {
    display: flex;
    gap: 8px;
}

.bbwa-coupon-input-wrapper.bbwa-hidden {
    display: none;
}

/* Inline style */
.bbwa-coupon-inline .bbwa-coupon-input-wrapper {
    display: flex;
}

/* Stacked style */
.bbwa-coupon-stacked .bbwa-coupon-input-wrapper {
    flex-direction: column;
}

.bbwa-coupon-stacked .bbwa-apply-coupon {
    width: 100%;
}

.bbwa-coupon-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s ease;
}

.bbwa-coupon-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bbwa-coupon-input::placeholder {
    color: #94a3b8;
}

.bbwa-apply-coupon {
    padding: 10px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bbwa-apply-coupon:hover {
    background: #5a67d8;
}

.bbwa-apply-coupon:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.bbwa-coupon-message {
    margin-top: 8px;
    font-size: 13px;
}

.bbwa-coupon-message.success {
    color: #22c55e;
}

.bbwa-coupon-message.error {
    color: #ef4444;
}

/* ============================================
   Applied Coupon Tags
   ============================================ */

.bbwa-applied-coupons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.bbwa-coupon-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #166534;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.bbwa-coupon-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    background: rgba(22, 101, 52, 0.1);
    border: none;
    border-radius: 50%;
    color: #166534;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bbwa-coupon-tag-remove:hover {
    background: #dc2626;
    color: #fff;
}

.bbwa-coupon-tag-remove svg {
    width: 10px;
    height: 10px;
}

/* ============================================
   Totals Table
   ============================================ */

.bbwa-totals-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.bbwa-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.bbwa-totals-label {
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bbwa-totals-value {
    color: #1e293b;
    font-weight: 500;
}

.bbwa-totals-total {
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
}

.bbwa-totals-total .bbwa-totals-label {
    color: #1e293b;
    font-weight: 600;
    font-size: 16px;
}

.bbwa-totals-total .bbwa-totals-value {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.bbwa-free-shipping {
    color: #22c55e;
    font-weight: 500;
}

.bbwa-discount {
    color: #22c55e;
}

/* Remove coupon button */
.bbwa-remove-coupon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #fef2f2;
    border: none;
    border-radius: 50%;
    color: #ef4444;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.bbwa-remove-coupon:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ============================================
   Checkout Button
   ============================================ */

.bbwa-checkout-button-wrapper {
    margin-bottom: 20px;
}

.bbwa-checkout-button {
    display: block;
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.bbwa-checkout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.bbwa-secure-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    color: #64748b;
}

.bbwa-secure-checkout svg {
    color: #22c55e;
}

/* ============================================
   Trust Badges
   ============================================ */

.bbwa-trust-badges {
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Horizontal layout */
.bbwa-trust-badges-horizontal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.bbwa-trust-badges-horizontal .bbwa-trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

/* Vertical layout */
.bbwa-trust-badges-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bbwa-trust-badges-vertical .bbwa-trust-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bbwa-trust-badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
}

.bbwa-trust-badge-icon svg {
    fill: currentColor;
}

.bbwa-trust-badge-text {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* ============================================
   Loading State
   ============================================ */

.bbwa-cart-totals.bbwa-loading {
    position: relative;
    pointer-events: none;
}

.bbwa-cart-totals.bbwa-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
}

.bbwa-cart-totals.bbwa-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: bbwa-spin 0.8s linear infinite;
    z-index: 1;
}

@keyframes bbwa-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
    .bbwa-cart-totals {
        padding: 16px;
    }
    
    .bbwa-coupon-input-wrapper {
        flex-direction: column;
    }
    
    .bbwa-apply-coupon {
        width: 100%;
    }
    
    .bbwa-trust-badges-horizontal {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bbwa-trust-badges-horizontal .bbwa-trust-badge {
        flex-direction: row;
        text-align: left;
    }
}

/* ============================================
   Notice Toast
   ============================================ */

.bbwa-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.bbwa-notice-visible {
    opacity: 1;
    transform: translateY(0);
}

.bbwa-notice-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.bbwa-notice-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.bbwa-notice-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}
