/* Shortcode Region Selector */
.wcsr-shortcode-selector {
    margin: 20px 0;
}

.wcsr-shortcode-selector label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 15px;
}

#wcsr-region-shortcode {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

#wcsr-region-shortcode:hover {
    border-color: #0073aa;
}

#wcsr-region-shortcode:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Keep header styles for backward compatibility (if still used) */
#wcsr-header-selector {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 999;
}

#wcsr-header-selector.wcsr-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

#wcsr-header-selector label {
    font-weight: 600;
    color: #333;
    margin: 0;
    font-size: 14px;
}

#wcsr-region-header {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

#wcsr-region-header:hover {
    border-color: #0073aa;
}

#wcsr-region-header:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Product Page Selector */
.wcsr-product-selector {
    background: #f8f9fa;
    border: 2px solid #0073aa;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.wcsr-product-selector label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 15px;
}

#wcsr-region-product {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

#wcsr-region-product:hover {
    border-color: #0073aa;
}

#wcsr-region-product:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Highlight effect */
.wcsr-highlight {
    animation: pulse 0.5s ease 3;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        border-color: #ced4da;
    }
    50% {
        transform: scale(1.02);
        border-color: #dc3545;
    }
}

/* Product not available message */
.wcsr-product-not-available {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
    color: #856404;
    font-weight: 500;
}

/* Notices */
.wcsr-notice {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    font-weight: 500;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.wcsr-notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wcsr-notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #wcsr-header-selector {
        flex-direction: column;
        gap: 8px;
        padding: 10px 15px;
    }
    
    #wcsr-region-header {
        width: 100%;
        min-width: auto;
    }
    
    .wcsr-product-selector {
        padding: 15px;
    }
    
    .wcsr-notice {
        right: 10px;
        left: 10px;
        top: 80px;
    }
}

@media (max-width: 480px) {
    #wcsr-header-selector label {
        font-size: 13px;
    }
    
    #wcsr-region-header,
    #wcsr-region-product {
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* Cart and Checkout Integration */
.woocommerce-cart .wcsr-selected-region,
.woocommerce-checkout .wcsr-selected-region {
    background: #e7f5ff;
    border: 1px solid #4299e1;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.wcsr-selected-region strong {
    color: #2c5282;
}

/* Ensure proper spacing in WooCommerce */
.woocommerce-cart-form .wcsr-product-selector,
.woocommerce-checkout .wcsr-product-selector {
    margin-top: 20px;
}

/* Smooth transitions */
.wcsr-region-dropdown {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Select dropdown arrow styling */
.wcsr-region-dropdown {
    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 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

/* Loading state for dropdown */
.wcsr-region-dropdown:disabled {
    opacity: 0.6;
    cursor: wait;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z' opacity='.25'/%3E%3Cpath fill='%23666' d='M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z'%3E%3CanimateTransform attributeName='transform' type='rotate' dur='0.75s' values='0 12 12;360 12 12' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
    background-size: 16px;
}

/* Loading state */
.wcsr-loading {
    position: relative;
    pointer-events: none;
}

.wcsr-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cart Page Styles */
.wcsr-cart-notice {
    background: #fff3cd !important;
    border-color: #ffc107 !important;
    padding: 15px !important;
}

.wcsr-selected-region {
    background: #e7f5ff !important;
    border: 1px solid #4299e1 !important;
    padding: 15px !important;
    border-radius: 6px !important;
    margin-bottom: 20px !important;
}

.wcsr-change-region {
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
}

.wcsr-change-region:hover {
    color: #005a87;
}

.wcsr-inline-selector {
    margin-top: 15px;
}

.wcsr-inline-selector select {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

/* Checkout Page Styles */
.wcsr-checkout-region {
    background: #f8f9fa;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 20px;
}

.wcsr-checkout-region h3 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 15px;
}

.wcsr-checkout-region table {
    margin-bottom: 10px;
    width: 100%;
}

.wcsr-checkout-region th {
    text-align: left;
    padding: 8px;
    width: 40%;
}

.wcsr-checkout-region td {
            padding: 8px;
}

/* Hide country field in checkout */
.woocommerce-billing-fields .hidden,
.woocommerce-shipping-fields .hidden,
#billing_country_field,
#shipping_country_field {
    display: none !important;
}

/* Hide state field if any */
#billing_state_field,
#shipping_state_field {
    display: none !important;
}

/* Style city field nicely */
#billing_city_field input,
#shipping_city_field input {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}
/* Radio buttons as buttons style */
.wcsr-radio-buttons-as-buttons .woocommerce-input-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wcsr-radio-buttons-as-buttons .woocommerce-input-wrapper label.radio {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    transition: all 0.3s ease;
    font-weight: 600;
    text-align: center;
    margin: 0 !important;
    position: relative;
}

/* Hide the actual radio input */
.wcsr-radio-buttons-as-buttons .woocommerce-input-wrapper label.radio input[type="radio"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

/* Checked state - using JS added class 'wcsr-radio-checked' for better compatibility */
.wcsr-radio-buttons-as-buttons .woocommerce-input-wrapper label.radio.wcsr-radio-checked {
    border-color: #000080 !important; /* Navy Blue */
    color: #000080 !important;
    background-color: #f0f0ff !important;
    box-shadow: 0 0 0 1px #000080;
}

.wcsr-radio-buttons-as-buttons .woocommerce-input-wrapper label.radio:hover {
    border-color: #aaa;
}

/* Sender Name Description Styling */
.wcsr-sender-name-field .description {
    display: block !important;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
    font-style: italic;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hide WooCommerce default shipping destination info */
.woocommerce-shipping-destination {
    display: none !important;
}
