/* =================================================================
   BuyShazam Sync – Frontend Order Form CSS
   All selectors scoped under #bss-order-form for high specificity
   to prevent theme overrides (Flatsome, Astra, etc.)
   ================================================================= */

/* Reset – prevent theme box-sizing / margin leaks */
#bss-order-form,
#bss-order-form *,
#bss-order-form *::before,
#bss-order-form *::after {
    box-sizing: border-box;
}

/* Wrapper */
#bss-order-form.bss-order-wrap {
    max-width: 640px;
    margin: 30px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1e293b;
}

/* Form group */
#bss-order-form .bss-form-group {
    margin-bottom: 20px;
    position: relative;
}
#bss-order-form .bss-form-group.bss-error .bss-input {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

/* Labels */
#bss-order-form .bss-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #1e293b;
    text-transform: none;
    letter-spacing: 0;
}
#bss-order-form .bss-small-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: 0;
}
#bss-order-form .bss-icon {
    font-style: normal;
    margin-right: 4px;
}

/* Inputs */
#bss-order-form .bss-input,
#bss-order-form .bss-textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.5;
    font-family: inherit;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    outline: none;
}
#bss-order-form .bss-input:focus,
#bss-order-form .bss-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
    background: #fff;
}
#bss-order-form .bss-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Hint text */
#bss-order-form .bss-hint {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Search dropdown */
#bss-order-form .bss-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,.12);
    z-index: 9999;
}
#bss-order-form .bss-dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
    background: #fff;
}
#bss-order-form .bss-dropdown-item:hover,
#bss-order-form .bss-dropdown-item.active {
    background: #eff6ff;
}
#bss-order-form .bss-dropdown-item:last-child {
    border-bottom: none;
}
#bss-order-form .bss-dropdown-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    margin: 0;
    padding: 0;
}
#bss-order-form .bss-dropdown-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    padding: 0;
}
#bss-order-form .bss-dropdown-empty {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}
#bss-order-form .bss-dropdown-loading {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

/* Info card (selected service) */
#bss-order-form .bss-info-card {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
}
#bss-order-form .bss-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}
#bss-order-form .bss-info-row + .bss-info-row {
    border-top: 1px solid #e0f2fe;
}
#bss-order-form .bss-info-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}
#bss-order-form .bss-info-value {
    font-size: 14px;
    color: #0c4a6e;
    font-weight: 600;
}

/* Grid */
#bss-order-form .bss-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

/* Total card */
#bss-order-form .bss-total-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    border-radius: 10px;
    padding: 16px 20px;
}
#bss-order-form .bss-total-label {
    font-size: 15px;
    font-weight: 500;
    opacity: .85;
    color: #fff;
}
#bss-order-form .bss-total-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

/* Button */
#bss-order-form .bss-btn-primary {
    display: block;
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    text-align: center;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
#bss-order-form .bss-btn-primary:hover:not(:disabled) {
    opacity: .9;
    transform: translateY(-1px);
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
#bss-order-form .bss-btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
}
#bss-order-form .bss-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Spinner */
#bss-order-form .bss-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bss-spin .6s linear infinite;
}
@keyframes bss-spin {
    to { transform: rotate(360deg); }
}

/* Status messages */
#bss-order-form .bss-status {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
}
#bss-order-form .bss-status-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}
#bss-order-form .bss-status-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Responsive */
@media (max-width: 600px) {
    #bss-order-form.bss-order-wrap {
        margin: 15px 10px;
    }
    #bss-order-form .bss-grid-2 {
        grid-template-columns: 1fr;
    }
    #bss-order-form .bss-total-value {
        font-size: 20px;
    }
}
