/* ===== Pigeon Express – Block Checkout Fields ===== */

.pigeon-block-wrap {
    margin-top: 16px;
}

/* Header */
.pigeon-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.pigeon-block-icon {
    font-size: 18px;
    line-height: 1;
}

.pigeon-block-logo {
    height: 30px;
    width: auto;
    display: block;
}

.pigeon-block-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
    letter-spacing: 0;
    text-transform: none;
}

/* ---- Delivery-type tabs ---- */
.pigeon-shipping-to-label {
    display: block;
    margin-bottom: 6px;
}

.pigeon-block-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.pigeon-block-tab {
    flex: 1 1 0;
    min-width: 96px;
    box-sizing: border-box;
    padding: 10px 8px;
    background: #f5f7fa;
    border: 1.5px solid #d7dce5;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    color: #00327D;
    transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}

.pigeon-block-tab:hover {
    border-color: #FF8C12;
    background: #fff4e8;
}

.pigeon-block-tab .pigeon-type-icon {
    color: inherit;
    line-height: 0;
}

.pigeon-block-tab .pigeon-type-svg {
    display: block;
}

.pigeon-block-tab .pigeon-type-label {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.pigeon-block-tab.is-active {
    background: #F47920;
    border-color: #F47920;
    color: #fff;
    box-shadow: 0 2px 6px rgba(244, 121, 32, .35);
}

/* ---- Fields wrapper ---- */
.pigeon-block-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---- Generic field row ---- */
.pigeon-block-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pigeon-block-label {
    font-size: 13px;
    font-weight: 500;
    color: #1e1e1e;
    line-height: 1.4;
}

.pigeon-block-required {
    color: #cc1818;
    text-decoration: none !important;
    border: none !important;
    margin-left: 3px;
    font-style: normal;
}

/* ---- Plain text input ---- */
.pigeon-block-text-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    color: #1e1e1e;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.pigeon-block-text-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* ---- Select2-style autocomplete (city) ---- */
.pigeon-block-select2 {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    transition: border-color .15s, box-shadow .15s;
}

.pigeon-block-select2:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.pigeon-block-select2.has-value {
    border-color: #2271b1;
}

.pigeon-block-select2__input {
    flex: 1;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    color: #1e1e1e;
    background: transparent;
    border: none;
    outline: none;
    min-width: 0;
}

.pigeon-block-select2__input::placeholder {
    color: #8c8f94;
}

/* arrow / clear / spinner inside the box */
.pigeon-block-select2__arrow,
.pigeon-block-select2__clear {
    flex-shrink: 0;
    padding: 0 10px;
    font-size: 13px;
    color: #8c8f94;
    user-select: none;
}

.pigeon-block-select2__clear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #8c8f94;
    padding: 0 10px;
    transition: color .1s;
}

.pigeon-block-select2__clear:hover {
    color: #cc1818;
}

/* dropdown list */
.pigeon-block-select2__dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: -1px;
    right: -1px;
    z-index: 99999;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #2271b1;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    max-height: 220px;
    overflow-y: auto;
}

.pigeon-block-select2__option {
    padding: 9px 14px;
    font-size: 13.5px;
    color: #1e1e1e;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
    transition: background .1s;
}

.pigeon-block-select2__option:last-child {
    border-bottom: none;
}

.pigeon-block-select2__option:hover {
    background: #f0f6fc;
    color: #135e96;
}

.pigeon-block-select2__no-results {
    padding: 10px 14px;
    font-size: 13px;
    color: #8c8f94;
    font-style: italic;
}

/* ---- Selected value display (non-editing state) ---- */
.pigeon-block-select2__display {
    flex: 1;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    color: #1e1e1e;
    line-height: 40px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.pigeon-block-select2__placeholder {
    color: #8c8f94;
}

/* Disabled state */
.pigeon-block-select2.is-disabled {
    background: #f6f7f7;
    border-color: #c3c4c7;
    cursor: not-allowed;
}

.pigeon-block-select2.is-disabled .pigeon-block-select2__display,
.pigeon-block-select2.is-disabled .pigeon-block-select2__placeholder {
    color: #8c8f94;
    cursor: not-allowed;
}

/* Arrow rotation when open */
.pigeon-block-select2__arrow.is-open {
    transform: rotate(180deg);
    transform-origin: center;
}

/* Selected option highlight in dropdown */
.pigeon-block-select2__option.is-selected {
    background: #f0f6fc;
    color: #135e96;
    font-weight: 500;
}

/* ---- Spinner ---- */
.pigeon-block-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #c3c4c7;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: pigeon-block-spin .7s linear infinite;
    flex-shrink: 0;
    margin: 0 8px;
}

.pigeon-block-select2-wrap .pigeon-block-spinner {
    position: absolute;
    right: 12px;
    pointer-events: none;
}

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

/* ---- Validation error ---- */
.pigeon-block-error {
    font-size: 12px;
    color: #cc1818;
    margin-top: 2px;
}

/* ---- Responsive ---- */
@media ( max-width: 480px ) {
    .pigeon-block-tabs {
        gap: 6px;
    }
    .pigeon-block-tab {
        padding: 7px 8px;
        font-size: 12px;
    }
}

/* ---------------------------------------------------------------
   Hide WC address fields when Pigeon Express is selected
   Uses *= (contains) because WC blocks prefixes autocomplete values
   with the section name, e.g. "billing address-line1"
--------------------------------------------------------------- */

/* Billing address fields */
body.pigeon-express-active .wc-block-checkout__billing-fields .wc-block-components-address-form div:has([autocomplete*="address-line1"]),
body.pigeon-express-active .wc-block-checkout__billing-fields .wc-block-components-address-form div:has([autocomplete*="address-line2"]),
body.pigeon-express-active .wc-block-checkout__billing-fields .wc-block-components-address-form div:has([autocomplete*="address-level2"]),
body.pigeon-express-active .wc-block-checkout__billing-fields .wc-block-components-address-form div:has([autocomplete*="postal-code"]),
body.pigeon-express-active .wc-block-checkout__billing-fields .wc-block-components-address-form div:has([autocomplete*="country"]),
body.pigeon-express-active .wc-block-checkout__billing-fields .wc-block-components-address-form div:has([autocomplete*="address-level1"]) { display: none !important; }

/* "Add apartment…" toggle (actual WC class: …address-form__address_2-toggle) */
body.pigeon-express-active .wc-block-checkout__billing-fields  [class*="address_2-toggle"],
body.pigeon-express-active .wc-block-checkout__billing-fields  [class*="address2-toggle"],
body.pigeon-express-active .wc-block-checkout__billing-fields  [class*="address-2-toggle"] { display: none !important; }

/* Shipping address fields */
body.pigeon-express-active .wc-block-checkout__shipping-fields .wc-block-components-address-form div:has([autocomplete*="address-line1"]),
body.pigeon-express-active .wc-block-checkout__shipping-fields .wc-block-components-address-form div:has([autocomplete*="address-line2"]),
body.pigeon-express-active .wc-block-checkout__shipping-fields .wc-block-components-address-form div:has([autocomplete*="address-level2"]),
body.pigeon-express-active .wc-block-checkout__shipping-fields .wc-block-components-address-form div:has([autocomplete*="postal-code"]),
body.pigeon-express-active .wc-block-checkout__shipping-fields .wc-block-components-address-form div:has([autocomplete*="country"]),
body.pigeon-express-active .wc-block-checkout__shipping-fields .wc-block-components-address-form div:has([autocomplete*="address-level1"]) { display: none !important; }

body.pigeon-express-active .wc-block-checkout__shipping-fields [class*="address_2-toggle"],
body.pigeon-express-active .wc-block-checkout__shipping-fields [class*="address2-toggle"],
body.pigeon-express-active .wc-block-checkout__shipping-fields [class*="address-2-toggle"] { display: none !important; }

/* Catch-all: the toggle anywhere inside the checkout block (e.g. combined
   "Billing and shipping address" section) */
body.pigeon-express-active .wp-block-woocommerce-checkout [class*="address_2-toggle"] { display: none !important; }

/* Office locator map */
.pigeon-block-map {
    width: 100%;
    height: 320px;
    margin-top: 12px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
}

/* Price badge inside delivery type tabs */
.pigeon-block-tab .pigeon-tab-price {
    display: block;
    font-size: 12px;
    font-weight: 700;
    opacity: 0.95;
}

/* ---- Saved address summary + pencil edit link ---- */
.pigeon-block-wrap .pigeon-saved-address {
    position: relative;
    padding: 4px 0;
    margin-bottom: 6px;
    line-height: 1.7;
    font-size: 13.5px;
}

.pigeon-block-wrap .pigeon-saved-address strong {
    color: #00327D;
}

.pigeon-block-wrap a.pigeon-edit-link {
    width: 16px;
    height: 0;
    padding: 16px 0 0;
    margin: 0 0 0 8px;
    overflow: hidden;
    position: relative;
    color: #999;
    border: 0;
    float: right;
    text-decoration: none;
    box-shadow: none;
}

.pigeon-block-wrap a.pigeon-edit-link::after {
    font-family: Dashicons;
    content: '\f464';
    position: absolute;
    top: 0;
    left: 0;
    text-align: center;
    line-height: 16px;
    font-size: 16px;
    font-weight: 400;
}

.pigeon-block-wrap a.pigeon-edit-link:hover {
    color: #FF8C12;
}

.pigeon-saved-clickable {
    cursor: pointer;
}
