/* ==========================================================================
   Closing Options Section — scoped to .ipb-closing-settings
   ========================================================================== */

/* Reset inherited pill/card styles */
.ipb-closing-settings .input_fields {
    display: block;
    height: auto;
    margin: 0;
    gap: 0;
}

.ipb-closing-settings .input_fields .fields {
    display: none;
}

/* Row layout */
.ipb-closing-settings .ipb-closing-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.ipb-closing-settings .ipb-closing-row:last-child {
    margin-bottom: 0;
}

/* Label column */
.ipb-closing-settings .ipb-closing-label label {
    font-size: 14px;
    font-weight: 600;
    color: #1e1f21;
    margin: 0;
}

/* Control column */
.ipb-closing-settings .ipb-closing-control {
    display: flex;
    align-items: center;
}

/* Inline checkboxes (ESC + Outside on same row) */
.ipb-closing-settings .ipb-closing-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

/* Checkbox + label pairs */
.ipb-closing-settings .ipb-closing-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    color: #2c3338;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.ipb-closing-settings .ipb-closing-check input[type="checkbox"] {
    appearance: auto;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

/* Dropdown styling */
.ipb-closing-settings .ipb-closing-control select {
    width: 100%;
    max-width: 280px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    color: #2c3338;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

.ipb-closing-settings .ipb-closing-control select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* Hide the old input_field_sel wrapper since we replaced it */
.ipb-closing-settings .input_field_sel {
    display: none;
}

.ipb-closing-settings .ipb-upsell-card {
    margin-top: 14px;
}

/* Advanced Closing extension
 *
 * The extension injects its controls into the core Closing form. Keep those
 * controls on the same label/control grid as the native settings and override
 * the legacy inline presentation used by older extension releases.
 */
.ipb-closing-settings .ipb-adv-closing {
    margin-top: 24px !important;
    padding-top: 0 !important;
    border: 1px solid #e2e4e7 !important;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.ipb-closing-settings .ipb-adv-closing > h3 {
    margin: 0 !important;
    padding: 14px 20px !important;
    border: 0 !important;
    border-bottom: 1px solid #e2e4e7 !important;
    background: #f0f0f1;
    color: #1e1f21;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    cursor: default;
}

.ipb-closing-settings .ipb-adv-closing > h3::after {
    display: none;
}

.ipb-closing-settings .ipb-adv-closing > .fields {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 8px 16px;
    align-items: center;
    margin: 0;
    padding: 16px 20px !important;
    border: 0 !important;
    border-bottom: 1px solid #e2e4e7 !important;
    background: #fff !important;
    box-sizing: border-box;
}

.ipb-closing-settings .ipb-adv-closing > .fields:last-child {
    border-bottom: 0 !important;
}

.ipb-closing-settings .ipb-adv-closing > .fields > label:first-child {
    color: #1e1f21;
    font-size: 14px;
    font-weight: 600 !important;
    line-height: 1.4;
}

.ipb-closing-settings .ipb-adv-closing select,
.ipb-closing-settings .ipb-adv-closing input[type="text"],
.ipb-closing-settings .ipb-adv-closing input[type="number"] {
    width: 100% !important;
    max-width: 280px;
    min-height: 40px;
    margin: 0 !important;
    padding: 0 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    color: #2c3338;
    font-size: 14px;
    box-sizing: border-box;
}

.ipb-closing-settings .ipb-adv-closing select:focus,
.ipb-closing-settings .ipb-adv-closing input[type="text"]:focus,
.ipb-closing-settings .ipb-adv-closing input[type="number"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.ipb-closing-settings .ipb-adv-closing input[type="checkbox"] {
    appearance: auto;
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
    position: static;
    vertical-align: middle;
}

.ipb-closing-settings .ipb-adv-closing input[type="checkbox"]::before {
    content: none !important;
}

.ipb-closing-settings .ipb-adv-closing > .fields > label:only-child {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    color: #2c3338;
    font-weight: 400 !important;
}

.ipb-closing-settings .ipb-adv-closing > .fields > div {
    grid-column: 2;
    margin-top: 0 !important;
}

.ipb-closing-settings .ipb-adv-closing > .fields > input[type="number"] + label {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    margin: 0 !important;
}

.ipb-closing-settings .ipb-adv-closing .description {
    margin: 6px 0 0 !important;
    color: #646970 !important;
    font-size: 12px !important;
    line-height: 1.5;
}

.ipb-closing-settings .ipb-adv-closing .ipb-adv-info {
    width: 16px !important;
    height: 16px !important;
    margin-left: 6px !important;
    border: 1px solid #8c8f94;
    background: #fff !important;
    color: #646970 !important;
    line-height: 14px !important;
    box-sizing: border-box;
}

.ipb-closing-settings .ipb-adv-closing .button {
    min-height: 40px;
    margin-left: 6px;
    vertical-align: top;
}

.ipb-closing-settings .ipb-adv-color-field,
.ipb-closing-settings .ipb-adv-countdown-color {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 10px !important;
}

.ipb-closing-settings .ipb-adv-color-field > label,
.ipb-closing-settings .ipb-adv-countdown-color > label {
    min-width: 155px;
    color: #2c3338;
    font-size: 13px;
    font-weight: 500;
}

.ipb-closing-settings .ipb-adv-closing .wp-picker-container {
    display: inline-block;
}

/* Reset wrapper spacing */
.ipb-closing-settings .closing_option,
.ipb-closing-settings .inner_wrapper,
.ipb-closing-settings .form_wrapper {
    padding: 0;
    margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 782px) {
    .ipb-closing-settings .ipb-closing-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ipb-closing-settings .ipb-closing-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ipb-closing-settings .ipb-closing-control select {
        max-width: 100%;
    }

    .ipb-closing-settings .ipb-adv-closing > .fields {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px !important;
    }

    .ipb-closing-settings .ipb-adv-closing > .fields > label:only-child,
    .ipb-closing-settings .ipb-adv-closing > .fields > div,
    .ipb-closing-settings .ipb-adv-closing > .fields > input[type="number"] + label {
        grid-column: 1;
    }

    .ipb-closing-settings .ipb-adv-closing select,
    .ipb-closing-settings .ipb-adv-closing input[type="text"],
    .ipb-closing-settings .ipb-adv-closing input[type="number"] {
        max-width: 100%;
    }

    .ipb-closing-settings .ipb-adv-closing .button {
        margin: 8px 6px 0 0;
    }
}
