/**
 * Engoory Gpost checkout UI.
 * Theme-neutral by default; only GPost-owned elements are styled.
 * Compatible with classic WooCommerce/WoodMart and CheckoutWC.
 */
:root {
    --gpost-accent: #0877a8;
    --gpost-danger: #b42318;
    --gpost-border: rgba(15, 23, 42, .13);
    --gpost-shadow: 0 14px 38px rgba(15, 23, 42, .14);
}

.gpost-label-inline {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    line-height: 1.25;
    max-width: 100%;
    min-width: 0;
    vertical-align: middle;
    white-space: nowrap;
}

.gpost-label-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gpost-label-price,
.gpost-label-price .woocommerce-Price-amount {
    display: inline-flex;
    flex: 0 0 auto;
    white-space: nowrap;
}

.woocommerce-gpost-logo-mark {
    background: url('../gpost.svg') center/contain no-repeat;
    display: inline-block;
    flex: 0 0 42px;
    height: 19px;
    width: 42px;
}

/* Use the browser's native title tooltip. It cannot cover/disable adjacent methods. */
.gpost-help-tip {
    align-items: center;
    border: 1px solid rgba(8, 119, 168, .35);
    border-radius: 50%;
    color: var(--gpost-accent);
    cursor: help;
    display: inline-flex;
    flex: 0 0 18px;
    font-size: 11px;
    font-weight: 700;
    height: 18px;
    justify-content: center;
    line-height: 1;
    margin-inline-start: 2px;
    width: 18px;
}
.gpost-help-tip::after { content: "i"; }

.gpost-city-input { transition: border-color .15s ease, box-shadow .15s ease; }
.gpost-invalid-input {
    border-color: var(--gpost-danger) !important;
    box-shadow: 0 0 0 2px rgba(180, 35, 24, .10) !important;
}
.gpost-error-message {
    clear: both;
    color: var(--gpost-danger);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 5px;
}

.gpost-matching-cities-options {
    background: rgba(255, 255, 255, .98);
    border: 1px solid var(--gpost-border);
    border-radius: 12px;
    box-shadow: var(--gpost-shadow);
    box-sizing: border-box;
    max-height: 280px;
    opacity: 0;
    overflow: auto;
    padding: 5px;
    position: absolute;
    transform: translateY(-3px);
    transition: opacity .12s ease, transform .12s ease;
    z-index: 100000;
}
.gpost-matching-cities-options.gpost-dropdown-ready { opacity: 1; transform: none; }
.gpost-city-option,
.gpost-city-option[type="button"] {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 12px;
    justify-content: space-between;
    margin: 0;
    min-height: 38px;
    padding: 9px 10px;
    text-align: start;
    text-transform: none;
    width: 100%;
}
.gpost-city-option:hover,
.gpost-city-option:focus,
.gpost-city-option.is-active {
    background: rgba(8, 119, 168, .08);
    outline: none;
}
.gpost-city-option > span:last-child { color: var(--gpost-accent); opacity: .65; }

.gpost-free-shipping-notice {
    color: #087052;
    display: block;
    font-size: 12px;
    line-height: 1.35;
    margin-top: 5px;
}

/* CheckoutWC owns the full-row flex layout; GPost only fills its label area. */
.checkoutwc input.shipping_method[value^="gpost_courier_shipping_method"] + label,
main.checkoutwc input.shipping_method[value^="gpost_courier_shipping_method"] + label {
    align-items: center !important;
    display: flex !important;
    min-width: 0 !important;
}

/* WoodMart/classic WooCommerce: never override the theme's radio/row layout. */
.woocommerce-shipping-methods input.shipping_method[value^="gpost_courier_shipping_method"] + label .gpost-label-inline,
#shipping_method input.shipping_method[value^="gpost_courier_shipping_method"] + label .gpost-label-inline {
    display: inline-flex;
}

@media (max-width: 480px) {
    .gpost-label-inline { gap: 6px; }
    .woocommerce-gpost-logo-mark { flex-basis: 36px; height: 17px; width: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    .gpost-city-input,
    .gpost-matching-cities-options { transition: none; }
}
