.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 !important;
    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 */
.aw-city-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.3);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.aw-city-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.aw-city-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 4px;
    border: 1px solid #d1d8dd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    height: 70vh;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

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

.aw-city-popup-header {
    padding: 20px 20px 10px;
    border-bottom: 1px solid #eee;
    position: relative;
    flex: none;
}

.aw-city-popup-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.aw-city-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    line-height: 1;
}

.aw-city-popup-close:hover {
    color: #333;
}

.aw-city-search-input {
    width: 93%;
    padding: 12px 15px;
    border: 1px solid #d1d8dd;
    border-radius: 3px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
}

.aw-city-search-input:focus {
    border-color: #4a90e2;
    box-shadow: none;
}

.aw-city-popup-body {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.aw-city-results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.aw-city-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.aw-city-result-item:hover {
    background-color: #fafbfc;
}

.aw-city-result-item:last-child {
    border-bottom: none;
}

.aw-city-result-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.aw-city-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.aw-city-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: aw-spin 1s linear infinite;
    margin-right: 10px;
}

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

.aw-city-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.aw-city-input-trigger {
    cursor: pointer;
    position: relative;
}

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

/* Mobile Compatibility */
@media (max-width: 768px) {
    .aw-city-popup {
        width: 95%;
        height: 80vh;
        top: 10vh;
        transform: translateX(-50%);
    }
    
    .aw-city-popup-overlay.show .aw-city-popup {
        transform: translateX(-50%) scale(1);
    }
    
    .aw-city-popup-header {
        padding: 15px 15px 10px;
    }
    
    .aw-city-popup-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .aw-city-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .aw-city-result-item {
        padding: 12px 15px;
    }
    
    .aw-city-result-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .aw-city-popup {
        width: 98%;
        margin: 0;
        border-radius: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-50%);
    }
    
    .aw-city-popup-overlay.show .aw-city-popup {
        transform: translateX(-50%) scale(1);
    }
}

/* =============================================
   Shipping Display Enhancement Styles
   ============================================= */
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;
}

/* Shipping Label Header and Footer Rows */
.aw-shipping-header-row,
.aw-shipping-footer-row {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

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

.aw-shipping-label-header {
    background: #f7f9fc;
    color: #2c3e50;
    padding: 15px 20px;
    border-radius: 4px 4px 0 0;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e1e8ed;
    border-bottom: 2px solid #4a90e2;
}

.aw-shipping-title {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.aw-shipping-subtitle {
    font-size: 12px;
    color: #7f8c8d;
}

.aw-shipping-label-footer {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 0 0 4px 4px;
    margin-top: 10px;
    border: 1px solid #e9ecef;
}

.aw-shipping-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 13px;
}

.aw-shipping-info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    color: #6c757d;
}

/* Ensure proper spacing when header/footer are present */
.woocommerce-shipping-methods.aw-enhanced {
    margin: 0;
    padding: 0;
}

/* Style regular list items in flat mode when header/footer present */
.woocommerce-shipping-methods.aw-enhanced > li:not(.aw-shipping-header-row):not(.aw-shipping-footer-row):not(.aw-courier-group):not(.aw-speed-group):not(.aw-price-group) {
    background: #fff;
    padding: 12px 20px;
    margin: 0;
    border-left: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.woocommerce-shipping-methods.aw-enhanced > li:not(.aw-shipping-header-row):not(.aw-shipping-footer-row):not(.aw-courier-group):not(.aw-speed-group):not(.aw-price-group):first-of-type {
    border-top: 1px solid #e9ecef;
}

.woocommerce-shipping-methods.aw-enhanced > li:not(.aw-shipping-header-row):not(.aw-shipping-footer-row):hover {
    background: #fafbfc;
}

/* Courier Group Styles */
.aw-courier-group {
    margin-bottom: 15px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.aw-courier-group:hover {
    border-color: #d1d8dd;
}

.aw-courier-group-header {
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
    user-select: none;
}

.aw-courier-group-header:hover {
    background: #f1f3f5;
}

.aw-courier-group-header.active {
    background: #fff;
    color: #2c3e50;
    border-bottom: 2px solid #4a90e2;
    font-weight: 600;
}

.aw-courier-group-header.has-selected {
    background: #f0f6ff;
    border-left: 4px solid #4a90e2;
}

.aw-courier-name {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
}

.aw-courier-count {
    font-size: 14px;
    font-weight: normal;
    margin-left: 10px;
    opacity: 0.8;
}

.aw-courier-toggle {
    width: 20px;
    height: 20px;
    position: relative;
    margin-left: auto;
}

.aw-courier-toggle:before {
    content: '▼';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0);
    transition: transform 0.3s ease;
    font-size: 12px;
}

.aw-courier-group-header:not(.active) .aw-courier-toggle:before {
    transform: translateY(-50%) rotate(-90deg);
}

/* Services within courier group */
.aw-courier-services {
    padding: 10px 15px;
    background: #fafbfc;
    list-style: none;
    margin: 0;
}

.aw-courier-services li {
    padding: 12px 15px;
    margin: 5px 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 3px;
    transition: all 0.2s ease;
    position: relative;
}

.aw-courier-services li:hover {
    background: #fafbfc;
    border-color: #4a90e2;
    transform: none;
}

.aw-courier-services li.aw-cheapest-in-group {
    background: #fafafa;
    border-left: 3px solid #4a90e2;
}

/* Badge Styles */
.aw-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
    text-transform: uppercase;
    vertical-align: middle;
}

.aw-badge-cheap {
    background: #f0f4f7;
    color: #2c3e50;
    border: 1px solid #d1d8dd;
}

.aw-badge-best-price {
    background: #fef9f3;
    color: #856404;
    border: 1px solid #f39c12;
}

/* Speed Display Badges */
.aw-speed-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    vertical-align: middle;
}

.aw-speed-fastest {
    background: #fef5f5;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.aw-speed-fast {
    background: #fff6f5;
    color: #e67e22;
    border: 1px solid #e67e22;
}

.aw-speed-express {
    background: #f0f6ff;
    color: #3498db;
    border: 1px solid #3498db;
}

.aw-speed-regular {
    background: #f7f8f9;
    color: #7f8c8d;
    border: 1px solid #95a5a6;
}

/* Price Display Enhancements */
.aw-cheapest-overall {
    background: #fefefe !important;
    border: 2px solid #f39c12 !important;
    padding: 15px !important;
}

.aw-price-diff {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 6px;
    background: #fef5f5;
    color: #e74c3c;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 500;
}

/* Delivery Time Categories */
.aw-instant {
    border-left: 4px solid #9b59b6;
    background: #fafafa;
}

.aw-same-day {
    border-left: 4px solid #ff4757;
}

.aw-next-day {
    border-left: 4px solid #ff6348;
}

.aw-express {
    border-left: 4px solid #3498db;
}

.aw-regular {
    border-left: 4px solid #95a5a6;
}

.aw-kargo {
    border-left: 4px solid #8B4513;
    background: #fafafa;
}

/* Kargo speed badge */
.aw-speed-kargo {
    background: #fef9f5;
    color: #8B4513;
    border: 1px solid #8B4513;
}

/* Removed pulse animation for minimalist design */

/* Responsive Design */
@media (max-width: 768px) {
    .aw-courier-group-header {
        padding: 12px 15px;
        font-size: 14px;
    }

    .aw-courier-name {
        font-size: 14px;
    }

    .aw-courier-count {
        font-size: 12px;
    }

    .aw-courier-services li {
        padding: 10px 12px;
    }

    .aw-badge,
    .aw-speed-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* Enhanced hover effects */
.woocommerce-shipping-methods.aw-enhanced li:hover {
    background-color: #fafbfc;
}

/* Ensure radio buttons are properly aligned */
.aw-courier-services input[type="radio"] {
    margin-right: 10px;
    vertical-align: middle;
}

/* Make labels more clickable */
.aw-courier-services label {
    display: block;
    cursor: pointer;
    width: 100%;
}

/* Selected shipping method highlight */
.aw-courier-services li:has(input:checked) {
    background: #f0f6ff;
    border-color: #4a90e2;
    box-shadow: none;
}

/* Speed Group Styles - Similar to Courier Groups */
.aw-speed-group {
    margin-bottom: 15px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.3s ease;
    border-left: 0;
    border-right: 0;
}

.aw-speed-group:hover {
    border-color: #d1d8dd;
}

.aw-speed-group-header {
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
    user-select: none;
}

.aw-speed-group-header:hover {
    background: #f1f3f5;
}

.aw-speed-group-header.active {
    background: #fff;
    color: #2c3e50;
    border-bottom: 2px solid #4a90e2;
    font-weight: 600;
}

.aw-speed-group-header.has-selected {
    background: #f0f6ff;
    border-left: 4px solid #4a90e2;
}

.aw-speed-name {
    font-size: 16px;
    font-weight: bold;
}

.aw-speed-count {
    font-size: 14px;
    font-weight: normal;
    margin-left: 10px;
    opacity: 0.8;
}

.aw-speed-toggle {
    width: 20px;
    height: 20px;
    position: relative;
    margin-left: auto;
}

.aw-speed-toggle:before {
    content: '▼';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0);
    transition: transform 0.3s ease;
    font-size: 12px;
}

.aw-speed-group-header:not(.active) .aw-speed-toggle:before {
    transform: translateY(-50%) rotate(-90deg);
}

.aw-speed-services {
    padding: 10px 15px;
    background: #fafbfc;
    list-style: none;
    margin: 0;
}

.aw-speed-services li {
    padding: 12px 15px;
    margin: 5px 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 3px;
    transition: all 0.2s ease;
    position: relative;
}

.aw-speed-services li:hover {
    background: #fafbfc;
    border-color: #4a90e2;
    transform: none;
}

.aw-speed-services li:has(input:checked) {
    background: #f0f6ff;
    border-color: #4a90e2;
    box-shadow: none;
}

/* Price Group Styles */
.aw-price-group {
    margin-bottom: 15px;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.aw-price-group:hover {
    border-color: #d1d8dd;
}

.aw-price-group-header {
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    user-select: none;
}

.aw-price-group-header:hover {
    background: #f1f3f5;
}

.aw-price-group-header.active {
    background: #fff;
    color: #2c3e50;
    border-bottom: 2px solid #4a90e2;
    font-weight: 600;
}

.aw-price-group-header.has-selected {
    background: #f0f6ff;
    border-left: 4px solid #4a90e2;
}

.aw-price-name {
    font-size: 16px;
    font-weight: bold;
}

.aw-price-count {
    font-size: 14px;
    font-weight: normal;
    margin-left: 10px;
    opacity: 0.8;
}

.aw-price-toggle {
    width: 20px;
    height: 20px;
    position: relative;
    margin-left: auto;
}

.aw-price-toggle:before {
    content: '▼';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0);
    transition: transform 0.3s ease;
    font-size: 12px;
}

.aw-price-group-header:not(.active) .aw-price-toggle:before {
    transform: translateY(-50%) rotate(-90deg);
}

.aw-price-services {
    padding: 10px 15px;
    background: #fafbfc;
    list-style: none;
    margin: 0;
}

.aw-price-services li {
    padding: 12px 15px;
    margin: 5px 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 3px;
    transition: all 0.2s ease;
    position: relative;
}

.aw-price-services li:hover {
    background: #fafbfc;
    border-color: #f39c12;
    transform: none;
}

.aw-price-services li:has(input:checked) {
    background: #fef9f3;
    border-color: #f39c12;
    box-shadow: none;
}

/* Responsive adjustments for new groups */
@media (max-width: 768px) {
    .aw-speed-group-header,
    .aw-price-group-header {
        padding: 12px 15px;
        font-size: 14px;
    }

    /* Header and Footer responsive styles */
    .aw-shipping-label-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 12px 15px;
    }

    .aw-shipping-title {
        font-size: 14px;
    }

    .aw-shipping-subtitle {
        font-size: 11px;
    }

    .aw-shipping-label-footer {
        padding: 10px 15px;
    }

    .aw-shipping-info {
        font-size: 12px;
    }

    .aw-speed-name,
    .aw-price-name {
        font-size: 14px;
    }

    .aw-speed-count,
    .aw-price-count {
        font-size: 12px;
    }

    .aw-speed-services li,
    .aw-price-services li {
        padding: 10px 12px;
    }
}