/**
 * Empyreal Clicksteel Multilocation Public Styles
 */

/* Location selector */
.ecml-location-selector {
    position: relative;
    display: inline-block;
    margin: 10px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    z-index: 9999;
}

.ecml-location-selector-toggle {
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    display: flex;
    align-items: center;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.ecml-location-selector-toggle:hover {
    background-color: #f9f9f9;
    border-color: #ccc;
}

.ecml-toggle-icon {
    margin-left: 8px;
    font-size: 10px;
    color: #777;
}

.ecml-current-location {
    font-weight: 500;
    color: #333;
}

.ecml-location-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    width: 250px;
    display: none;
    z-index: 100;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    margin-top: 5px;
}

.ecml-location-dropdown.active {
    display: block;
}

.ecml-location-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ecml-location-dropdown li {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
}

.ecml-location-dropdown li:last-child {
    border-bottom: none;
}

.ecml-location-dropdown li:hover {
    background: #f5f5f5;
}

.ecml-location-dropdown li.active {
    background: #f0f0f0;
    font-weight: bold;
    color: #000;
}

/* Mobile styles */
@media screen and (max-width: 600px) {
    .ecml-location-dropdown {
        width: 200px;
    }
    
    .ecml-location-selector {
        margin: 5px;
    }
    
    .ecml-location-selector-toggle {
        padding: 6px 10px;
    }
}

/* Location Set Popup Notification */
.ecml-location-popup {
    position: absolute; 
    top: 100%; 
    left: 0;  
    margin-top: 10px; 
    margin-left: 0 !important;  /* Force left margin */
    margin-right: auto !important; /* Force right margin */
    min-width: 250px; 
    max-width: 350px; 
    background-color: #333; 
    color: #fff; 
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000; 
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: translateY(10px); 
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none; /* Prevent interaction until active */
}

.ecml-location-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto; /* Allow interaction when active */
}

/* Remove triangle arrow */
.ecml-location-popup:before {
   display: none; 
}

.ecml-location-popup .popup-icon {
    font-size: 18px;
    flex-shrink: 0; /* Prevent icon shrinking */
}

.ecml-location-popup .popup-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px; /* Slightly larger close button */
    cursor: pointer;
    padding: 0 0 0 15px;
    line-height: 1;
    margin-left: auto; /* Push close button to the right */
    flex-shrink: 0;
}

.ecml-location-popup .popup-close:hover {
    color: #fff;
}

/* Fade out animation */
@keyframes ecmlFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); visibility: hidden; pointer-events: none;}
}

.ecml-location-popup.fade-out {
    animation: ecmlFadeOut 0.3s ease-in-out forwards;
}

/* MIML-Style Location Selector Styling */
/* Hide SVG and icon elements for cleaner look */
.ecml-state-selector-inline .wcmlim_change_lc_to svg,
.ecml-location-selector .wcmlim_change_lc_to svg {
    display: none !important;
}

.ecml-state-selector-inline .wcmlim_change_lc_to i,
.ecml-location-selector .wcmlim_change_lc_to i {
    display: none !important;
}

.ecml-state-selector-inline .elementor-widget-container,
.ecml-location-selector .elementor-widget-container {
    display: flex;
    flex-direction: row;
    z-index: 88;
    align-items: center;
}

.ecml-state-selector-inline .miml-location-selector--popup__icon,
.ecml-location-selector .miml-location-selector--popup__icon {
    display: none !important;
}

/* MIML-style select dropdown */
.ecml-state-selector-inline select,
.ecml-location-selector select {
    background-color: #011F30;
    border: none;
    color: #FFFFFF;
    font-size: 16px;
    letter-spacing: 1px;
    margin-left: 0 !important;
    width: auto !important;
    padding: 8px 12px;
    border-radius: 3px;
}

.ecml-state-selector-inline select option,
.ecml-location-selector select option {
    background-color: #011F30;
    color: #FFFFFF;
}

/* MIML-style label text */
.ecml-state-selector-inline p,
.ecml-state-selector-inline label,
.ecml-location-selector p,
.ecml-location-selector label {
    color: #FFFFFF !important;
    height: 25px;
    margin-block-end: 0;
    letter-spacing: 2px;
    font-weight: 500;
}

/* MIML popup styling */
.miml-location-selector--popup,
.miml-location-selector--popup:after {
    z-index: 99 !important;
}

.miml-location-selector--popup:after {
    left: 30px !important;
}

/* Mobile responsive styles matching MIML */
@media only screen and (max-width: 767px) {
    .miml-location-selector--popup {
        left: -30px !important;
    }
    
    .ecml-state-selector-inline .elementor-widget-container,
    .ecml-location-selector .elementor-widget-container {
        align-items: center;
        justify-content: center;
    }
    
    .ecml-state-selector-inline select,
    .ecml-location-selector select {
        font-size: 14px !important;
        letter-spacing: 1px;
    }
    
    .ecml-state-selector-inline p,
    .ecml-state-selector-inline label,
    .ecml-location-selector p,
    .ecml-location-selector label {
        font-size: 14px;
        letter-spacing: 1px;
        padding-top: 3px;
    }
    
    .miml-location-selector--popup {
        display: block;
        width: 80vw;
        left: auto;
    }
    
    .miml-location-selector--popup p {
        font-size: 12px;
        text-wrap: wrap;
    }
    
    .miml-location-selector--popup:after {
        left: calc(50% - 10px) !important;
    }
}

/* Additional MIML compatibility styles */
.ecml-state-selector-inline,
.ecml-location-selector {
    font-family: inherit;
}

.ecml-state-selector-inline .elementor-widget-container,
.ecml-location-selector .elementor-widget-container {
    background: transparent;
}

/* Ensure proper spacing and alignment */
.ecml-state-selector-inline label,
.ecml-location-selector label {
    margin-right: 10px;
    display: inline-block;
}

/* Dark theme compatibility */
body.dark-theme .ecml-state-selector-inline select,
body.dark-theme .ecml-location-selector select {
    background-color: #011F30;
    color: #FFFFFF;
}

body.dark-theme .ecml-state-selector-inline p,
body.dark-theme .ecml-state-selector-inline label,
body.dark-theme .ecml-location-selector p,
body.dark-theme .ecml-location-selector label {
    color: #FFFFFF !important;
} 

/* First Visit State Popup */
.ecml-state-selector-container {
    position: relative;
    display: inline-block;
}

.ecml-state-popup {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #ff0c3a;
    border: 2px solid #ff0c3a;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    margin-top: 10px;
    width: 300px;
}

.ecml-popup-arrow {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #ff0c3a;
}

.ecml-popup-arrow::after {
    content: '';
    position: absolute;
    top: 2px;
    left: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ff0c3a;
}

.ecml-popup-content p {
    margin: 0 0 10px 0 !important;
    font-size: 14px;
    line-height: 1.5;
    color: white;
    text-align: center;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ecml-popup-button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background-color: white;
    color: #ff0c3a;
    border: 2px solid white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ecml-popup-button:hover {
    background-color: #f0f0f0;
    border-color: #f0f0f0;
}

.ecml-popup-button:focus {
    outline: 2px solid #ff0c3a;
    outline-offset: 2px;
}

/* Dark theme compatibility for popup */
body.dark-theme .ecml-state-popup {
    background: #011F30;
    border-color: #ff0c3a;
}

body.dark-theme .ecml-popup-arrow::after {
    border-bottom-color: #011F30;
}

body.dark-theme .ecml-popup-content p {
    color: #FFFFFF;
}

/* Cart Confirmation and Results Modals */
.ecml-cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.ecml-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.ecml-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.ecml-modal-content h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.ecml-modal-content p {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.5;
}

.ecml-modal-content ul {
    margin: 0 0 20px 0;
    padding-left: 20px;
}

.ecml-modal-content li {
    margin-bottom: 5px;
    color: #666;
}

.ecml-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.ecml-modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.ecml-button-primary {
    background-color: #ff0c3a;
    color: white;
}

.ecml-button-primary:hover {
    background-color: #e00a33;
}

.ecml-button-secondary {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}

.ecml-button-secondary:hover {
    background-color: #e1e1e1;
    border-color: #ccc;
}

.ecml-modal-button:focus {
    outline: 2px solid #ff0c3a;
    outline-offset: 2px;
}

/* Dark theme compatibility for modals */
body.dark-theme .ecml-modal-content {
    background: #011F30;
}

body.dark-theme .ecml-modal-content h3 {
    color: #FFFFFF;
}

body.dark-theme .ecml-modal-content p,
body.dark-theme .ecml-modal-content li {
    color: #CCCCCC;
}

body.dark-theme .ecml-button-secondary {
    background-color: #2a3a4a;
    color: #FFFFFF;
    border-color: #3a4a5a;
}

body.dark-theme .ecml-button-secondary:hover {
    background-color: #3a4a5a;
    border-color: #4a5a6a;
}

/* Mobile responsiveness for modals */
@media (max-width: 600px) {
    .ecml-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .ecml-modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .ecml-modal-button {
        width: 100%;
    }
}

/* Loading Overlay */
.ecml-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ecml-loading-content {
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.ecml-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff0c3a;
    border-radius: 50%;
    animation: ecmlSpin 1s linear infinite;
    margin: 0 auto 15px;
}

.ecml-loading-content p {
    margin: 0;
    color: #011f30 !important;
    font-size: 16px;
    font-weight: 500;
}

@keyframes ecmlSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark theme compatibility for loading overlay */
body.dark-theme .ecml-loading-overlay {
    background: rgba(1, 31, 48, 0.6);
}

body.dark-theme .ecml-loading-content p {
    color: #FFFFFF;
}

body.dark-theme .ecml-loading-spinner {
    border-color: #2a3a4a;
    border-top-color: #ff0c3a;
}