/*
 * TNS WooCommerce Shipping Gate v1.0.2
 * Production-facing UI copy and styles are intentionally in English.
 */

/* Keep the native WooCommerce shipping calculator permanently expanded. */
.woocommerce-cart .shipping-calculator-button {
    display: none !important;
}

.woocommerce-cart .shipping-calculator-form {
    display: block !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tns-wcsg-calculator-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.025);
    line-height: 1.45;
}

.tns-wcsg-calculator-heading strong {
    font-weight: 700;
}

.tns-wcsg-calculator-heading span {
    font-size: 0.94em;
}

.tns-wcsg-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-left-width: 4px;
    border-radius: 4px;
    line-height: 1.4;
}

.tns-wcsg-status--instruction {
    border-left-color: #8a6d3b;
    background: #fffaf0;
}

.tns-wcsg-status--success {
    border-left-color: #2f7d32;
    background: #f4fbf4;
}

.tns-wcsg-status--error {
    border-left-color: #b42318;
    background: #fff5f4;
}

.tns-wcsg-status--loading {
    border-left-color: #4a5568;
    background: #f7f8fa;
}

.tns-wcsg-status__message {
    flex: 1 1 auto;
}

.tns-wcsg-reload-button {
    flex: 0 0 auto;
    border: 1px solid currentColor;
    border-radius: 3px;
    background: transparent;
    padding: 7px 11px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.tns-wcsg-reload-button[hidden] {
    display: none !important;
}

/* JS controls the visual state. PHP independently blocks direct checkout access. */
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button.tns-wcsg-checkout-disabled,
.woocommerce-cart a.checkout-button.wc-forward.tns-wcsg-checkout-disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    filter: grayscale(1);
}

.tns-wcsg-field-error {
    border-color: #b42318 !important;
    outline: 1px solid #b42318 !important;
    outline-offset: 0;
}

.woocommerce-cart form.woocommerce-shipping-calculator button.tns-wcsg-button-loading {
    opacity: 0.75;
    cursor: progress;
}

@media (max-width: 767px) {
    .tns-wcsg-status {
        align-items: stretch;
        flex-direction: column;
    }

    .tns-wcsg-reload-button {
        width: 100%;
    }
}
