/**
 * Two Roads Product Finder CSS
 * 
 * Styles for the product finder functionality
 */

/* Main product finder wrapper */
.tr-product-finder-wrap {
    position: relative;
}

.product_finder_hero {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Map controls */
.map_control_wrap {
    margin: 20px 0 0 0;
    position: relative;
}

.map_controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
    margin-bottom: 0 !important;
}

.map_controls input,
.map_controls select,
.map_controls button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 0 !important;
    font-size: 14px;
}

.map_controls input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.map_controls select {
    min-width: 120px;
}

.map_controls button {
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.map_controls button:hover {
    background: #005a87;
}

.tr-geolocate {
    background: #666 !important;
    min-width: auto !important;
    padding: 8px 10px !important;
    font-size: 16px;
}

.tr-geolocate:hover {
    background: #444 !important;
}

/* Error messages */
.map_control_wrap .error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}

/* Map container */
#tr-finder-map {
    width: 100%;
    min-height: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Loading spinner */
.spinner {
    text-align: center;
    padding: 20px;
}

.spinner.hidden {
    display: none;
}

.spinner img {
    width: 32px;
    height: 32px;
}

/* Results container */
.result_wrapper {
    margin-top: 30px;
}

#tr-finder-results-container {
    margin-top: 20px;
}

/* Individual result styling */
.tr-finder-result {
    background: #f9f9f9 !important;
    border: 1px solid #000;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.wrap .map_controls button.geolocate {
    background-color:#ffc72c !important;
    height:45px !important;
    width:45px !important;
    line-height: 1;
    border-left:2px solid #000;
    border-bottom:2px solid #000;
    border-top:2px solid #000;
}

.wrap .map_controls #tr-radius {
    border-right:2px solid #000;
    border-bottom:2px solid #000;
    border-top:2px solid #000;
}

.wrap .map_controls button.search_btn {
    height:45px !important;
    border-right:2px solid #000;
    border-bottom:2px solid #000;
    border-top:2px solid #000;
}

.tr-finder-result:hover {
    background: #f0f0f0;
}

.tr-finder-result .location-image {
    width: 24px;
    height: 24px;
    float: right;
    margin-left: 10px;
}

.tr-finder-result .location-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.tr-finder-result .location-address {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.tr-finder-result .location-phone {
    color: #007cba;
    font-size: 14px;
}

/* Info window styling */
.tr-finder-infowindow {
    max-width: 300px;
}

.tr-finder-location {
    margin: 10px 0;
    color: #666;
}

.tr-finder-beer-list {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.tr-finder-beer-list li {
    margin-bottom: 3px;
    font-size: 13px;
}

/* Form-only styling */
.tr-finder-form-wrap {
    position: relative;
    text-align: center;
    padding: 40px 20px;
}

.tr-finder-form-wrap.default {
    background: #f8f9fa;
    border-radius: 8px;
}

.tr-finder-form-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    z-index: 1;
}

.tr-finder-form-inner {
    position: relative;
    z-index: 2;
}

.tr-finder-form-title {
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

.finder-form-wrap form {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.finder-form-wrap input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.finder-form-wrap input[type="submit"] {
    padding: 12px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.finder-form-wrap input[type="submit"]:hover {
    background: #005a87;
}

/* Embed styling */
.tr-finder-embed-wrap {
    position: relative;
    width: 100%;
}

.tr-finder-embed-wrap iframe {
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Widget styling */
.tr-product-finder-widget .finder-form-wrap {
    padding: 20px 0;
    background: none;
}

.tr-product-finder-widget .finder-form-wrap form {
    flex-direction: column;
    gap: 10px;
}

.tr-product-finder-widget input[type="text"],
.tr-product-finder-widget input[type="submit"] {
    width: 100%;
    box-sizing: border-box;
}

/* Responsive design */
@media (max-width: 768px) {
    .map_controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .map_controls input,
    .map_controls select,
    .map_controls button {
        width: 100%;
        margin-bottom: 0;
    }
    
    .finder-form-wrap form {
        flex-direction: column;
        gap: 15px;
    }
    
    .tr-finder-result .location-image {
        float: none;
        display: block;
        margin: 0 auto 10px;
    }
}

/* Map title and subtitle */
.map_title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.map_subtitle {
    font-size: 14px;
    color: #666;
    margin-top: 20px;
    text-align: center;
}

/* Product selector */
#product-name-select {
    min-width: 150px;
}

#product-name-select select {
    width: 100%;
    border-top:2px solid #000;
    border-left:2px solid #000;
    border-right:2px solid #000;
    border-radius: 0 !important;
    margin-bottom:0;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.pull-right {
    float: right;
}

.text-center {
    text-align: center;
}

/* Bootstrap compatibility */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-lg-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 15px;
}

.col-sm-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 15px;
}

.col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 15px;
}

@media (max-width: 576px) {
    .col-sm-4,
    .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
