/**
 * BJ Simple Checkout CSS
 * Compact design using theme colors and fonts
 * Integrates with existing checkout theme
 */

/* Hook Integration Styles */
.bj-simple-checkout-container {
    background: var(--bs-white, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.bj-checkout-toggle {
    text-align: center;
    margin-bottom: 15px;
}

.bj-checkout-toggle .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bj-simple-checkout-form {
    border-top: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.175));
    padding-top: 20px;
    margin-top: 15px;
}

.bj-checkout-header {
    text-align: center;
    margin-bottom: 20px;
}

.bj-checkout-header h4 {
    color: var(--bs-primary, #0d6efd);
    margin-bottom: 5px;
    font-size: 1.25rem;
}

.bj-checkout-header p {
    margin: 0;
    font-size: 0.9rem;
}

/* Address Section */
.bj-address-section {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bs-light, #f8f9fa);
    border-radius: var(--bs-border-radius, 0.375rem);
}

.bj-address-section h5 {
    color: var(--bs-dark, #212529);
    font-size: 1rem;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    padding-bottom: 5px;
}

.address-display p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Shipping and Payment Sections */
.bj-shipping-section,
.bj-payment-section {
    margin-bottom: 20px;
}

.bj-shipping-section h5,
.bj-payment-section h5 {
    color: var(--bs-dark, #212529);
    font-size: 1rem;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    padding-bottom: 5px;
}

.shipping-options,
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shipping-option,
.payment-option {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    transition: all 0.2s ease;
}

.shipping-option:hover,
.payment-option:hover {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin: 0;
    cursor: pointer;
    width: 100%;
    background: transparent;
    transition: background-color 0.2s ease;
}

.radio-label:hover {
    background: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.1));
}

.radio-label input[type="radio"] {
    margin-right: 12px;
    accent-color: var(--bs-primary, #0d6efd);
}

.carrier-info,
.payment-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.carrier-name,
.payment-name {
    font-weight: 500;
    color: var(--bs-body-color, #212529);
}

.carrier-price {
    font-weight: 600;
    color: var(--bs-success, #198754);
    font-size: 0.9rem;
}

/* Checkout Actions */
.bj-checkout-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.bj-checkout-actions .btn {
    padding: 10px 25px;
    font-weight: 600;
    border-radius: var(--bs-border-radius, 0.375rem);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Cart Footer Simple Checkout */
.bj-cart-footer-simple-checkout {
    margin-top: 20px;
    padding: 20px;
    background: var(--bs-success-bg-subtle, rgba(25, 135, 84, 0.1));
    border: 1px solid var(--bs-success-border-subtle, rgba(25, 135, 84, 0.2));
    border-radius: var(--bs-border-radius, 0.375rem);
}

.bj-cart-footer-simple-checkout .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 30px;
}

/* Override Checkout Page Styles */
.bj-simple-checkout-page {
    font-family: inherit;
}

.bj-checkout-main {
    background: var(--bs-white, #fff);
    border-radius: var(--bs-border-radius-lg, 0.5rem);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.bj-checkout-header {
    background: linear-gradient(135deg, var(--bs-primary, #0d6efd) 0%, var(--bs-info, #0dcaf0) 100%);
    color: white;
    padding: 30px;
    text-align: center;
    margin-bottom: 0;
}

.bj-checkout-header h1 {
    margin: 0 0 10px 0;
    font-weight: 700;
    font-size: 2rem;
}

.bj-checkout-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.bj-section {
    padding: 25px 30px;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    transition: background-color 0.2s ease;
}

.bj-section:last-child {
    border-bottom: none;
}

.bj-section:hover {
    background: var(--bs-light, #f8f9fa);
}

.bj-section h3 {
    color: var(--bs-dark, #212529);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bj-section h3 i {
    color: var(--bs-primary, #0d6efd);
    font-size: 1.5rem;
}

/* Customer Info */
.bj-customer-info .customer-details p {
    margin: 5px 0;
    font-size: 1rem;
}

.bj-customer-info .customer-details p:first-child {
    font-size: 1.1rem;
    color: var(--bs-primary, #0d6efd);
}

/* Address Section */
.address-display {
    background: var(--bs-light, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    padding: 20px;
}

.address-item p {
    margin: 5px 0;
    line-height: 1.5;
}

/* Delivery and Payment Options */
.delivery-options,
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.delivery-option,
.payment-option {
    border: 2px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    transition: all 0.3s ease;
    overflow: hidden;
}

.delivery-option:hover,
.payment-option:hover {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
    transform: translateY(-2px);
}

.delivery-option input:checked + .carrier-info,
.payment-option input:checked + .payment-info {
    background: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.1));
    border-color: var(--bs-primary, #0d6efd);
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 20px;
    margin: 0;
    cursor: pointer;
    width: 100%;
    background: transparent;
    transition: all 0.2s ease;
    border: none;
}

.radio-label:hover {
    background: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.05));
}

.radio-label input[type="radio"] {
    margin-right: 15px;
    accent-color: var(--bs-primary, #0d6efd);
    transform: scale(1.2);
}

.carrier-info,
.payment-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 15px;
}

.carrier-name,
.payment-name {
    font-weight: 600;
    color: var(--bs-body-color, #212529);
    font-size: 1.1rem;
}

.carrier-delay {
    color: var(--bs-secondary, #6c757d);
    font-size: 0.9rem;
    font-style: italic;
}

.carrier-price {
    font-weight: 700;
    color: var(--bs-success, #198754);
    font-size: 1.1rem;
    white-space: nowrap;
}

.payment-logo {
    max-height: 30px;
    max-width: 60px;
    object-fit: contain;
}

.payment-additional-info {
    padding: 15px 20px 0;
    color: var(--bs-secondary, #6c757d);
    font-size: 0.9rem;
    border-top: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.175));
    margin-top: 15px;
}

/* Terms Section */
.bj-terms-section {
    background: var(--bs-warning-bg-subtle, rgba(255, 193, 7, 0.1));
    border: 1px solid var(--bs-warning-border-subtle, rgba(255, 193, 7, 0.2));
}

.form-check {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-check-input {
    transform: scale(1.2);
    accent-color: var(--bs-primary, #0d6efd);
}

.form-check-label {
    font-size: 1rem;
    color: var(--bs-body-color, #212529);
    cursor: pointer;
}

.form-check-label a {
    color: var(--bs-primary, #0d6efd);
    text-decoration: none;
    font-weight: 600;
}

.form-check-label a:hover {
    text-decoration: underline;
}

/* Complete Order Section */
.bj-complete-section {
    background: var(--bs-success-bg-subtle, rgba(25, 135, 84, 0.1));
    text-align: center;
    padding: 30px;
}

#bj-complete-order {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 15px 40px;
    border-radius: var(--bs-border-radius-lg, 0.5rem);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

#bj-complete-order:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.4);
}

#bj-complete-order:disabled {
    background: var(--bs-secondary, #6c757d) !important;
    border-color: var(--bs-secondary, #6c757d) !important;
    box-shadow: none;
    transform: none;
}

#bj-complete-order i {
    font-size: 1.5rem;
}

/* Checkout Sidebar */
.bj-checkout-sidebar {
    position: sticky;
    top: 20px;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .bj-section {
        padding: 20px;
    }
    
    .bj-checkout-header {
        padding: 25px 20px;
    }
    
    .bj-checkout-header h1 {
        font-size: 1.75rem;
    }
    
    .radio-label {
        padding: 15px;
    }
    
    .carrier-info,
    .payment-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .carrier-price {
        align-self: flex-end;
    }
}

@media (max-width: 575.98px) {
    .bj-section {
        padding: 15px;
    }
    
    .bj-checkout-header {
        padding: 20px 15px;
    }
    
    .bj-checkout-header h1 {
        font-size: 1.5rem;
    }
    
    #bj-complete-order {
        font-size: 1.1rem;
        padding: 12px 30px;
    }
}

/* Original Simple Checkout Page Styles */
#bj-simple-checkout {
    font-family: inherit;
    margin-top: 20px;
}

.checkout-section {
    background: var(--bs-white, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.checkout-section h3 {
    color: var(--bs-primary, #0d6efd);
    font-size: 1.25rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bs-primary, #0d6efd);
}

/* Product Lines */
.cart-products {
    max-height: 300px;
    overflow-y: auto;
}

.product-line {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.175));
}

.product-line:last-child {
    border-bottom: none;
}

.product-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.product-details {
    flex: 1;
}

.product-details h4 {
    font-size: 0.95rem;
    margin: 0 0 5px 0;
    color: var(--bs-body-color, #212529);
}

.product-price {
    font-size: 0.85rem;
    color: var(--bs-secondary, #6c757d);
    margin: 0;
}

.product-total {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bs-success, #198754);
    margin: 0;
}

/* Shipping and Payment Options */
.shipping-methods,
.payment-methods {
    margin-bottom: 20px;
}

.shipping-option,
.payment-option {
    margin-bottom: 10px;
}

.shipping-option label,
.payment-option label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bs-light, #f8f9fa);
}

.shipping-option label:hover,
.payment-option label:hover {
    border-color: var(--bs-primary, #0d6efd);
    background: var(--bs-primary-bg-subtle, rgba(13, 110, 253, 0.1));
}

.shipping-option input[type="radio"]:checked + .carrier-name,
.payment-option input[type="radio"]:checked + .payment-name {
    color: var(--bs-primary, #0d6efd);
    font-weight: 600;
}

.shipping-option input[type="radio"]:checked,
.payment-option input[type="radio"]:checked {
    accent-color: var(--bs-primary, #0d6efd);
}

.carrier-name,
.payment-name {
    flex: 1;
    margin-left: 10px;
    font-size: 0.95rem;
}

.carrier-price {
    font-weight: 600;
    color: var(--bs-success, #198754);
    font-size: 0.9rem;
}

/* Checkout Actions */
.checkout-actions {
    text-align: center;
    margin-top: 25px;
}

.checkout-actions .btn {
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--bs-border-radius-lg, 0.5rem);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Order Summary Sidebar */
.order-summary-sidebar {
    background: var(--bs-light, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    padding: 20px;
    position: sticky;
    top: 20px;
}

.order-summary-sidebar h3 {
    color: var(--bs-dark, #212529);
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.175));
    font-size: 0.9rem;
}

.summary-line:last-of-type {
    border-bottom: none;
}

.total-line {
    border-top: 2px solid var(--bs-primary, #0d6efd);
    margin-top: 10px;
    padding-top: 15px;
    font-size: 1.1rem;
}

.total-line span {
    color: var(--bs-primary, #0d6efd);
}

/* Customer Info */
.customer-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.customer-info h4 {
    font-size: 1rem;
    color: var(--bs-dark, #212529);
    margin-bottom: 10px;
}

.customer-info p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--bs-secondary, #6c757d);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    #bj-simple-checkout .row {
        flex-direction: column-reverse;
    }
    
    .order-summary-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .product-line {
        flex-direction: column;
        text-align: center;
    }
    
    .product-image {
        margin: 0 0 10px 0;
    }
    
    .shipping-option label,
    .payment-option label {
        flex-direction: column;
        text-align: center;
    }
    
    .carrier-name,
    .payment-name {
        margin: 5px 0;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--bs-primary, #0d6efd);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Messages */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: var(--bs-border-radius, 0.375rem);
}

.alert-danger {
    color: var(--bs-danger-text, #842029);
    background-color: var(--bs-danger-bg-subtle, #f8d7da);
    border-color: var(--bs-danger-border-subtle, #f5c2c7);
}

/* Compact Mode Adjustments */
.compact-mode .checkout-section {
    padding: 15px;
    margin-bottom: 15px;
}

.compact-mode .product-line {
    padding: 8px 0;
}

.compact-mode .shipping-option label,
.compact-mode .payment-option label {
    padding: 10px;
}

.compact-mode .order-summary-sidebar {
    padding: 15px;
}