/**
 * Frontend Order Builder Styles.
 */
.vial-builder-container {
    margin: 25px 0 0px;
    font-family: inherit;
    color: #1f2937;
}

.vial-builder-header {
    margin-bottom: 20px;
}

.vial-builder-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #111827;
}

.vial-builder-subtitle {
    color: #6b7280;
    font-size: 15px;
    margin-bottom: 0;
}

/* Minimum Order Progress Bar */
.vial-min-order-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.vial-min-order-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 8px;
}

.vial-min-order-label {
    font-weight: 600;
    color: #334155;
}

.vial-min-order-status {
    font-weight: 600;
    color: #b45309;
}

.vial-min-order-status.satisfied {
    color: #059669;
}

.vial-progress-track {
    width: 100%;
    height: 10px;
    background-color: #cbd5e1;
    border-radius: 5px;
    overflow: hidden;
}

.vial-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #10b981);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Single Product Full-Width Override for Vial Catalogue Product Type */
.single-product .product.product-type-vial_catalogue {
    display: block !important;
    width: 100% !important;
}

.single-product .product.product-type-vial_catalogue .woocommerce-product-gallery {
    display: none !important;
}

.single-product .product.product-type-vial_catalogue .summary.entry-summary {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
}

/* Layout */
.vial-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 30px;
    align-items: start;
    width: 100%;
}

@media (max-width: 992px) {
    .vial-builder-layout {
        grid-template-columns: 1fr !important;
    }

    .vial-summary-card {
        position: static !important;
        margin-top: 24px !important;
    }
}

/* Search Bar */
.vial-search-container {
    margin-bottom: 16px;
}

.vial-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.vial-search-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    color: #9ca3af;
    pointer-events: none;
}

.vial-search-input {
    width: 100% !important;
    padding: 12px 40px 12px 42px !important;
    font-size: 15px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease !important;
}

.vial-search-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

.vial-search-clear {
    position: absolute;
    right: 0px;
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    height: 40px;
    width: 40px;
    border-radius: 0 8px 8px 0;
}

.vial-search-clear:hover {
    color: #ffffff;
}

/* Custom Prompt Banner */
.vial-custom-prompt-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 24px;
    margin-bottom: 20px;
}

.vial-custom-prompt-text strong {
    display: block;
    color: #1e40af;
    font-size: 14px;
    margin-bottom: 3px;
}

.vial-custom-prompt-text span {
    font-size: 13px;
    color: #3b82f6;
    display: inline;
}

.vial-btn-secondary {
    background: #ffffff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    padding: 8px 14px !important;
    cursor: pointer;
    white-space: nowrap;
}

.vial-btn-secondary:hover {
    background: #dbeafe !important;
}

/* Results Grid */
div#vial-results-grid:empty {
    display: none;
}

.vial-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    min-height: 120px;
}

.vial-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.vial-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.vial-card-header {
    margin-bottom: 12px;
}

.vial-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.vial-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
}

.vial-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #047857;
    margin: 8px 0;
}

.vial-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* Quantity Stepper */
.vial-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background: #f9fafb;
}

.vial-stepper-btn {
    background: #ffffff;
    border: none;
    width: 32px;
    height: 34px;
    font-size: 16px;
    padding: 0;
    font-weight: bold;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease;
}

.vial-stepper-btn:hover {
    background: var(--ast-global-color-1);
    color: var(--ast-global-color-5);
}

button.vial-stepper-btn.vial-btn-minus {
    border-radius: 6px 0px 0px 6px;
}

button.vial-stepper-btn.vial-btn-plus {
    border-radius: 0px 6px 6px 0px;
}

.vial-stepper-input {
    width: 44px !important;
    height: 34px !important;
    text-align: center !important;
    border: none !important;
    background: #ffffff !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    -moz-appearance: textfield;
}

.vial-stepper-input::-webkit-outer-spin-button,
.vial-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.vial-add-btn {
    flex: 1;
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    background: var(--ast-global-color-1);
    color: var(--ast-global-color-5);
    border: none !important;
    cursor: pointer;
    height: 34px;
}

.vial-add-btn:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed;
}

/* Selected Summary Column */
.vial-summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
}

.vial-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.vial-summary-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.vial-count-pill {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 12px;
}

.vial-selected-empty {
    padding: 24px 10px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.vial-selected-items {
    max-height: 380px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.vial-selected-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.vial-selected-details {
    flex: 1;
    padding-right: 10px;
}

.vial-selected-name {
    font-weight: 600;
    color: #111827;
}

.vial-selected-unit {
    color: #6b7280;
    font-size: 12px;
}

.vial-selected-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vial-selected-total {
    font-weight: 700;
    color: #111827;
    min-width: 50px;
    text-align: right;
}

.vial-remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}

.vial-remove-btn:hover {
    color: #b91c1c;
}

.vial-summary-footer {
    border-top: 2px solid #f3f4f6;
    padding-top: 14px;
}

.vial-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    margin-bottom: 14px;
}

.vial-subtotal-row strong {
    font-size: 20px;
    color: #111827;
}

.vial-btn-cta {
    width: 100% !important;
    padding: 14px 20px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    text-align: center;
    cursor: pointer;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.vial-inline-notice {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* Spinner */
.vial-loading-indicator {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

.vial-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(37, 99, 235, 0.2);
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: vial-spin 0.8s linear infinite;
    margin-bottom: 6px;
}

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

/* ==========================================================================
   Custom Vial Request Modal Popup Styles
   ========================================================================== */
.vial-modal-backdrop {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 999998 !important;
}

.vial-modal-backdrop.is-open {
    display: block !important;
}

.vial-modal {
    display: none;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 520px !important;
    max-width: 92vw !important;
    max-height: 90vh !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    z-index: 999999 !important;
    overflow: hidden !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.vial-modal.is-open {
    display: flex !important;
    flex-direction: column !important;
    animation: vialModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes vialModalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.vial-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 18px 24px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: #f8fafc !important;
}

.vial-modal-header h3 {
    margin: 0 !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
}

.vial-modal-close {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 26px !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #64748b !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
}

.vial-modal-close:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.vial-modal-body {
    padding: 24px !important;
    overflow-y: auto !important;
    text-align: left !important;
}

.vial-modal-body p {
    margin-top: 0 !important;
    margin-bottom: 16px !important;
    color: #475569 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.vial-form-row {
    margin-bottom: 18px !important;
    text-align: left !important;
}

.vial-form-row label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-bottom: 6px !important;
    text-align: left !important;
}

.vial-form-row input[type="text"],
.vial-form-row input[type="number"],
.vial-form-row select {
    width: 100% !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

.vial-form-row input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

.vial-form-row-group {
    display: flex !important;
    gap: 16px !important;
    margin-bottom: 18px !important;
    text-align: left !important;
}

.vial-form-col {
    flex: 1 !important;
    text-align: left !important;
}

.vial-form-col label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-bottom: 6px !important;
    text-align: left !important;
}

.vial-form-col input {
    width: 100% !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
}

.vial-form-col input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

.vial-modal-footer {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px 24px !important;
    border-top: 1px solid #f1f5f9 !important;
    background: #f8fafc !important;
}

.vial-modal-footer button {
    margin: 0 !important;
    padding: 10px 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}