/* ==========================================================================
   CLOSEST LOCATION PLUGIN STYLES
   ========================================================================== */

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES (Variables)
   ========================================================================== */
:root {
    /* Brand Colors */
    --primary-color: #2b448b;
    --secondary-color: #6c757d;
    
    /* Status Colors */
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    
    /* Neutral Colors */
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --white-color: #ffffff;
    --black-color: #000000;
    --blue-color: #0d6efd;
    
    /* Gray Scale */
    --gray-light: #e9ecef;
    --gray-medium: #666666;
    --gray-border: #eee;
    --gray-background: #f9f9f9;
    
    /* Links */
    --link-color: #0073aa;

    --freshpoint-blue: #035489;

    --freshpoint-orange: rgb(244, 114, 43); 
    --freshpoint-green: #64a047; /* rgb(100, 160, 71) */
    --freshpoint-button-background: var(--freshpoint-green) url("/wp-content/themes/savagedev_wptheme/images/bk-green.png") 0 100% repeat-x;
    --freshpoint-button-background-hover: var(--freshpoint-orange) url("/wp-content/themes/savagedev_wptheme/images/bk-orange.png") 0 100% repeat-x;
}

/* ==========================================================================
   2. BASE LAYOUT & CONTAINER STYLES
   ========================================================================== */
#top-menu-nav:has(#cl-location-dropdown) {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

#cl-location-dropdown {
    margin: 0px;
    width: 100%;
}

#cl-location-dropdown .row {
    margin: 0px !important;
}

.cl-location-select {
    padding: 5px;
    min-width: 250px;
    max-width: 100%;
}

#cl-find-closest {
    padding: 5px 15px;
    display: none;
}

#cl-closest-result {
    margin-top: 15px;
    font-weight: bold;
    display: none;
}

/* ==========================================================================
   3. DROPDOWN WRAPPER & ICON STYLES
   ========================================================================== */
.cl-dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

#mini-mainmenu-push .cl-dropdown-wrapper {
    padding: 7px;
}

.cl-dropdown-wrapper .select2-container {
    flex: 1;
    z-index: 999999;
}
.select2-container{
    z-index: 999999;
}

/* Search Icon */
.cl-search-icon,
.cl-search-icon:disabled {
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 6px !important;
    width: 30px;
    height: 30px;
    border: 1px solid var(--freshpoint-green);
    background-color: var(--freshpoint-green);
    color: var(--white-color);
}

.cl-search-icon svg {
    width: 16px;
    height: 16px;
    fill: var(--white-color);
    transition: all 0.2s ease;
    opacity: 0.8;
}

.cl-search-icon:hover,
.cl-search-icon:focus,
.cl-search-icon:active,
.cl-search-icon:disabled {
    opacity: 1;
    background-color: var(--freshpoint-green) !important;
    border-color: var(--freshpoint-green) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--freshpoint-green), .5) !important;
    outline: 5px auto var(--freshpoint-green) !important;
}

/* ==========================================================================
   4. HEADER & INFO TEXT STYLES
   ========================================================================== */
#db-info-text:has(#cl-location-dropdown) {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

#db-info-text:has(#cl-location-dropdown) .header-button {
    margin: 0px !important;
    min-width: fit-content;
    padding: 5px 10px !important;
}

#top-info .textwidget {
    justify-content: flex-end;
}

/* ==========================================================================
   5. MODAL STYLES
   ========================================================================== */
.modal.show {
    z-index: 109999955;
}

.modal-backdrop {
    z-index: 99998;
}


/* Body states when modal is open/closed */
body.modal-open {
    overflow: hidden;
}

body:not(.modal-open) .modal-backdrop {
    display: none !important;
}

/* Modal Content */
#cl-location-modal .modal-title {
    color: var(--black-color);
    z-index: 99999;
}

.modal-body li,
.modal-body p.text-muted {
    margin-top: 10px;
}

/* ==========================================================================
   6. SELECT2 BASE STYLES
   ========================================================================== */

.cl-shop li{
    margin-bottom: 0px !important;
}

#cl-location-dropdown .select2-container {
    width: 80% !important;
}

.select2-container {
    max-width: 100% !important;
}

.select2-container--open .select2-dropdown {
    z-index: 99999;
}

.select2-results__options {
    max-height: 300px;
}

/* Selection Box */
.select2-container--default .select2-selection--single {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px;
    color: var(--black-color) !important;
    text-align: left;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--gray-medium) !important;
}

/* Dropdown */
.select2-dropdown {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Options */
.select2-container--default .select2-results__option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: var(--black-color) !important;
}

body .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--freshpoint-green) !important;
    color: var(--white-color) !important;
}

.cl-shop.select2-container--default .select2-results__option--highlighted{
    background-color: var(--freshpoint-green) !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: var(--gray-light) !important;
    color: var(--black-color) !important;
}

.cl-shop.select2-container--default .select2-results,
.cl-shop.select2-container--default .select2-results #select2-cl-location-select-results,
.cl-shop.select2-container--default .select2-dropdown{
    border-color: var(--freshpoint-green) !important;
    border-radius: 5px !important;
}

/* ==========================================================================
   7. BUTTON STYLES
   ========================================================================== */
.btn-corporate {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--white-color) !important;
}

.btn-corporate:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--white-color) !important;
    opacity: 0.9;
}

/* ==========================================================================
   8. OSM ATTRIBUTION FOOTER
   ========================================================================== */
#cl-osm-attribution {
    text-align: center;
    padding: 15px 0;
    font-size: 12px;
    color: var(--gray-medium);
    border-top: 1px solid var(--gray-border);
    background-color: var(--gray-background);
}

#cl-osm-attribution a {
    color: var(--link-color);
    text-decoration: none;
}

#cl-osm-attribution a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   9. SHOP BUTTON LAYOUT
   Enabled via settings page
   ========================================================================== */
.cl-shop-layout {
    width: auto !important;
    display: inline-block;
}

/* Hide the search icon in shop layout */
.cl-shop-layout .cl-search-icon {
    display: none !important;
}

/* Style Select2 as a button */
.cl-shop-layout .select2-container {
    width: auto !important;
    min-width: 120px;
}

.cl-shop-layout .select2-container--default .select2-selection--single {
    border: none !important;
    border-radius: 5px !important;
    height: 30px !important;
    padding: 0 12px !important;
    display: flex !important;
    justify-content: center;
    align-items: center;

    background: var(--freshpoint-button-background) !important;
}

.cl-shop-layout .select2-container--default .select2-selection--single:hover {
    background: var(--freshpoint-button-background-hover) !important;
    background-position: 0 100% !important;
    background-repeat: repeat-x !important;
}

/* Shop Layout Text Styling */
.cl-shop-layout .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #cbdf87 !important;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0;
    line-height: 11px;
    font-family: 'futura-pt-n7', 'futura-pt',Arial, sans-serif;
    text-align: center;
}

.cl-shop-layout .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #cbdf87 !important;
}

/* Shop Layout Arrow Styling */
.cl-shop-layout .select2-container--default .select2-selection--single .select2-selection__arrow {
    position: relative;
    top: auto;
    right: auto;
    height: auto;
    width: auto;
    margin-left: 10px;
}

.cl-shop-layout .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #cbdf87 transparent transparent transparent;
    border-width: 5px 4px 0 4px;
    position: relative;
    top: auto;
    left: auto;
    margin: 0;
    float: left;
}

.cl-shop-layout .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #cbdf87 transparent;
    border-width: 0 4px 5px 4px;
}

/* Shop Layout Dropdown (now appended to body) */
.select2-container--cl-shop .select2-dropdown {
    width: auto !important;
    min-width: 350px !important;
    margin-top: 5px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 109999999 !important;
    font-family: inherit;
}

.select2-container--cl-shop .select2-results__option {
    white-space: nowrap !important;
    font-size: 14px;
}


/* Hide search and clear button in shop layout */
.cl-shop-layout .select2-selection__clear,
.select2-container--cl-shop .select2-search {
    display: none !important;
}

.cl-shop .select2-dropdown{
   max-width: 250px !important;
    position: relative !important;
    left: 0px !important;
    transform: translateX(-25%);
}

.modal.show .modal-dialog{
    transform: translate(-50%, -50%);
    left: 50% !important;
    top: 50% !important;
    margin: 0 !important;
}

.modal strong{
    color: var(--freshpoint-green);
}

.modal .location-visit,
.modal .location-phone{
    background-color: var(--freshpoint-orange) !important;
    color: var(--white-color) !important;
    border-color: var(--freshpoint-orange) !important;
}

/* ==========================================================================
   10. THEME SPECIFIC OVERRIDES (Moved from theme custom.css)
   ========================================================================== */
#cl-location-dropdown {
    max-width: 250px;
    display: inline-flex;
}



#top-info {
    width: 100%;
}

#top-info p {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#top-info .textwidget:has(> #loginWrap) p{
    top: -1px !important
}


#headerWrap-sticky-wrapper #headerWrap #headerInner #headerContent #top-info .button.buttonGreen {
    margin-left: 5px;
    margin-right: 0px;
    margin-top: 0px !important;
    padding: 9.5px 10px !important
}

#top-info #loginToggle a > span{
    padding: 10px 0 10px 30px !important;
    font-size: 11px;
}

#top-info #loginWrap {
    float: right;
}

#cl-location-modal .btn-corporate{
    color: #fff;
    background-color: var(--freshpoint-blue) !important;
    border-color: var(--freshpoint-blue) !important;
}

#cl-location-modal .btn-outline-info{
    color: var(--freshpoint-blue) !important;
    border-color: var(--freshpoint-blue) !important;
}

#cl-location-modal  .location-visit,
#cl-location-modal  .location-visit:hover{
    color: var(--white-color) !important;
    background-color: var(--freshpoint-orange) !important;
    border-color: var(--freshpoint-orange) !important;
}

#cl-location-modal .btn-outline-info:hover{
    color: var(--white-color) !important;
    background-color: var(--freshpoint-blue) !important;
    border-color: var(--freshpoint-blue) !important;
}


.select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-container .select2-selection--single{
    height: 31px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered{
    line-height: 29px !important;
}



/* ==========================================================================
   11. MEDIA QUERIES
   ========================================================================== */

/* Medium screens and below (1100px) */
@media screen and (max-width: 1100px) {

    .cl-shop-container > span {
        width: 100%;
    }

    .cl-shop-container span > a {
        font-size: 1.250em;
        border-bottom: 1px solid #64a047 !important;
    }

    .modal.show .modal-dialog{
        transform: translate(-50%, -50%);
        top: 50%;
        left: 50%;
    }

    #db-info-text:has(#cl-location-dropdown) {
        flex-direction: column-reverse;
    }

    .menu-mainmenu .display_locations_dropdown .container ,
    .menu-mainmenu .display_shop_dropdown .cl-shop-container {
        padding: 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .menu-mainmenu .cl-shop-layout {
        width: 200px !important;
        margin-top: 5px !important;
        margin-bottom: 5px;
    }

    .cl-shop .select2-dropdown{
        transform: translateX(0%);
    }
}

/* Tablet screens (768px) */
@media screen and (max-width: 768px) {
    
    #cl-location-dropdown .select2-container {
        width: 100% !important;
    }
    
    .cl-shop-layout .select2-container {
        min-width: 100px;
    }
}

/* Mobile screens (480px) */
@media screen and (max-width: 480px) {
    .cl-location-select {
        min-width: 100%;
    }
    
    .cl-shop-layout .select2-container--default .select2-selection--single {
        padding: 6px 12px;
    }
    
    .cl-shop-layout .select2-container--default .select2-selection--single .select2-selection__rendered {
        font-size: 13px;
    }
}

