/* ==========================================================================
   Kit Delivery slide-in panel ("Order Kit Delivery")
   Same right-side canvas convention as .fc-size-chart-canvas (see that
   block in form.css + class-registration-form-widget.php's
   render_size_chart_canvas()) — new class names so the two panels never
   collide, since both can exist on the same page.
   ========================================================================== */

/* .fc-kd-btn's own `display: inline-block` rule below has the same
   specificity as the browser's default `[hidden] { display: none }` UA
   rule, and — being declared later, in this stylesheet — was silently
   winning, so a button rendered with the `hidden` attribute (e.g.
   [data-action="continue-to-kits"], meant to stay hidden until a lookup
   resolves) showed immediately instead. This compound selector has
   higher specificity than .fc-kd-btn alone, so it wins the initial
   [hidden] state correctly — and, having no !important, a later jQuery
   .show() (which sets an inline style) still safely overrides it, since
   an inline style always beats a non-!important stylesheet rule
   regardless of selector specificity. */
.fc-kd-btn[hidden] {
    display: none;
}

.fc-kit-delivery-canvas {
    position: fixed;
    inset: 0;
    z-index: 100000;
    visibility: hidden;
    pointer-events: none;
}

/* The manual-kid-row DOB field's AirDatepicker (kit-delivery-panel.js)
   is deliberately given no `container` option, so the library appends
   its calendar near <body> rather than inside this panel's own
   scrollable body — its default z-index (100) would otherwise render
   underneath this canvas's own 100000. */
.air-datepicker.fc-custom-datepicker {
    z-index: 100001;
}

.fc-kit-delivery-canvas.is-open {
    visibility: visible;
    pointer-events: auto;
}

.fc-kit-delivery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.fc-kit-delivery-canvas.is-open .fc-kit-delivery-overlay {
    opacity: 1;
}

.fc-kit-delivery-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 92vw;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.fc-kit-delivery-canvas.is-open .fc-kit-delivery-panel {
    transform: translateX(0);
}

.fc-kit-delivery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.fc-kit-delivery-header h3 {
    margin: 0;
    font-size: 17px;
    color: #333;
}

.fc-kit-delivery-close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
}

.fc-kit-delivery-close:hover {
    color: #333;
}

.fc-kit-delivery-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.fc-kd-step-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px;
}

.fc-kd-help-text {
    font-size: 13px;
    color: #666;
    margin: 0 0 14px;
}

.fc-kd-error-text {
    font-size: 13px;
    color: #d63638;
    margin: 0 0 10px;
    min-height: 0;
}

.fc-kd-error-text:empty {
    display: none;
}

.fc-kd-lookup-status {
    font-size: 13px;
    color: #666;
    margin: 6px 0 14px;
}

/* readonly (kit-delivery-panel.js — calendar-only entry, see that file's
   own comment on why), same convention as form.js's own
   input[readonly].fc-sibling-dob: without this it renders with the
   browser's default greyed-out readonly look, reading as "disabled"
   rather than "pick a date". */
.fc-kd-manual-dob[readonly] {
    background-color: #fff;
    cursor: pointer;
}

.fc-kd-delivery-charge-notice {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #FFF5F5;
    border: 1px solid #FFD6D6;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 0 0 14px;
}

/* Custom select dropdown — ported from form.css (Academy Registration
   Form widget) / initCustomSelects() in kit-delivery-panel.js. A native
   <select>'s open option list is rendered by the OS, not this stylesheet,
   so it can't be restyled at all — this replaces it with real, styleable
   markup instead (Emirate, Location, and each kid's Jersey/Socks Size).

   Deliberately scoped to the .fc-kit-delivery-panel CLASS here, not the
   #fc_kit_delivery_canvas ID every other rule in this file uses — the
   "Select Boxes" Elementor Style section (class-kit-delivery-widget.php)
   targets these same class names under the ID, and an ID-scoped selector
   always outranks a class-scoped one regardless of which stylesheet
   happens to load later. Using the ID here too, as the rest of this file
   does, put these defaults at the EXACT SAME specificity as that Style
   section — confirmed directly in DevTools: both
   "#fc_kit_delivery_canvas .fc-custom-select-option" rules (one from this
   file, one from Elementor's generated per-post CSS) matched, tied, and
   this file's own default was winning the tie purely because it loaded
   after Elementor's — silently no-op'ing the Select Typography control
   (and, by the same tie, its Border/Background/Padding/Hover controls
   too) no matter what an admin set there, on every device/breakpoint
   equally since specificity doesn't change per viewport. Scoping to the
   class instead keeps this properly namespaced to just this panel
   (the Tryout Form widget reuses these exact class names for its own,
   separate custom-select instances that can appear on the very same
   page) while guaranteeing the Elementor rule wins outright, by real
   specificity rather than load-order luck. */
.fc-kit-delivery-panel .fc-custom-select-wrapper {
    position: relative;
    width: 100%;
}

.fc-kit-delivery-panel .fc-select-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.fc-kit-delivery-panel .fc-custom-select-display {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    padding: 12px 40px 12px 12px;
    font-size: 16px;
    cursor: pointer;
}

.fc-kit-delivery-panel .fc-custom-select-display:hover {
    border-color: #E00007;
}

.fc-kit-delivery-panel .fc-custom-select-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1000;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fc-kit-delivery-panel .fc-custom-select-dropdown:visible {
    animation: fcKdDropdownSlide 0.15s ease-out;
}

@keyframes fcKdDropdownSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.fc-kit-delivery-panel .fc-custom-select-option {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.fc-kit-delivery-panel .fc-custom-select-option:last-child {
    border-bottom: none;
}

.fc-kit-delivery-panel .fc-custom-select-option:hover,
.fc-kit-delivery-panel .fc-custom-select-option.is-active {
    background-color: #E00007;
    color: #fff;
}

.fc-kd-btn {
    display: inline-block;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    margin: 4px 8px 4px 0;
}

.fc-kd-btn-primary {
    background: #E00007;
    color: #fff;
}

.fc-kd-btn-primary:hover {
    background: #B80006;
}

.fc-kd-btn-link {
    background: none;
    color: #034281;
    padding: 8px 0;
    text-decoration: underline;
}

.fc-kd-kit-type-options {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.fc-kd-kit-type-btn {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    background: #fafafa;
    cursor: pointer;
}

.fc-kd-kit-type-btn.is-selected {
    border-color: #E00007;
    background: #FFF5F5;
    color: #E00007;
}

.fc-kd-kid-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.fc-kd-kid-card .fc-kd-kid-remove {
    float: right;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 13px;
}

/* Without this, the floated remove button above squeezes the FIRST
   .fc-form-field sharing its vertical band down to whatever width is
   left beside it (confirmed directly: the Child's First Name field was
   rendering at ~90% width) — clearing every field in the card pushes
   all of them, First Name included, onto their own full-width row below
   the button instead of wrapping around it. */
.fc-kd-kid-card .fc-form-field {
    clear: both;
}

.fc-kd-kid-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.fc-kd-kid-checkbox-row:last-child {
    border-bottom: none;
}

.fc-kd-status-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
}

.fc-kd-status-delivered {
    color: #1a7d3a;
    background: #e6f6ea;
}

.fc-kd-status-progress {
    color: #b26a00;
    background: #fff3e0;
}

/* Shown briefly between the address step auto-submitting (no "Proceed to
   Checkout" button anymore — see kit-delivery-panel.js's own
   maybeAutoSubmitAddress()) and the Telr card box actually appearing. */
.fc-kd-payment-loading {
    font-size: 13px;
    color: #666;
    padding: 14px 0;
}

/* The address fields once auto-submit has fired — a real pending Order/
   Lead exists server-side by then, so they're frozen rather than left
   editable (see revealPaymentBox()'s own docblock on why Back also
   disappears at the same point). */
.fc-kd-address-section input:disabled,
.fc-kd-address-section select:disabled {
    background: #f5f5f5;
    color: #888;
    cursor: not-allowed;
}

/* Telr's own iframe integration docs recommend a minimum of 600x550 for
   the embedded payment page — width comes from whatever the Panel Width
   control is set to (100% of this section, up to that), height is fixed
   at their stated minimum regardless, so the card form is never cramped
   even on a narrower panel. */
.fc-kd-payment-section {
    margin: 0 -20px;
}

.fc-kd-payment-iframe {
    display: block;
    width: 100%;
    min-height: 550px;
    height: 70vh;
    border: 0;
}

@media (max-width: 480px) {
    .fc-kit-delivery-panel {
        width: 100%;
        max-width: 100%;
    }
}

/* iOS Safari's auto-zoom-on-focus is prevented while this panel is open
   via its own <meta name="viewport"> tag instead of a forced minimum
   font-size here (see lockViewportZoom()/restoreViewportZoom() in
   kit-delivery-panel.js) — an earlier version of this fix forced
   font-size: 16px !important on every field under 480px, which is what
   was silently overriding the widget's own Input Typography control on
   mobile no matter what an admin set it to (confirmed directly: the
   editor's mobile preview simply never changed). The viewport-tag
   approach works regardless of font-size, so nothing here needs to fight
   that control anymore. */
