/* WCFM Store List Right Sidebar Grid Layout targeting the search form and store listing parent container */
#wcfmmp-stores-lists {
    display: grid !important;
    grid-template-columns: 1fr 280px !important;
    grid-template-areas: "content sidebar" !important;
    gap: 30px !important;
    align-items: start !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Position search form wrapper in the sidebar area on the right */
#wcfmmp-stores-lists .wcfmmp-store-search-form {
    grid-area: sidebar !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 16px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Hide the location selection dropdowns and their select2 elements */
#wcfmmp-stores-lists .wcfmmp-store-search-form select#wcfmmp_store_country,
#wcfmmp-stores-lists .wcfmmp-store-search-form select#wcfmmp_store_state,
#wcfmmp-stores-lists .wcfmmp-store-search-form select#wcfmmp_store_country + .select2-container,
#wcfmmp-stores-lists .wcfmmp-store-search-form select#wcfmmp_store_state + .select2-container {
    display: none !important;
}

/* Base styles for visible inputs and native selects to make them compact and elegant */
#wcfmmp-stores-lists .wcfmmp-store-search-form input:not([type="hidden"]),
#wcfmmp-stores-lists .wcfmmp-store-search-form select {
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    line-height: 38px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    background-color: #f9fafb !important;
    color: #374151 !important;
    box-sizing: border-box !important;
    display: block;
    outline: none !important;
    transition: all 0.2s ease-in-out !important;
}

#wcfmmp-stores-lists .wcfmmp-store-search-form input:not([type="hidden"]):hover,
#wcfmmp-stores-lists .wcfmmp-store-search-form select:hover {
    border-color: #9ca3af !important;
}

#wcfmmp-stores-lists .wcfmmp-store-search-form input:not([type="hidden"]):focus,
#wcfmmp-stores-lists .wcfmmp-store-search-form select:focus {
    border-color: #87a386 !important; /* Theme accent green */
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(135, 163, 134, 0.15) !important;
}

/* Ensure native select elements are hidden if select2 is loaded on them */
#wcfmmp-stores-lists .wcfmmp-store-search-form select.select2-hidden-accessible {
    display: none !important;
}

/* Select2 Container Overrides for elegant styling (if any are left visible) */
#wcfmmp-stores-lists .wcfmmp-store-search-form .select2-container {
    width: 100% !important;
    margin: 4px 0 !important;
    box-sizing: border-box !important;
}

#wcfmmp-stores-lists .wcfmmp-store-search-form .select2-container .select2-selection--single {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    background-color: #f9fafb !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.2s ease-in-out !important;
    outline: none !important;
}

#wcfmmp-stores-lists .wcfmmp-store-search-form .select2-container .select2-selection--single:hover {
    border-color: #9ca3af !important;
}

#wcfmmp-stores-lists .wcfmmp-store-search-form .select2-container.select2-container--open .select2-selection--single {
    border-color: #87a386 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(135, 163, 134, 0.15) !important;
}

#wcfmmp-stores-lists .wcfmmp-store-search-form .select2-container .select2-selection--single .select2-selection__rendered {
    padding-left: 12px !important;
    padding-right: 32px !important;
    font-size: 13px !important;
    color: #374151 !important;
    line-height: 38px !important;
    width: 100% !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

#wcfmmp-stores-lists .wcfmmp-store-search-form .select2-container .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    right: 10px !important;
    width: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#wcfmmp-stores-lists .wcfmmp-store-search-form .select2-container .select2-selection--single .select2-selection__arrow b {
    border-color: #6b7280 transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

#wcfmmp-stores-lists .wcfmmp-store-search-form .select2-container.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #6b7280 transparent !important;
    border-width: 0 4px 5px 4px !important;
}

/* Position the main stores card list in the content area on the left */
#wcfmmp-stores-lists #wcfmmp-stores-wrap-holder {
    grid-area: content !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure store cards inside grid adjust nicely */
#wcfmmp-stores-lists .wcfmmp-store-wrap {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Responsive design for tablets and mobile devices */
@media (max-width: 768px) {
    #wcfmmp-stores-lists {
        grid-template-columns: 1fr !important;
        grid-template-areas: 
            "sidebar"
            "content" !important;
        gap: 20px !important;
    }
}

.hzm-derogation-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    margin-bottom: 15px;
    cursor: pointer;
}

.hzm-derogation-toggle-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.hzm-derogation-disabled {
    opacity: 0.75;
}

.hzm-derogation-disabled label,
.hzm-derogation-disabled .input-wrapper,
.hzm-derogation-disabled input,
.hzm-derogation-disabled select {
    color: #6b7280;
}

.hzm-derogation-locked-notice {
    margin: 15px 0;
    padding: 12px;
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    color: #b45309;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}
