.agenwebsite-hide {
    display: none !important;
}

#agenwebsite_billing_city_field .optional {
    display: none;
}

.wc-block-components-agenwebsite_shipping_city-form__agenwebsite_shipping_city .select2-container {
    border: 0;
    font-size: 1em;
    padding: 1.5em .5em 0;
    margin: 0;
}

.wc-block-components-agenwebsite_shipping_city-form__agenwebsite_shipping_city .select2-container--default.select2-container--focus .select2-selection--multiple,
.wc-block-components-agenwebsite_shipping_city-form__agenwebsite_shipping_city .select2-container .select2-dropdown, .wc-block-components-agenwebsite_shipping_city-form__agenwebsite_shipping_city .select2-container .select2-selection{
    border: 0;
}

.wc-block-components-agenwebsite_shipping_city-form__agenwebsite_shipping_city {
    border: 1px solid hsla(0,0%,7%,.8);
    border-radius: 4px;
    flex: 0 0 100% !important;
    padding-bottom: 5px;
}

.wc-block-components-agenwebsite_shipping_city-form__agenwebsite_shipping_city .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0;
}

.agenwebsite-warning-message {
    background: #fef5f5;
    border: 1px solid #e74c3c;
    color: #721c24;
    padding: 1em;
    margin: 1em 0;
    border-radius: 2px;
}

.agenwebsite-warning-message a {
    color: blue;
    text-decoration: underline;
}

/* =============================================
   City Search Popup Styles - Theme-Proof
   Using specific selectors to prevent theme overrides
   ============================================= */

/* Root overlay - highest specificity with !important for critical styles */
#aw-city-popup-overlay.aw-city-popup-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(44, 62, 80, 0.5) !important;
    z-index: 999999 !important;
    opacity: 1;
    visibility: visible;
    transition: none;
    display: none !important;
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#aw-city-popup-overlay.aw-city-popup-overlay.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Main popup container */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    border: 1px solid #d1d8dd !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    max-width: 500px !important;
    width: 90% !important;
    height: 70vh !important;
    max-height: 600px !important;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000000 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5 !important;
    color: #333333 !important;
    overflow: hidden !important;
}

#aw-city-popup-overlay.aw-city-popup-overlay.show .aw-city-popup {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

/* Popup header */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-header {
    display: block !important;
    padding: 20px 20px 15px !important;
    border-bottom: 1px solid #e5e7eb !important;
    position: relative !important;
    flex: none !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    font-family: inherit;
}

/* Popup title */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-title {
    display: block !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937 !important;
    font-family: inherit;
    line-height: 1.3 !important;
}

/* Close button */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    width: 32px !important;
    height: 32px !important;
    background: #f3f4f6 !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 20px;
    cursor: pointer !important;
    color: #6b7280 !important;
    padding: 0 !important;
    line-height: 32px !important;
    text-align: center !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
    font-family: inherit;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-close:hover {
    background: #e5e7eb !important;
    color: #1f2937 !important;
}

#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-close:focus {
    outline: 2px solid #4a90e2 !important;
    outline-offset: 2px !important;
}

/* Search input */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-search-input {
    display: block !important;
    width: 100% !important;
    padding: 12px 16px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 16px;
    outline: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    color: #1f2937 !important;
    font-family: inherit;
    line-height: 1.5 !important;
}

#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-search-input:focus {
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15) !important;
}

#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-search-input::placeholder {
    color: #9ca3af !important;
}

/* Popup body */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-body {
    display: block !important;
    padding: 0 !important;
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

/* Results list */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-results {
    display: block !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
}

/* Result item */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-result-item {
    display: block !important;
    padding: 14px 20px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    font-family: inherit;
}

#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-result-item:hover {
    background-color: #f9fafb !important;
}

#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-result-item:last-child {
    border-bottom: none !important;
}

/* Result text */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-result-text {
    display: block !important;
    font-size: 14px;
    color: #374151 !important;
    line-height: 1.5 !important;
    cursor: pointer;
}

/* Loading state */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-loading {
    display: block !important;
    text-align: center !important;
    padding: 40px 20px !important;
    color: #6b7280 !important;
    font-family: inherit;
    font-size: 14px;
}

#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-loading-spinner {
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #e5e7eb !important;
    border-top-color: #4a90e2 !important;
    border-radius: 50% !important;
    animation: aw-city-spin 0.8s linear infinite !important;
    margin-right: 10px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

@keyframes aw-city-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No results state */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-no-results {
    display: block !important;
    text-align: center !important;
    padding: 40px 20px !important;
    color: #6b7280 !important;
    font-style: italic !important;
    font-family: inherit;
    font-size: 14px;
}

/* Input trigger styles */
.aw-city-input-trigger {
    cursor: pointer !important;
    position: relative !important;
    font-size: 16px !important; /* Prevents zoom on iOS when tapped */
}

.aw-city-input-trigger:after {
    content: 'ðŸ”' !important;
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    opacity: 0.6 !important;
}

/* Mobile Compatibility - Theme-Proof */
@media (max-width: 768px) {
    #aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup {
        width: 95% !important;
        height: 80vh !important;
        max-height: none !important;
        top: 10vh !important;
        transform: translateX(-50%) scale(0.9) !important;
    }

    #aw-city-popup-overlay.aw-city-popup-overlay.show .aw-city-popup {
        transform: translateX(-50%) scale(1) !important;
    }

    #aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-header {
        padding: 15px 15px 12px !important;
    }

    #aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-title {
        font-size: 16px;
        margin-bottom: 10px !important;
        padding-right: 30px !important;
    }

    #aw-city-popup-overlay.aw-city-popup-overlay .aw-city-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 14px !important;
    }

    #aw-city-popup-overlay.aw-city-popup-overlay .aw-city-result-item {
        padding: 12px 15px !important;
    }

    #aw-city-popup-overlay.aw-city-popup-overlay .aw-city-result-text {
        font-size: 13px;
    }

    #aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-close {
        top: 12px !important;
        right: 12px !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 18px;
        line-height: 28px !important;
    }
}

@media (max-width: 480px) {
    #aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        border: none !important;
    }

    #aw-city-popup-overlay.aw-city-popup-overlay.show .aw-city-popup {
        transform: none !important;
    }
}

/* =============================================
   Cart Page City Popup Field Styles - Theme-Proof
   ============================================= */
.aw-cart-city-field-wrapper {
    margin-bottom: 15px !important;
    padding: 15px !important;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
}

.aw-cart-city-field-wrapper label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600;
    color: #374151 !important;
    font-size: 14px;
}

.aw-cart-city-field-wrapper .aw-cart-city-input {
    width: 100% !important;
    padding: 12px 40px 12px 15px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    font-size: 14px;
    cursor: pointer !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    box-sizing: border-box !important;
    color: #1f2937 !important;
    line-height: 1.5 !important;
}

.aw-cart-city-field-wrapper .aw-cart-city-input:hover {
    border-color: #9ca3af !important;
}

.aw-cart-city-field-wrapper .aw-cart-city-input:focus {
    border-color: #4a90e2 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15) !important;
}

.aw-cart-city-field-wrapper .aw-cart-city-input::placeholder {
    color: #9ca3af !important;
}

/* Cart City Input Trigger Icon */
.aw-cart-city-field-wrapper .aw-cart-city-input.aw-city-input-trigger {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
}

/* Mobile adjustments for cart city field */
@media (max-width: 768px) {
    .aw-cart-city-field-wrapper {
        padding: 12px !important;
    }

    .aw-cart-city-field-wrapper .aw-cart-city-input {
        padding: 10px 35px 10px 12px !important;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* =============================================
   Popup Search Position Variants - Theme-Proof
   ============================================= */
#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-header.aw-search-bottom {
    padding-bottom: 15px !important;
}

#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-popup-header.aw-search-bottom + .aw-city-popup-body {
    position: relative !important;
    padding-top: 0 !important;
    padding-bottom: 65px !important;
}

#aw-city-popup-overlay.aw-city-popup-overlay .aw-city-search-input.aw-search-in-body {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    display: block !important;
    margin: 0 !important;
    width: 100% !important;
    padding: 15px 20px !important;
    border: none !important;
    border-top: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
}

/* =============================================
   Shipping Method Selector (checkout & cart)

   Token driven: every colour, tint and radius below reads a CSS custom
   property. The defaults are declared once on the container; the merchant's
   Customize Checkout palette overrides them via an inline <style> emitted by
   aw_shipping_checkout_palette_css(). Never hardcode a colour in this block â€”
   add a token instead, otherwise merchant colours stop applying.

   Sizing is theme-relative on purpose. Font family, weight base and font size
   are inherited from the active WooCommerce theme, and every size, gap and
   padding below is expressed in em, so the selector picks up the store's own
   type scale instead of pinning itself to 14px. Only leaf text nodes carry a
   font-size (never a wrapper) so the em units cannot compound.
   ============================================= */
.woocommerce-shipping-methods,
.aw-shipping-preview {
    --aw-ship-accent: #015c80;
    --aw-ship-accent-strong: #014f6e;
    --aw-ship-accent-soft: #f2f7f9;
    --aw-ship-accent-tint: #dfeaf0;
    --aw-ship-accent-ring: rgba(1, 92, 128, 0.2);
    --aw-ship-accent-contrast: #ffffff;
    --aw-ship-text: #1f2a37;
    --aw-ship-muted: #78838f;
    --aw-ship-surface: #ffffff;
    --aw-ship-surface-alt: #f3f6f9;
    --aw-ship-surface-sunken: #fafbfc;
    --aw-ship-border: #e4e9ef;
    --aw-ship-border-strong: #c2cad4;
    --aw-ship-radius: 14px;
    --aw-ship-radius-sm: 10px;
}

tr.woocommerce-shipping-totals.shipping td {
    padding: 0;
}

/* Hide WooCommerce default Shipping header */
.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals > th,
.woocommerce table.shop_table tr.shipping > th,
tr.woocommerce-shipping-totals > th:first-child {
    display: none !important;
}

/* Make shipping td full width when th is hidden */
.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals > td,
.woocommerce table.shop_table tr.shipping > td,
tr.woocommerce-shipping-totals > td {
    width: 100% !important;
    padding-left: 0 !important;
}

.woocommerce-shipping-methods.aw-enhanced,
.aw-shipping-preview .aw-enhanced {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    /* Inherit the theme's typography rather than imposing our own */
    font-family: inherit;
    font-size: inherit;
    line-height: 1.5;
    color: var(--aw-ship-text);
    text-align: left;
}

/* ---------- Section header ---------- */
.aw-shipping-header-row,
.aw-shipping-footer-row {
    display: block;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    margin-top: 20px!important;
}

.aw-shipping-header-row input[type="radio"],
.aw-shipping-footer-row input[type="radio"] {
    display: none !important;
}

/* Deliberately not a card: the title is a section label, so it carries spacing
   and a single hairline instead of competing with the group cards below it. */
.aw-shipping-label-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.25em 0.75em;
    margin: 0 0 0.75em;
    padding: 0 0.125em 0.5em;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--aw-ship-border);
    border-radius: 0;
    box-shadow: none;
}

.aw-shipping-title {
    display: block;
    font-size: 1.0625em;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--aw-ship-text);
}

.aw-shipping-subtitle {
    display: block;
    font-size: 0.8125em;
    font-weight: 400;
    line-height: 1.4;
    color: var(--aw-ship-muted);
}

.aw-shipping-label-footer {
    margin-top: 0.75em;
    padding: 0.75em 1em;
    background: var(--aw-ship-surface-alt);
    border: 1px solid var(--aw-ship-border);
    border-radius: var(--aw-ship-radius);
}

.aw-shipping-info {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.8125em;
    line-height: 1.4;
    color: var(--aw-ship-muted);
}

.aw-shipping-info .dashicons {
    width: 1em;
    height: 1em;
    font-size: 1em;
    line-height: 1;
    color: currentColor;
}

/* ---------- Rate row (shared by flat mode and every group mode) ---------- */
.woocommerce-shipping-methods.aw-enhanced > li:not(.aw-shipping-header-row):not(.aw-shipping-footer-row),
.aw-courier-services > li,
.aw-speed-services > li,
.aw-price-services > li {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin: 0 0 0.5em !important;
    padding: 0.8125em 0.875em !important;
    list-style: none !important;
    background: var(--aw-ship-surface);
    border: 1px solid var(--aw-ship-border);
    border-radius: var(--aw-ship-radius-sm);
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.aw-courier-services > li:last-child,
.aw-speed-services > li:last-child,
.aw-price-services > li:last-child {
    margin-bottom: 0 !important;
}

.woocommerce-shipping-methods.aw-enhanced > li:not(.aw-shipping-header-row):not(.aw-shipping-footer-row):hover,
.aw-courier-services > li:hover,
.aw-speed-services > li:hover,
.aw-price-services > li:hover {
    background: var(--aw-ship-surface);
    border-color: var(--aw-ship-border-strong);
}

.woocommerce-shipping-methods.aw-enhanced > li.aw-rate-selected,
.aw-courier-services > li.aw-rate-selected,
.aw-speed-services > li.aw-rate-selected,
.aw-price-services > li.aw-rate-selected,
.woocommerce-shipping-methods.aw-enhanced > li:has(input.shipping_method:checked),
.aw-courier-services > li:has(input.shipping_method:checked),
.aw-speed-services > li:has(input.shipping_method:checked),
.aw-price-services > li:has(input.shipping_method:checked) {
    background: var(--aw-ship-accent-soft);
    border-color: var(--aw-ship-accent);
    box-shadow: inset 0 0 0 1px var(--aw-ship-accent);
}

/* Radio: native input, restyled. Keeps keyboard + screen-reader behaviour. */
.woocommerce-shipping-methods.aw-enhanced input.shipping_method,
.aw-shipping-preview .aw-enhanced input[type="radio"] {
    flex: 0 0 1.125em;
    width: 1.125em;
    height: 1.125em;
    margin: 0 !important;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background: var(--aw-ship-surface);
    border: 1.5px solid var(--aw-ship-border-strong);
    border-radius: 50%;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.woocommerce-shipping-methods.aw-enhanced input.shipping_method:hover,
.aw-shipping-preview .aw-enhanced input[type="radio"]:hover {
    border-color: var(--aw-ship-accent);
}

.woocommerce-shipping-methods.aw-enhanced input.shipping_method:checked,
.aw-shipping-preview .aw-enhanced input[type="radio"]:checked {
    background: var(--aw-ship-accent);
    border-color: var(--aw-ship-accent);
    box-shadow: inset 0 0 0 3px var(--aw-ship-surface);
}

.woocommerce-shipping-methods.aw-enhanced input.shipping_method:focus-visible,
.aw-shipping-preview .aw-enhanced input[type="radio"]:focus-visible {
    outline: 2px solid var(--aw-ship-accent);
    outline-offset: 2px;
}

.woocommerce-shipping-methods.aw-enhanced li:has(input.shipping_method:focus-visible) {
    box-shadow: 0 0 0 3px var(--aw-ship-accent-ring);
}

.woocommerce-shipping-methods.aw-enhanced label,
.aw-shipping-preview .aw-enhanced label {
    display: flex;
    align-items: center;
    gap: 0.75em;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    line-height: 1.4;
    color: var(--aw-ship-text);
    cursor: pointer;
}

/* Decorated label internals (built by decorateRate in agenwebsite-shipping.js) */
.aw-svc-main {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    flex: 1 1 auto;
    min-width: 0;
}

.aw-svc-name {
    font-size: 0.9375em;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.005em;
    color: var(--aw-ship-text);
    overflow-wrap: anywhere;
}

.aw-svc-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
    font-size: 0.8125em;
    line-height: 1.35;
    color: var(--aw-ship-muted);
}

.aw-svc-price {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 0.9375em;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--aw-ship-text);
}

.aw-svc-price .woocommerce-Price-currencySymbol {
    font-weight: 600;
    opacity: 0.72;
}

.aw-svc-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.15em 0.6em;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.01em;
    color: var(--aw-ship-accent);
    background: var(--aw-ship-accent-soft);
    border: 1px solid var(--aw-ship-accent-tint);
    border-radius: 999px;
    white-space: nowrap;
}

/* ---------- Group card (courier / speed / price) ---------- */
.aw-courier-group,
.aw-speed-group,
.aw-price-group {
    margin: 0 0 0.625em;
    background: var(--aw-ship-surface);
    border: 1px solid var(--aw-ship-border);
    border-radius: var(--aw-ship-radius);
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.aw-courier-group:hover,
.aw-speed-group:hover,
.aw-price-group:hover {
    border-color: var(--aw-ship-border-strong);
}

.aw-courier-group:has(.has-selected),
.aw-speed-group:has(.has-selected),
.aw-price-group:has(.has-selected) {
    border-color: var(--aw-ship-accent);
}

.aw-courier-group-header,
.aw-speed-group-header,
.aw-price-group-header {
    display: flex;
    align-items: center;
    gap: 0.625em;
    min-height: 3.25em;
    padding: 0.75em 1em;
    background: var(--aw-ship-surface);
    border: 0;
    border-bottom: 1px solid transparent;
    font-family: inherit;
    font-weight: 600;
    color: var(--aw-ship-text);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.aw-courier-group-header:hover,
.aw-speed-group-header:hover,
.aw-price-group-header:hover {
    background: var(--aw-ship-surface-alt);
}

.aw-courier-group-header:focus-visible,
.aw-speed-group-header:focus-visible,
.aw-price-group-header:focus-visible {
    outline: 2px solid var(--aw-ship-accent);
    outline-offset: -2px;
}

.aw-courier-group-header.active,
.aw-speed-group-header.active,
.aw-price-group-header.active {
    border-bottom-color: var(--aw-ship-border);
}

.aw-courier-group-header.has-selected,
.aw-speed-group-header.has-selected,
.aw-price-group-header.has-selected {
    background: var(--aw-ship-accent-soft);
    box-shadow: inset 3px 0 0 0 var(--aw-ship-accent);
}

.aw-courier-name,
.aw-speed-name,
.aw-price-name {
    font-size: 0.9375em;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: var(--aw-ship-text);
    overflow-wrap: anywhere;
}

.aw-courier-name {
    text-transform: uppercase;
}

.aw-courier-count,
.aw-speed-count,
.aw-price-count {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.15em 0.6em;
    font-size: 0.75em;
    font-weight: 500;
    line-height: 1.5;
    color: var(--aw-ship-muted);
    background: var(--aw-ship-surface-alt);
    border-radius: 999px;
    white-space: nowrap;
}

.aw-courier-group-header.has-selected .aw-courier-count,
.aw-speed-group-header.has-selected .aw-speed-count,
.aw-price-group-header.has-selected .aw-price-count {
    background: var(--aw-ship-surface);
}

/* Chevron drawn from borders â€” sharper than a â–¼ glyph at every font size */
.aw-courier-toggle,
.aw-speed-toggle,
.aw-price-toggle {
    position: relative;
    flex: 0 0 1.125em;
    width: 1.125em;
    height: 1.125em;
    margin-left: auto;
    color: var(--aw-ship-muted);
}

.aw-courier-toggle:before,
.aw-speed-toggle:before,
.aw-price-toggle:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.45em;
    height: 0.45em;
    border-right: 1.75px solid currentColor;
    border-bottom: 1.75px solid currentColor;
    transform: translate(-50%, -70%) rotate(45deg);
    transition: transform 0.2s ease;
}

.aw-courier-group-header:not(.active) .aw-courier-toggle:before,
.aw-speed-group-header:not(.active) .aw-speed-toggle:before,
.aw-price-group-header:not(.active) .aw-price-toggle:before {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.aw-courier-group-header.has-selected .aw-courier-toggle,
.aw-speed-group-header.has-selected .aw-speed-toggle,
.aw-price-group-header.has-selected .aw-price-toggle {
    color: var(--aw-ship-accent);
}

.aw-courier-services,
.aw-speed-services,
.aw-price-services {
    margin: 0 !important;
    padding: 0.625em !important;
    list-style: none !important;
    background: var(--aw-ship-surface-sunken);
}

/* ---------- Optional markers kept for backward compatibility ---------- */
.aw-badge,
.aw-speed-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15em 0.6em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1.5;
    color: var(--aw-ship-muted);
    background: var(--aw-ship-surface-alt);
    border: 1px solid var(--aw-ship-border);
    border-radius: 999px;
    white-space: nowrap;
}

.aw-badge-cheap,
.aw-badge-best-price,
.aw-speed-fastest,
.aw-speed-fast,
.aw-speed-express,
.aw-speed-regular,
.aw-speed-kargo {
    color: var(--aw-ship-accent);
    background: var(--aw-ship-accent-soft);
    border-color: var(--aw-ship-accent-tint);
}

.aw-price-diff {
    font-size: 0.75em;
    font-weight: 500;
    color: var(--aw-ship-muted);
}

/* Speed categories carry meaning through the estimate text, not colour, so the
   list keeps a single accent instead of a five-colour rainbow. */
.aw-instant,
.aw-same-day,
.aw-next-day,
.aw-express,
.aw-regular,
.aw-kargo {
    border-left-width: 1px;
}

.woocommerce-shipping-methods.aw-enhanced li.aw-cheapest-overall {
    border-color: var(--aw-ship-accent);
}

/* ---------- Responsive ----------
   Sizes are already relative to the theme's base font, so the breakpoint only
   tightens spacing and lets the header stack. */
@media (max-width: 768px) {
    .aw-shipping-label-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15em;
        padding: 0.625em 0.875em;
    }

    .aw-courier-group-header,
    .aw-speed-group-header,
    .aw-price-group-header {
        min-height: 3em;
        padding: 0.75em 0.875em;
    }

    .woocommerce-shipping-methods.aw-enhanced > li:not(.aw-shipping-header-row):not(.aw-shipping-footer-row),
    .aw-courier-services > li,
    .aw-speed-services > li,
    .aw-price-services > li {
        gap: 0.625em;
        padding: 0.75em !important;
    }

    .aw-courier-services,
    .aw-speed-services,
    .aw-price-services {
        padding: 0.5em !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .woocommerce-shipping-methods.aw-enhanced *,
    .aw-shipping-preview .aw-enhanced * {
        transition-duration: 0.01ms !important;
    }
}

/* =============================================
   Checkout Insurance Styles
   ============================================= */

/* Container wrapper */
.aw-checkout-insurance-wrapper {
    clear: both;
    padding: 16px 20px;
    margin: 20px 0;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.aw-checkout-insurance-wrapper:hover {
    border-color: #d1d8dd;
}

/* Active state - when insurance is selected */
.aw-checkout-insurance-wrapper.insurance-active {
    background: #e8f5e9;
    border-color: #4caf50;
}

/* Optional mode specific styles */
.aw-checkout-insurance-wrapper.aw-insurance-optional {
    cursor: pointer;
}

.aw-checkout-insurance-wrapper.aw-insurance-optional:hover {
    background: #f0f4f8;
}

.aw-checkout-insurance-wrapper.aw-insurance-optional.insurance-active:hover {
    background: #dcedc8;
}

/* Insurance content area */
.aw-checkout-insurance-wrapper .aw-insurance-content {
    flex: 1;
    display: flex;
    align-items: center;
}

/* Checkbox label styling */
.aw-checkout-insurance-wrapper .aw-insurance-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    margin: 0;
    width: 100%;
    user-select: none;
}

.aw-checkout-insurance-wrapper .aw-insurance-label:hover {
    color: #1a73e8;
}

/* Custom checkbox styling */
.aw-checkout-insurance-wrapper .aw-insurance-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.aw-checkout-insurance-wrapper .aw-insurance-checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #fff;
    border: 2px solid #d1d8dd;
    border-radius: 4px;
    margin-right: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.aw-checkout-insurance-wrapper .aw-insurance-checkmark:after {
    content: '';
    display: none;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Checkbox checked state */
.aw-checkout-insurance-wrapper .aw-insurance-checkbox:checked ~ .aw-insurance-checkmark {
    background: #4caf50;
    border-color: #4caf50;
}

.aw-checkout-insurance-wrapper .aw-insurance-checkbox:checked ~ .aw-insurance-checkmark:after {
    display: block;
}

/* Checkbox hover state */
.aw-checkout-insurance-wrapper .aw-insurance-label:hover .aw-insurance-checkmark {
    border-color: #4caf50;
}

/* Insurance text */
.aw-checkout-insurance-wrapper .aw-insurance-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

/* Forced mode specific styles */
.aw-checkout-insurance-wrapper.aw-insurance-forced {
    background: #e8f5e9;
    border-color: #4caf50;
    border-width: 2px;
}

.aw-checkout-insurance-wrapper.aw-insurance-forced .aw-insurance-message {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #2e7d32;
}

.aw-checkout-insurance-wrapper.aw-insurance-forced .aw-insurance-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #4caf50;
    border-radius: 50%;
    margin-right: 12px;
    color: white;
    flex-shrink: 0;
}

.aw-checkout-insurance-wrapper.aw-insurance-forced .aw-insurance-icon svg {
    width: 14px;
    height: 14px;
}

/* Insurance badge (for forced mode) */
.aw-checkout-insurance-wrapper .aw-insurance-badge {
    background: #4caf50;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-left: 15px;
}

/* Loading state */
.aw-checkout-insurance-wrapper.aw-insurance-loading {
    opacity: 0.7;
    pointer-events: none;
}

.aw-checkout-insurance-wrapper.aw-insurance-loading:after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #4caf50;
    border-radius: 50%;
    animation: aw-insurance-spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes aw-insurance-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .aw-checkout-insurance-wrapper {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
    }

    .aw-checkout-insurance-wrapper .aw-insurance-content {
        width: 100%;
        margin-bottom: 10px;
    }

    .aw-checkout-insurance-wrapper .aw-insurance-badge {
        margin-left: 0;
        margin-top: 5px;
    }

    .aw-checkout-insurance-wrapper .aw-insurance-text {
        font-size: 13px;
    }

    .aw-checkout-insurance-wrapper.aw-insurance-forced .aw-insurance-message {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .aw-checkout-insurance-wrapper {
        padding: 12px 14px;
    }

    .aw-checkout-insurance-wrapper .aw-insurance-checkmark {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }

    .aw-checkout-insurance-wrapper .aw-insurance-text {
        font-size: 12px;
    }
}

/* =============================================
   Checkout Shipping Discount Styles
   ============================================= */

/* Paid user: strikethrough original price + hemat badge */
.aw-rate-original-price {
    font-size: 12px;
    color: #94a3b8;
}

.aw-rate-original-price del {
    text-decoration: line-through;
}

.aw-rate-discount-badge {
    display: inline-flex;
    background: #dcfce7;
    color: #16a34a;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Subsidi Ongkir = Free Ongkir badge */
.aw-rate-free-badge {
    display: inline-flex;
    background: #16a34a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Free user: PRO teaser */
.aw-rate-pro-teaser {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    margin-top: 2px;
}

.aw-pro-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
}

.aw-pro-teaser-text {
    color: #16a34a;
    font-weight: 500;
}