/* Blu Location Shipping Styles */

.blu-location-selector {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
    clear: both;
    float: none;
    position: relative;
    z-index: 10;
}

.blu-location-selector h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.blu-location-selector-wrapper {
    position: relative;
}

.blu-location-dropdown {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    background-color: #fff;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.blu-location-dropdown:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.blu-location-dropdown:disabled {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.blu-location-notice {
    margin-top: 10px;
}

.blu-location-notice p {
    margin: 0;
    padding: 10px 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
    line-height: 1.4;
}

/* Hide WooCommerce info icon in location notice */
.blu-location-notice .woocommerce-info:before {
    display: none !important;
}

/* Mini cart specific styles */
.blu-location-selector-mini-cart {
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.blu-location-selector-mini-cart h3 {
    font-size: 14px;
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #333;
}

.blu-location-selector-mini-cart .blu-location-dropdown {
    font-size: 12px;
    padding: 8px 10px;
}

/* Checkout page specific styles */
.woocommerce-checkout .blu-location-selector {
    margin: 0 0 30px;
    background: #fff;
    border: 1px solid #ddd;
    max-width: 100%;
}

/* Ensure compatibility with different checkout layouts */
.woocommerce-checkout.theme-astra .blu-location-selector,
.woocommerce-checkout.theme-flatsome .blu-location-selector,
.woocommerce-checkout.theme-storefront .blu-location-selector {
    width: 100%;
    float: none;
    clear: both;
}

/* Cart page specific styles */
.woocommerce-cart .blu-location-selector {
    margin: 20px 0;
    width: 100%;
    clear: both;
    float: none;
}

/* Theme compatibility fixes */
.theme-storefront .blu-location-selector,
.theme-flatsome .blu-location-selector,
.theme-astra .blu-location-selector,
.theme-oceanwp .blu-location-selector {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin: 20px 0 !important;
}

/* Fix for themes with custom checkout layouts */
form.woocommerce-checkout .blu-location-selector {
    width: 100% !important;
    max-width: none !important;
    flex: 0 0 100% !important;
    -webkit-box-flex: 0 !important;
    -ms-flex: 0 0 100% !important;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .blu-location-selector {
        margin: 15px 0;
        padding: 15px;
    }

    .blu-location-selector h3 {
        font-size: 15px;
    }

    .blu-location-dropdown {
        padding: 10px;
        font-size: 14px;
    }
}

/* Force full width on two-column layouts */
.woocommerce-checkout.two-column-layout .blu-location-selector,
.woocommerce-checkout.col2-set .blu-location-selector {
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .blu-location-selector {
        padding: 15px;
    }
    
    .blu-location-selector h3 {
        font-size: 16px;
    }
    
    .blu-location-dropdown {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Theme compatibility - WooCommerce specific */
.woocommerce .blu-location-selector {
    background: #f8f8f8;
    border-color: #ddd;
}

.woocommerce .blu-location-dropdown {
    border-color: #ddd;
}

.woocommerce .blu-location-dropdown:focus {
    border-color: #a46497;
    box-shadow: 0 0 0 1px #a46497;
}

/* Theme compatibility - Twenty Twenty-One */
.theme-twentytwentyone .blu-location-selector {
    background: var(--color-background);
    border-color: var(--color-border);
}

.theme-twentytwentyone .blu-location-dropdown {
    border-color: var(--color-border);
    background-color: var(--color-background);
    color: var(--color-text);
}

/* Theme compatibility - Twenty Twenty-Two */
.theme-twentytwentytwo .blu-location-selector {
    background: var(--wp--preset--color--background);
    border-color: var(--wp--preset--color--border);
}

.theme-twentytwentytwo .blu-location-dropdown {
    border-color: var(--wp--preset--color--border);
    background-color: var(--wp--preset--color--background);
    color: var(--wp--preset--color--text);
}

/* Loading state */
.blu-location-dropdown:disabled {
    opacity: 0.6;
}

/* Success/Error message styles */
.blu-location-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 14px;
    line-height: 1.4;
}

.blu-location-message-success {
    background-color: #46b450;
}

.blu-location-message-error {
    background-color: #dc3232;
}

/* Animation for messages */
.blu-location-message {
    animation: bluMessageSlideIn 0.3s ease-out;
}

@keyframes bluMessageSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Accessibility improvements */
.blu-location-dropdown:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.blu-location-selector h3:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .blu-location-selector {
        border-width: 2px;
    }
    
    .blu-location-dropdown {
        border-width: 2px;
    }
    
    .blu-location-notice p {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .blu-location-dropdown {
        transition: none;
    }
    
    .blu-location-message {
        animation: none;
    }
}