/* ============================================
   CUSTOMER ORDER FORM - Form Layout & Sidebar
   Bolivia Import Manager
   ============================================ */

/* Order Form Wrapper */
.bim-order-form-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 40px 20px;
    animation: bimFadeIn 0.3s ease;
}

/* Two-column layout */
.bim-order-form-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.bim-order-form-main {
    flex: 1;
    min-width: 0;
}

/* Form Header - Simple */
.bim-form-header {
    padding: 0 0 8px 0;
    margin-bottom: 16px;
    text-align: left;
}

.bim-form-header h1 {
    margin: 0 0 8px 0;
    font-size: 30px;
    font-weight: 800;
    color: var(--bim-dark);
    letter-spacing: -0.5px;
}

.bim-form-header p {
    margin: 0;
    font-size: 15px;
    color: var(--bim-secondary);
}

/* Progress Bar */
.bim-form-progress {
    height: 4px;
    background: var(--bim-border);
    border-radius: 9999px;
    margin-bottom: 24px;
    overflow: hidden;
}

.bim-form-progress-bar {
    height: 100%;
    width: 15%;
    background: linear-gradient(90deg, var(--bim-primary), #6366f1);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

/* USA Only Notice Banner */
.bim-usa-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--bim-radius);
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.bim-usa-notice-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.bim-usa-notice-text {
    font-size: 14px;
    font-weight: 500;
    color: #1e40af;
    line-height: 1.4;
}

/* Order Form Container */
.bim-order-form {
    position: relative;
}

/* Product Entry Card - Design System */
.bim-order-form .bim-product-entry {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--bim-shadow);
    border: 1px solid var(--bim-border);
    padding: 0;
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bim-order-form .bim-product-entry:hover {
    box-shadow: var(--bim-shadow-md);
}

/* Product Entry Header */
.bim-order-form .bim-product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--bim-border);
    background: #f8fafc;
}

.bim-order-form .bim-product-header h3 {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    color: var(--bim-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bim-order-form .bim-product-header h3::before {
    content: '';
    display: block;
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--bim-primary), #6366f1);
    border-radius: 2px;
}

/* Remove Product Button */
.bim-btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bim-danger-light);
    color: var(--bim-danger);
    border-radius: var(--bim-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bim-btn-icon:hover {
    background: var(--bim-danger);
    color: #fff;
}

.bim-btn-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.bim-btn-icon .material-symbols-outlined {
    font-size: 18px;
}

/* Form Content Area */
.bim-order-form .bim-product-entry > .bim-form-row {
    padding: 0 24px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.bim-order-form .bim-product-entry > .bim-form-row:first-of-type {
    padding-top: 24px;
}

.bim-order-form .bim-product-entry > .bim-form-row:last-of-type {
    padding-bottom: 24px;
    margin-bottom: 0;
}

/* Form Group Refinements */
.bim-order-form .bim-form-group {
    margin-bottom: 24px;
}

.bim-order-form .bim-form-group:last-child {
    margin-bottom: 0;
}

.bim-order-form .bim-form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 12px;
    color: var(--bim-dark);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Full Width Form Group */
.bim-full-width {
    grid-column: 1 / -1;
}

/* Input Refinements for Order Form */
.bim-order-form .bim-input,
.bim-order-form .bim-select,
.bim-order-form .bim-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--bim-border);
    background-color: #f8fafc;
    border-radius: 12px;
    font-size: 14px;
    color: var(--bim-dark);
    box-sizing: border-box;
    transition: all 0.2s ease;
    font-weight: 500;
}

.bim-order-form .bim-input:focus,
.bim-order-form .bim-select:focus,
.bim-order-form .bim-textarea:focus {
    outline: none;
    border-color: var(--bim-primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.bim-order-form .bim-input::placeholder,
.bim-order-form .bim-textarea::placeholder {
    color: #9ca3af;
}

/* Select Dropdown Styling */
.bim-order-form .bim-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

/* Radio Button Group - Custom Styling */
.bim-radio-group {
    display: flex;
    gap: 12px;
    padding-top: 4px;
}

.bim-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.bim-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.bim-radio span {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--bim-light);
    border: 2px solid var(--bim-border);
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--bim-secondary);
    transition: all 0.2s ease;
}

.bim-radio span::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid var(--bim-border);
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.2s ease;
    background: #fff;
}

.bim-radio:hover span {
    border-color: var(--bim-primary);
    background: var(--bim-primary-light);
}

.bim-radio input[type="radio"]:checked + span {
    background: var(--bim-primary-light);
    border-color: var(--bim-primary);
    color: var(--bim-primary);
}

.bim-radio input[type="radio"]:checked + span::before {
    border-color: var(--bim-primary);
    background: var(--bim-primary);
    box-shadow: inset 0 0 0 3px #fff;
}

/* Input with Prefix (Price) */
.bim-order-form .bim-input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.bim-order-form .bim-input-prefix {
    position: absolute;
    left: 16px;
    font-weight: 600;
    color: var(--bim-secondary);
    font-size: 14px;
    z-index: 1;
}

.bim-order-form .bim-input-with-prefix {
    padding-left: 36px;
}

/* Help Text */
.bim-order-form .bim-help-text {
    display: block;
    font-size: 12px;
    color: var(--bim-secondary);
    margin-top: 6px;
    font-weight: 400;
}

.bim-order-form .bim-help-text a {
    color: var(--bim-primary);
    text-decoration: none;
}

.bim-order-form .bim-help-text a:hover {
    text-decoration: underline;
}

/* File Upload - Order Form */
.bim-order-form .bim-file-upload {
    background: #f8fafc;
    border: 2px dashed var(--bim-border);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bim-order-form .bim-file-upload:hover {
    border-color: var(--bim-primary);
    background: var(--bim-primary-light);
}

.bim-order-form .bim-file-label {
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--bim-secondary);
    font-weight: 500;
    font-size: 14px;
}

.bim-order-form .bim-file-icon {
    font-size: 28px;
    color: var(--bim-primary);
}

.bim-order-form .bim-file-icon .material-symbols-outlined {
    font-size: 28px;
}

/* Textarea */
.bim-order-form .bim-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Add Product Button Wrapper */
.bim-order-form .bim-add-product-wrapper {
    display: flex;
    justify-content: center;
    margin: 32px 0;
}

.bim-order-form #bim-add-product {
    width: 100%;
    padding: 16px 32px;
    font-size: 13px;
    border-radius: 16px;
    border: 2px dashed var(--bim-primary);
    background: transparent;
    color: var(--bim-primary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.bim-order-form #bim-add-product:hover {
    background: var(--bim-primary-light);
    border-style: solid;
}

/* Form Divider */
.bim-form-divider {
    height: 0;
    border: none;
    margin: 8px 0;
}

/* General Order Notes Section */
.bim-order-form > .bim-form-row {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--bim-border);
    padding: 24px 0;
    margin-bottom: 24px;
}

/* Submit Section */
.bim-form-submit {
    text-align: center;
    padding: 32px 0;
}

.bim-form-submit .bim-btn-primary {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    color: #fff !important;
    border: none;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
    width: 100%;
    max-width: 420px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bim-form-submit .bim-btn-primary .material-symbols-outlined {
    font-size: 20px;
}

.bim-form-submit .bim-btn-primary:hover,
button.bim-form-submit .bim-btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(96, 165, 250, 0.4);
}

.bim-form-submit .bim-btn-lg {
    padding: 16px 48px;
    font-size: 16px;
}

/* Button Loading State */
.bim-btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bim-btn.bim-loading .bim-btn-loading {
    display: inline-flex;
}

.bim-btn.bim-loading .bim-btn-text {
    display: none;
}

.bim-btn-loading .bim-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border-width: 3px;
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Disabled button state */
.bim-btn:disabled,
.bim-btn.bim-loading {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Form Note */
.bim-form-note {
    margin: 16px 0 0 0;
    font-size: 13px;
    color: var(--bim-secondary);
}

/* ============================================
   SIDEBAR - "Why Us?" Card
   ============================================ */

/* Force overflow visible on ancestors so sticky works inside Elementor/theme wrappers */
.bim-order-form-wrapper,
.bim-order-form-layout,
.bim-order-form-wrapper .elementor-widget-container,
.elementor-widget-container:has(.bim-order-form-wrapper),
.entry-content:has(.bim-order-form-wrapper),
.page-content:has(.bim-order-form-wrapper),
.site-main:has(.bim-order-form-wrapper),
.site-content:has(.bim-order-form-wrapper),
main:has(.bim-order-form-wrapper),
article:has(.bim-order-form-wrapper) {
    overflow: visible !important;
}

/* Override theme body overflow-x:hidden which breaks position:sticky.
   overflow:clip prevents horizontal scroll without creating a scroll container. */
body:has(.bim-order-form-wrapper),
body:has(.bim-quote-view),
body:has(.bim-customer-dashboard-wrapper) {
    overflow-x: clip !important;
}

.bim-order-sidebar {
    width: 320px;
    flex-shrink: 0;
    position: -webkit-sticky;
    position: sticky;
    top: 28px;
    align-self: flex-start;
}

.bim-sidebar-card {
    background: #f0f5ff;
    border: 1px solid #e0e8f5;
    border-radius: 20px;
    padding: 32px 28px;
}

.bim-sidebar-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.bim-sidebar-heading .bim-icon-shield {
    font-size: 28px;
    background: linear-gradient(135deg, #2563eb, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bim-sidebar-heading h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--bim-dark);
}

.bim-sidebar-benefits {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 28px;
}

.bim-sidebar-benefit {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.bim-sidebar-benefit-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bim-sidebar-benefit-icon.bim-icon-blue {
    background: #dbeafe;
    color: #2563eb;
}

.bim-sidebar-benefit-icon.bim-icon-green {
    background: #d1fae5;
    color: #059669;
}

.bim-sidebar-benefit-icon.bim-icon-purple {
    background: #e0e7ff;
    color: #4f46e5;
}

.bim-sidebar-benefit-icon .material-symbols-outlined {
    font-size: 22px;
}

.bim-sidebar-benefit strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--bim-dark);
    margin-bottom: 3px;
}

.bim-sidebar-benefit p {
    margin: 0;
    font-size: 13px;
    color: var(--bim-secondary);
    line-height: 1.5;
}

.bim-sidebar-trust {
    background: #e8f0fe;
    border-radius: 14px;
    padding: 18px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bim-sidebar-trust-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--bim-primary);
}

.bim-sidebar-trust-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--bim-dark);
}

/* Order Form Responsive */
@media (max-width: 1024px) {
    .bim-order-form-layout {
        flex-direction: column;
    }

    .bim-order-sidebar {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .bim-order-form-wrapper {
        padding: 40px 15px 20px 15px;
    }

    .bim-form-header h1 {
        font-size: 24px;
    }

    .bim-form-header p {
        font-size: 14px;
    }

    .bim-order-form .bim-product-header {
        padding: 16px 20px;
    }

    .bim-order-form .bim-product-entry > .bim-form-row {
        padding: 0 20px;
        margin-bottom: 16px;
    }

    .bim-order-form .bim-product-entry > .bim-form-row:first-of-type {
        padding-top: 20px;
    }

    .bim-order-form .bim-product-entry > .bim-form-row:last-of-type {
        padding-bottom: 20px;
        margin-bottom: 0;
    }

    .bim-radio-group {
        flex-direction: column;
        gap: 8px;
    }

    .bim-radio span {
        width: 100%;
        justify-content: center;
    }

    .bim-form-submit .bim-btn-primary {
        max-width: 100%;
        padding: 16px 24px;
    }
}

@media (max-width: 480px) {
    .bim-form-header h1 {
        font-size: 20px;
    }

    .bim-order-form .bim-product-header h3 {
        font-size: 12px;
    }
}
