/* FlyCustom Frontend */
.flycustom-fields {
    margin: 0 0 16px;
    /* Full row even inside flex/grid button containers (Bricks & Co):
       never sit next to the add-to-cart button */
    width: 100%;
    flex: 0 0 100%;
    box-sizing: border-box;
}

.flycustom-field {
    margin: 0 0 12px;
}

.flycustom-field > label {
    display: block;
    font-weight: 600;
    margin: 0 0 4px;
}

.flycustom-required {
    color: #d63638;
}

.flycustom-field input[type="text"],
.flycustom-field input[type="tel"],
.flycustom-field input[type="number"],
.flycustom-field select,
.flycustom-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    /* 16px minimum: iOS Safari zooms into inputs with font-size < 16px */
    font-size: 16px;
    line-height: 1.4;
    background: #fff;
    box-sizing: border-box;
}

.flycustom-field input:focus,
.flycustom-field select:focus,
.flycustom-field textarea:focus {
    border-color: #666;
    outline: none;
}

.flycustom-field input.flycustom-error,
.flycustom-field textarea.flycustom-error,
.flycustom-field select.flycustom-error {
    border-color: #d63638;
    box-shadow: 0 0 0 1px #d63638;
}

.flycustom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.flycustom-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.flycustom-maxlength {
    display: block;
    font-size: 12px;
    color: #777;
    margin-top: 2px;
}

/* ---------- Popup mode ---------- */

button.flycustom-popup-open {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin: 0;
    border: 2px dashed #999;
    border-radius: 8px;
    background: #fff;
    color: inherit;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    box-shadow: none;
    transition: border-color .15s ease, background .15s ease;
}

button.flycustom-popup-open:hover {
    border-color: #333;
    background: #fafafa;
}

.flycustom-popup-summary {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #1a7f37;
}

body.flycustom-modal-open {
    overflow: hidden;
}

.flycustom-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.flycustom-modal[hidden] {
    display: none;
}

.flycustom-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
}

.flycustom-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.flycustom-modal-dialog button.flycustom-modal-close {
    /* appearance reset: iOS Safari renders its own button chrome otherwise
       (broken circle, wrong colors) */
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    max-width: 34px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: none;
    text-shadow: none;
}

.flycustom-modal-dialog button.flycustom-modal-close:hover {
    background: rgba(0, 0, 0, .75);
    color: #fff;
}

.flycustom-preview {
    position: relative;
    margin: 0 0 16px;
    border-radius: 8px;
    overflow: hidden;
}

.flycustom-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.flycustom-overlay {
    position: absolute;
    white-space: nowrap;
    pointer-events: none;
    font-weight: 400;
    line-height: 1.1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
    will-change: contents;
}

.flycustom-overlay.is-ghost {
    opacity: .45;
}

.flycustom-modal-fields {
    margin: 0 0 16px;
}

.flycustom-modal-dialog button.flycustom-modal-save {
    /* appearance reset: iOS Safari otherwise applies native button styling
       (auto width -> button not centered/full-width on mobile) */
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    max-width: none;
    padding: 13px 16px;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: #1a7f37;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: none;
}

.flycustom-modal-dialog button.flycustom-modal-save:hover {
    background: #156b2e;
    color: #fff;
}
