/* WBS Pro Frontend Styles */

/* Zone Selector */
.wbs-zone-selector-row {
    background: #f8f9fa;
}

.wbs-zone-selector-row th {
    font-weight: 600;
    vertical-align: middle;
}

.wbs-zone-select {
    width: 100%;
    max-width: 300px;
    padding: 10px 15px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.wbs-zone-select:hover {
    border-color: #999;
}

.wbs-zone-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.wbs-zone-loading {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    color: #666;
    font-size: 13px;
}

.wbs-zone-loading .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: wbs-spin 0.8s linear infinite;
    margin-right: 8px;
}

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

/* Hide default country field when zone selector is active */
.woocommerce-shipping-calculator {
    display: none !important;
}

/* Shipping method styling */
.woocommerce-shipping-methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 10px 0 0 0 !important;
}

.woocommerce-shipping-methods li {
    padding: 8px 0;
}

.woocommerce-shipping-methods label {
    font-weight: normal;
}

.woocommerce-shipping-methods small {
    color: #666;
    font-size: 12px;
}

/* No shipping message */
.woocommerce-shipping-destination {
    display: none;
}

/* Cart totals adjustments */
.cart_totals .wbs-zone-selector-row + tr.shipping td {
    padding-top: 5px;
}

/* Checkout adjustments */
.woocommerce-checkout .wbs-zone-selector-row {
    border-bottom: 1px solid #eee;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .wbs-zone-select {
        max-width: 100%;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .wbs-zone-loading {
        display: block;
        margin: 10px 0 0 0;
    }
}

/* Selected zone highlight */
.wbs-zone-select option:checked {
    background: #0073aa;
    color: #fff;
}

/* Zone info tooltip */
.wbs-zone-info {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Update button styling when needed */
.wbs-update-shipping {
    margin-top: 10px;
    padding: 8px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.wbs-update-shipping:hover {
    background: #005a87;
}
