/* ===== CHECKOUT PERSONALIZADO BUYBOX ===== */
/* Classes exclusivas com prefixo BBX para evitar conflitos */

:root {
    --bbx-primary: #e11d29;
    --bbx-secondary: #f3f4f6;
}

.bbx-custom-checkout-container {
    background: #f8f9fa;
    padding: 40px 0 20px 0;
}

.bbx-checkout-wrapper {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 10px 60px 10px;
}

.bbx-checkout-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bbx-checkout-logo img {
    max-height: 40px;
    margin-bottom: 20px;
}

.bbx-checkout-progress {
    margin-top: 20px;
}

.bbx-progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.bbx-progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.bbx-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 0 10px;
}

.bbx-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
}

.bbx-step-active .bbx-step-number {
    background: var(--bbx-primary);
    color: white;
}

.bbx-step-title {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.bbx-step-active .bbx-step-title {
    color: var(--bbx-primary);
    font-weight: 600;
}

.bbx-checkout-content {
    display: grid;
    grid-template-columns: 1fr minmax(250px, 400px);
    gap: 30px;
    align-items: start;
}

.bbx-checkout-main {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bbx-checkout-step {
    display: none;
    padding: 30px;
    background: white;
    box-sizing: border-box;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bbx-checkout-step.bbx-step-active {
    display: block;
}

.bbx-step-header h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.bbx-step-header p {
    color: #666;
    margin: 0 0 30px 0;
    font-size: 12px;
}

.bbx-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.bbx-form-group {
    margin-bottom: 20px;
}

.bbx-gateway-fields p {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.bbx-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.bbx-form-group small {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.bbx-required {
    color: #e74c3c;
}

.bbx-form-group input,
.bbx-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px !important;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.bbx-form-group input:focus,
.bbx-form-group select:focus {
    outline: none;
    border-color: var(--bbx-primary);
}

.bbx-checkbox-group {
    margin: 20px 0;
}

.bbx-checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.bbx-checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.bbx-btn-link {
    background: none;
    border: none;
    color: var(--bbx-primary);
    padding: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}

.bbx-step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

.bbx-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bbx-btn-primary {
    background: var(--bbx-primary);
    color: white;
}

.bbx-btn-primary:hover {
    background: #c91420;
    transform: translateY(-1px);
}

.bbx-btn-secondary {
    background: #bd2921;
    color: white;
}

.mp-checkout-ticket-billing-number-toggle-checkbox p{
    font-size: 12px !important;
}

.bbx-btn-secondary:hover {
    background: #9c190d;
}

.bbx-btn-arrow {
    font-size: 18px;
}

.bbx-shipping-methods,
.bbx-payment-methods {
    margin: 20px 0;
}

.bbx-shipping-method,
.bbx-payment-method {
    margin-bottom: 15px;
}

.bbx-shipping-method > label,
.bbx-payment-method > label {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.bbx-shipping-method label:hover,
.bbx-payment-method label:hover {
    border-color: var(--bbx-primary);
}

.bbx-shipping-method input[type="radio"]:checked + .bbx-method-info,
.bbx-payment-method input[type="radio"]:checked + .bbx-method-info {
    color: var(--bbx-primary);
}

.bbx-method-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-left: 15px;
}

.bbx-method-name {
    font-weight: 600;
    font-size: 14px;
}

.bbx-method-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.bbx-delivery-time {
    font-size: 14px;
    color: #666;
}

.bbx-delivery-price {
    font-weight: 600;
    color: var(--bbx-primary);
}

.bbx-method-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 32px;
}

.bbx-checkout-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: calc(var(--header-h, 0px) + 20px);
    max-height: calc(100vh - var(--header-h, 0px) - 40px);
    overflow: auto;
    z-index: 0;
}

.bbx-order-summary h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.bbx-order-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.bbx-item-image {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
}

.bbx-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bbx-item-quantity {
    position: absolute;
    top: 0px;
    right: 2px;
    background: var(--bbx-primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 99999;
    font-weight: bold;
}

.bbx-item-details {
    flex: 1;
}

.bbx-item-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
    font-size: 14px;
}

.bbx-item-variation {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.bbx-item-price {
    font-weight: 600;
    color: var(--bbx-primary);
    font-size: 12px;
}

.bbx-coupon-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.bbx-coupon-input {
    display: flex;
    gap: 10px;
}

.bbx-coupon-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bbx-order-totals {
    margin: 20px 0;
}

.bbx-total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    font-size: 14px;
}

.bbx-total-line #bbx-shipping-total {
    color: #999;
    font-style: italic;
}

/* Cupons Aplicados */
.bbx-applied-coupons {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.bbx-applied-coupons h4 {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.bbx-coupons-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bbx-coupon-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 13px;
    color: #666;
    transition: all 0.2s ease;
}

.bbx-coupon-tag:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.bbx-coupon-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.bbx-coupon-code {
    font-weight: 600;
    color: #333;
}

.bbx-coupon-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bbx-coupon-remove:hover {
    background: #f5f5f5;
    color: #666;
}

.bbx-total-line .woocommerce-Price-amount {
    font-weight: 600;
    color: var(--bbx-primary);
}

.bbx-total-line .woocommerce-Price-currencySymbol {
    font-weight: 600;
}

.bbx-total-line .woocommerce-Price-amount bdi {
    font-weight: 600;
}

.bbx-total-line.bbx-total {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    border-top: 2px solid #e0e0e0;
    padding-top: 15px;
    margin-top: 15px;
}

.bbx-total-line.bbx-total .woocommerce-Price-amount {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.bbx-total-line.bbx-total .woocommerce-Price-amount bdi {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.bbx-total-line.bbx-discount {
    color: #28a745;
}

.bbx-total-line.bbx-discount .woocommerce-Price-amount {
    color: #28a745;
    font-weight: 600;
}

.bbx-total-line.bbx-discount .woocommerce-Price-amount bdi {
    color: #28a745;
    font-weight: 600;
}

.bbx-total-savings {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    margin-top: 10px;
}

.bbx-checkout-help {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
}

.bbx-checkout-help p {
    margin: 0 0 8px 0;
}

.bbx-checkout-help a {
    color: var(--bbx-primary);
    text-decoration: none;
}

.bbx-checkout-help a:hover {
    text-decoration: underline;
}

/* Sistema de Login/Cadastro */
.bbx-auth-section {
    margin-bottom: 30px;
}

.bbx-auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.bbx-auth-tab {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.bbx-auth-tab:hover {
    color: var(--bbx-primary);
}

.bbx-auth-tab.bbx-tab-active {
    color: var(--bbx-primary);
    border-bottom-color: var(--bbx-primary);
}

.bbx-auth-content {
    display: none;
}

.bbx-auth-content.bbx-tab-active {
    display: block;
}

.bbx-checkout-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.bbx-checkout-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.bbx-logout-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    margin-left: 10px;
}

.bbx-logout-link:hover {
    color: var(--bbx-primary);
    text-decoration: underline;
}

.bbx-user-note {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #3b3b3b;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 12px;
}

.bbx-login-link {
    color: var(--bbx-primary);
    text-decoration: none;
    font-weight: 600;
}

.bbx-login-link:hover {
    text-decoration: underline;
}

.bbx-coupon-error{
    margin-top: 5px;
    color: red;
    padding-left: 5px;
}

.bbx-coupon-sucess{
    
}

/* Responsividade */
@media (max-width: 768px) {
    .bbx-checkout-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .bbx-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bbx-step-actions {
        flex-direction: column-reverse;
        gap: 15px;
    }
    
    .bbx-btn {
        width: 100%;
        justify-content: center;
    }
    
    .bbx-auth-tab {
        padding: 12px 15px;
        font-size: 14px;
    }

    .bbx-coupon-input{
        flex-direction: column;
        gap: 10px;
    }

    .bbx-coupon-input input {
        width: 100%;
    }

    .bbx-total-line.bbx-total{
        font-size: 16px;
    }

    .bbx-total-line{
        font-size: 12px;
    }

    .bbx-checkout-step {
        padding: 20px;
    }

    .bbx-form-group label{
        font-size: 12px;
    }

    .bbx-form-group small{
        font-size: 10px;
    }

    .bbx-step-header h2{
        font-size: 16px;
    }

    .bbx-checkout-content{
        display: flex;  
        flex-direction: column-reverse;
        gap: 40px;
    }

    .bbx-checkout-sidebar{
        position: relative;
    }

    .bbx-checkout-header{
        margin-bottom: 0;
    }

    .bbx-form-group{
        margin-bottom: 20px;
    }

}
