/* Hide WooCommerce's built-in "Calculate shipping" link/form on the cart page.
   Shipping is calculated on checkout only — forcing customers to enter address
   there triggers abandoned cart capture. */
.woocommerce-cart .shipping-calculator-button,
.woocommerce-cart .shipping-calculator-form,
.woocommerce-cart .woocommerce-shipping-calculator {
    display: none !important;
}

/* Hide WooCommerce's default empty "Shipping" row on the cart page.
   We render our own custom row right after subtotal. */
.woocommerce-cart .cart_totals tr.shipping:not(.fragbox-cart-shipping-note) {
    display: none !important;
}

/* Our friendly "almost there!" message on the cart page. */
.fragbox-cart-shipping-note th {
    color: #1d4a23;
    font-weight: 600;
}

.fragbox-cart-almost-there {
    color: #2e8540;
    font-weight: 600;
    font-style: italic;
}

.fragbox-shipping-loader {
    display: block;
    padding: .85em 1em;
    margin: 1em 0;
    background: linear-gradient(135deg, #e7f3ff, #f0f8ff);
    border-left: 3px solid #2271b1;
    border-radius: 4px;
    font-size: .95em;
    color: #1d2327;
    transition: background 0.4s ease, border-color 0.4s ease, opacity 0.4s ease;
}

/* Success state: green gradient and border */
.fragbox-shipping-loader.fragbox-success-bg {
    background: linear-gradient(135deg, #e6f7ea, #d4f0dc);
    border-left-color: #2e8540;
}

.fragbox-shipping-loader.fragbox-fade-out {
    opacity: 0;
}

.fragbox-loader-inner {
    display: flex;
    align-items: center;
    gap: .6em;
}

/* Blue spinner for loading state */
.fragbox-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(34, 113, 177, 0.2);
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: fragbox-spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.fragbox-loading-text {
    font-weight: 500;
}

/* Green check for success state */
.fragbox-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #2e8540;
    color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
    animation: fragbox-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fragbox-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.fragbox-success-text {
    font-weight: 600;
    color: #1d4a23;
}

/* Rate note shown under each shipping option */
.fragbox-rate-note {
    display: block;
    margin-top: .3em;
    padding: .3em 0;
    font-size: .85em;
    font-style: italic;
    color: #50575e;
    line-height: 1.4;
}

/* Warning variant — amber background, bolder, not italic */
.fragbox-rate-note.fragbox-rate-warning {
    display: block;
    margin-top: .5em;
    padding: .6em .8em;
    background: #fff8e1;
    border-left: 3px solid #f0a020;
    border-radius: 3px;
    color: #5a3a00;
    font-style: normal;
    font-weight: 500;
    font-size: .9em;
}

/* Pickup variant — friendly light-green pill with an inline check. */
.fragbox-rate-note.fragbox-rate-pickup {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    margin-top: .4em;
    padding: .45em .75em;
    background: #e6f7ea;
    border-left: 3px solid #2e8540;
    border-radius: 3px;
    color: #1d4a23;
    font-style: normal;
    font-weight: 500;
    font-size: .9em;
}

.fragbox-rate-note.fragbox-rate-pickup .fragbox-inline-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #2e8540;
    color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
}
