/**
 * g-FFL Checkout - Block Checkout Styles
 *
 * Layout adjustments for the FFL widget and document upload
 * when rendered inside the WooCommerce block-based checkout.
 */

/* FFL section wrapper */
.ffl-block-checkout-section {
    margin: 20px 0;
    padding: 0;
    width: 100%;
    clear: both;
}

/* Ensure the FFL container fills the available width */
#ffl-block-checkout-wrapper #ffl_container {
    width: 100%;
}

/* Override widget styles that may conflict with block checkout layout */
#ffl-block-checkout-wrapper .content {
    max-width: 100%;
}

#ffl-block-checkout-wrapper #ffl_container,
#ffl-block-checkout-wrapper #ffl_container * {
    box-sizing: border-box;
}

#ffl-block-checkout-wrapper #ffl_search_fields {
    width: 100%;
}

#ffl-block-checkout-wrapper #ffl_search_fields .ffl_checkout_columns {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) minmax(140px, 1fr);
    gap: 10px;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
    padding-bottom: 10px !important;
}

#ffl-block-checkout-wrapper #ffl_search_fields .ffl_checkout_columns + .ffl_checkout_columns {
    grid-template-columns: 1fr;
}

#ffl-block-checkout-wrapper #ffl_search_fields .ffl_checkout_column {
    min-width: 0;
    margin: 0;
}

#ffl-block-checkout-wrapper #ffl-zip-code,
#ffl-block-checkout-wrapper #ffl-radius,
#ffl-block-checkout-wrapper #ffl-search,
#ffl-block-checkout-wrapper #ffl-name-search,
#ffl-block-checkout-wrapper #ffl-favorite-search,
#ffl-block-checkout-wrapper #ffl-local-pickup-search {
    width: 100% !important;
    min-width: 0;
    height: 48px;
    margin: 0;
    font-size: 16px;
    line-height: 1.25;
}

#ffl-block-checkout-wrapper #ffl-search,
#ffl-block-checkout-wrapper #ffl-favorite-search,
#ffl-block-checkout-wrapper #ffl-local-pickup-search {
    display: block;
    padding: 0 16px;
    text-align: center !important;
}

#ffl-block-checkout-wrapper #ffl-candr-section {
    margin: 0 0 16px !important;
    padding: 12px !important;
    border: 1px solid #dcdcde !important;
    border-radius: 4px;
    background: #fff !important;
    text-align: left;
}

#ffl-block-checkout-wrapper #ffl-candr-section > .ffl_checkout_columns:first-child {
    display: flex;
    gap: 12px;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 0 10px !important;
}

#ffl-block-checkout-wrapper #ffl-candr-section > .ffl_checkout_columns:first-child .ffl_checkout_column {
    flex: 0 1 auto;
    width: auto !important;
    margin: 0;
    color: #1e1e1e !important;
    font-size: 16px;
    line-height: 1.35;
}

#ffl-block-checkout-wrapper #ffl-candr-section > .ffl_checkout_columns:first-child .ffl_checkout_column:last-child {
    color: #50575e !important;
    font-size: 14px;
}

#ffl-block-checkout-wrapper #ffl-candr-inner-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px !important;
    border: 1px solid #dcdcde !important;
    border-radius: 4px;
    background: #f6f7f7 !important;
}

#ffl-block-checkout-wrapper #ffl-candr-inner-section .ffl_checkout_column {
    min-width: 0;
    width: auto !important;
    margin: 0;
}

#ffl-block-checkout-wrapper #ffl-candr-inner-section .ffl_checkout_column:nth-child(2) {
    grid-column: 1 / -1;
    order: 1;
}

#ffl-block-checkout-wrapper #candr_upload_section {
    grid-column: 1;
    order: 2;
}

#ffl-block-checkout-wrapper #ffl-candr-inner-section .ffl_checkout_column:nth-child(3) {
    grid-column: 2;
    order: 3;
    justify-self: end;
}

#ffl-block-checkout-wrapper #candrUploadLable {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 110px;
    min-height: 38px;
    margin: 0;
    padding: 7px 12px;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap !important;
    cursor: pointer;
    border: 1px solid #3f3734 !important;
    border-radius: 5px;
    background: #3f3734 !important;
    color: #eeeeee !important;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

#ffl-block-checkout-wrapper #candr_license_number {
    width: 100% !important;
    min-width: 0;
    height: 38px;
    margin: 0;
    padding: 7px 10px;
    font-size: 14px;
    line-height: 1.3;
}

#ffl-block-checkout-wrapper #ffl-candr-override {
    width: auto !important;
    min-width: 110px;
    max-width: 100%;
    height: 38px;
    margin: 0;
    padding: 7px 14px;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
    justify-self: end;
}

@media (min-width: 769px) and (max-width: 1100px) {
    #ffl-block-checkout-wrapper #ffl-candr-inner-section {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

#ffl-block-checkout-wrapper #ffl-map {
    max-width: 100%;
    border-radius: 4px;
}

/* Document upload section in block checkout */
#ffl-block-document-upload-wrapper {
    margin-top: 10px;
}

#ffl-block-document-upload-wrapper .ffl-document-section {
    border-radius: 4px;
}

/* Place order notice styling */
#ffl-block-checkout-notice {
    font-size: 14px;
    line-height: 1.5;
}

/* Hide hidden fields */
#ffl-block-checkout-wrapper input[type="hidden"] {
    display: none;
}

/* Responsive adjustments for block checkout grid */
@media (max-width: 768px) {
    .ffl-block-checkout-section {
        margin: 15px 0;
    }

    #ffl-block-checkout-wrapper #ffl_container .ffl-list-container {
        max-height: 250px;
    }

    #ffl-block-checkout-wrapper #ffl_search_fields .ffl_checkout_columns {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #ffl-block-checkout-wrapper #ffl-candr-section > .ffl_checkout_columns:first-child {
        display: block;
    }

    #ffl-block-checkout-wrapper #ffl-candr-section > .ffl_checkout_columns:first-child .ffl_checkout_column:last-child {
        margin-top: 2px;
        text-align: left !important;
    }

    #ffl-block-checkout-wrapper #ffl-candr-inner-section {
        grid-template-columns: 1fr;
    }

    #ffl-block-checkout-wrapper #candr_upload_section,
    #ffl-block-checkout-wrapper #ffl-candr-inner-section .ffl_checkout_column:nth-child(3) {
        grid-column: 1;
        justify-self: stretch;
    }

    #ffl-block-checkout-wrapper #candrUploadLable,
    #ffl-block-checkout-wrapper #ffl-candr-override {
        width: 100% !important;
    }
}
