/**
 * Hartman Search Styles
 */

/* Elementor Widget Wrapper Override */
.elementor-widget-hartman-search,
.elementor-widget-hartman-search .elementor-widget-container {
    width: auto !important;
    min-width: 44px !important;
    display: inline-block !important;
}

/* Widget Container */
.hs-search-widget {
    display: inline-block !important;
    position: relative !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    overflow: visible !important;
}

/* Hide template element */
.hs-overlay-template {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Search Trigger Button */
.hs-search-trigger {
    all: unset !important;
    display: block !important;
    width: 44px !important;
    height: 44px !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hs-search-trigger:hover {
    opacity: 0.7 !important;
}

.hs-search-trigger svg {
    width: 24px !important;
    height: 24px !important;
    fill: #000000 !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    pointer-events: none !important;
}

.hs-search-trigger:hover svg {
    fill: #333333 !important;
}

/* Remove any wrapper borders */
.elementor-widget-hartman-search {
    border: none !important;
}

.elementor-widget-hartman-search:hover {
    border: none !important;
    box-shadow: none !important;
}

/* Search Overlay */
.hs-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /*background-color: rgba(0, 0, 0, 0.8);*/
    background-color: rgba(227, 227, 227, 0.95);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.hs-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Search Container */
.hs-search-container {
    width: 100%;
    max-width: 1150px;
    margin: 0 auto;
    padding: 20px;
    transform: translateY(-30px);
    transition: transform 0.4s ease;
    pointer-events: auto;
}

.hs-search-overlay.active .hs-search-container {
    transform: translateY(0);
}

/* Search Box */
.hs-search-box {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px 60px 20px 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    /*margin-bottom: 30px;*/
    display: block;
}

.hs-search-input {
    width: 100%;
    border: 1px solid #ccc !important;
    border-radius:8px !important;
    text-align:center;
    outline: none;
    font-size: 24px;
    font-weight: 400;
    color: #313131;
    background: transparent;
    padding: 0;
    font-family: inherit;
}

.hs-search-input::placeholder {
    color: #ccc;
}

.hs-search-input:focus {
    outline: none;
}

/* Close Button */
.hs-search-close {
    position: absolute;
    right: 3px;
    top: 52%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: none !important;
    outline: none !important;
}

.hs-search-close:hover,
.hs-search-close:focus,
.hs-search-close:active {
    opacity: 0.7;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.hs-search-close svg {
    width: 28px;
    height: 28px;
    fill: #ccc;
}

/* Loading Spinner - Centered in full viewport */
.hs-search-loading {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
}

.hs-search-overlay .hs-search-loading.active {
    opacity: 1 !important;
    visibility: visible !important;
}

.hs-search-overlay .hs-spinner {
    display: block !important;
    width: 60px !important;
    height: 60px !important;
    border: 5px solid rgba(255, 255, 255, 0.3) !important;
    border-top-color: #2a353e !important;
    border-radius: 50% !important;
    animation: hs-spin 0.8s linear infinite !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

@keyframes hs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Container */
.hs-results-container {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: none;
}

.hs-results-container.active {
    opacity: 1;
    visibility: visible;
    display: block;
}

.hs-results-info {
    margin-bottom: 20px;
    text-align: center;
}

.hs-results-count {
    color: #2a353e;
    font-size: 18px;
    font-weight: 600;
    display: inline-block;
    margin-top:30px;
}

.hs-results-wrapper {
    width: 100%;
}

.hs-results-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    transition: opacity 0.3s ease;
}

/* Column layouts */
.hs-columns-2 .hs-product-item {
    width: 50%;
}

.hs-columns-3 .hs-product-item {
    width: 33.333%;
}

.hs-columns-4 .hs-product-item {
    width: 25%;
}

.hs-columns-5 .hs-product-item {
    width: 20%;
}

.hs-columns-6 .hs-product-item {
    width: 16.666%;
}

/* Product Item Styles (matching Hartman Products) */
.hs-product-item {
    box-sizing: border-box;
    padding: 0 10px;
    margin-bottom: 35px;
}

.hs-product-inner {
    background: #2a353e;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border-radius: 4px;
    overflow: hidden;
}

.hs-product-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

/* Product Image */
.hs-product-image {
    position: relative;
    /*margin-bottom: 15px;*/
    overflow: hidden;
}

.hs-product-image a {
    display: block;
    line-height: 0;
}

.hs-product-image img {
    width: 100%;
    height: auto;
    transition: all 0.3s ease;
}

/* NEW Badge */
.hs-new-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
    background-color: #2a353e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.hs-new-badge span {
    color: #ffffff;
    font-size: 14px;
    text-align: center;
    font-weight: 700 !important;
    line-height: 1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Product Title */
.hs-product-title {
    margin: 10px;
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    font-family: "Segoe UI", Sans-serif !important;
    cursor: pointer;
}

.hs-product-title a {
    color: #fff !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
    display: block;
}

.hs-product-title a:hover {
    color: #fff !important;
    text-decoration: none !important;
}

/* Product Rating */
.hs-product-rating {
    margin-bottom: 10px;
    text-align: center;
}

.hs-product-rating .star-rating {
    font-size: 14px;
    color: #ffa500;
}

/* Product Price */
.hs-product-price {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

.hs-product-price .price {
    color: inherit;
}

.hs-product-price .price del {
    color: #999;
    font-weight: normal;
    margin-right: 5px;
}

.hs-product-price .price ins {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
}

/* Add to Cart Button */
.hs-product-add-to-cart {
    margin-top: auto;
    padding: 0 10px 10px 10px;
}

.hs-product-add-to-cart .button {
    width: 100%;
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1;
}

.hs-product-add-to-cart .button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.hs-product-add-to-cart .button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.hs-product-add-to-cart .button.added {
    background: #27ae60;
}

.hs-product-add-to-cart .button.added::after {
    content: "✓";
    margin-left: 5px;
}

/* No Results */
.hs-no-results {
    text-align: center;
    width: 100%;
    /*padding: 60px 20px;*/
    /*background: rgba(255, 255, 255, 0.1);*/
    /*border-radius: 8px;*/
}

.hs-no-results p {
    color: #2a353e;
    font-size: 18px;
    font-weight: 600;
    margin-top: 30px;
    margin: 0;
}

.hs-no-results-contact {
    font-weight: 400 !important;
}

/* Pagination Styles */
.hs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    gap: 8px;
    flex-wrap: wrap;
}

.hs-pagination a,
.hs-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1;
    border-radius: 4px;
}

.hs-pagination a {
    background: #ffffff;
    color: #2a353e !important;
    cursor: pointer;
    text-decoration: none !important;
}

.hs-pagination a:hover {
    background: #2a353e;
    color: #ffffff !important;
    text-decoration: none !important;
}

.hs-pagination .current {
    background: #2a353e;
    color: #ffffff;
    cursor: default;
}

.hs-pagination .disabled {
    background: rgba(255, 255, 255, 0.3);
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
}

.hs-pagination .dots {
    background: transparent;
    color: #ffffff;
    cursor: default;
    border: none;
    font-weight: normal;
}

.hs-pagination .prev,
.hs-pagination .next {
    padding: 8px 16px;
    font-weight: 500;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .hs-columns-5 .hs-product-item,
    .hs-columns-6 .hs-product-item {
        width: 33.333%;
    }
    
    .hs-search-input {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .hs-search-container {
        padding: 15px;
    }
    
    .hs-search-box {
        padding: 15px 50px 15px 15px;
    }
    
    .hs-search-input {
        font-size: 18px;
    }
    
    .hs-columns-3 .hs-product-item,
    .hs-columns-4 .hs-product-item,
    .hs-columns-5 .hs-product-item,
    .hs-columns-6 .hs-product-item {
        width: 50%;
    }
    
    .hs-results-count {
        font-size: 16px;
    }
    
    .hs-pagination a,
    .hs-pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .hs-search-container {
        padding: 10px;
    }
    
    .hs-search-box {
        padding: 12px 45px 12px 12px;
    }
    
    .hs-search-input {
        font-size: 16px;
    }
    
    .hs-search-close svg {
        width: 24px;
        height: 24px;
    }
    
    .hs-columns-2 .hs-product-item,
    .hs-columns-3 .hs-product-item,
    .hs-columns-4 .hs-product-item,
    .hs-columns-5 .hs-product-item,
    .hs-columns-6 .hs-product-item {
        width: 100%;
    }
    
    .hs-product-title {
        font-size: 14px;
    }
    
    .hs-product-price {
        font-size: 14px;
    }
    
    .hs-results-count {
        font-size: 14px;
    }
    
    .hs-pagination {
        gap: 5px;
        padding: 20px 0;
    }
    
    .hs-pagination a,
    .hs-pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .hs-pagination .prev,
    .hs-pagination .next {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .hs-new-badge {
        width: 45px;
        height: 45px;
    }
    
    .hs-new-badge span {
        font-size: 11px;
    }
}

/* Prevent body scroll when overlay is active */
body.hs-search-active {
    overflow: hidden;
}