/* Tooldic Live Search Styles - Override ALL theme styles */

/* SHORTCODE: Force MAXIMUM width - najwazniejsze! */
.tooldic-live-search-form,
body .tooldic-live-search-form,
.page .tooldic-live-search-form,
.site .tooldic-live-search-form,
article .tooldic-live-search-form,
div .tooldic-live-search-form,
section .tooldic-live-search-form,
body .header-search-bar .tooldic-live-search-form,
.woocommerce-product-search,
body .woocommerce-product-search,
body .header-search-bar .woocommerce-product-search {
    position: relative !important;
    width: 100% !important;
    min-width: unset !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    border: none !important;
    background: transparent !important;
    display: block !important;
}

/* Search wrapper - clean design without orange */
.tooldic-live-search-form .search-wrapper,
body .tooldic-live-search-form .search-wrapper,
.page .tooldic-live-search-form .search-wrapper,
.site .tooldic-live-search-form .search-wrapper,
body .header-search-bar form,
body .woocommerce-product-search {
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 50px !important;
    padding: 5px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    position: relative !important;
    overflow: visible !important;
    width: 100% !important;
    min-width: unset !important;
    max-width: 500px !important;
    margin: 0 auto !important;
}

/* Remove any gradients or before/after pseudo elements */
.tooldic-live-search-form .search-wrapper::before,
.tooldic-live-search-form .search-wrapper::after,
body .header-search-bar form::before,
body .header-search-bar form::after,
body .woocommerce-product-search::before,
body .woocommerce-product-search::after {
    display: none !important;
    content: none !important;
}

/* Focus state - gray border only */
.tooldic-live-search-form .search-wrapper:focus-within,
body .header-search-bar form:focus-within,
body .woocommerce-product-search:focus-within {
    background: #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
    transform: translateY(-1px) !important;
    border: 1px solid #999 !important;
}

/* Search input field */
.tooldic-live-search-form .search-field,
body .tooldic-live-search-form .search-field,
body .header-search-bar input[type="search"],
body .woocommerce-product-search input[type="search"] {
    border: none !important;
    background: transparent !important;
    padding: 16px 130px 16px 30px !important;
    font-size: 16px !important;
    width: 100% !important;
    outline: none !important;
    color: #333 !important;
    font-weight: 400 !important;
    position: relative !important;
    z-index: 2 !important;
}

.tooldic-live-search-form .search-field::placeholder,
body .header-search-bar input[type="search"]::placeholder {
    color: #999 !important;
    font-style: normal !important;
    transition: color 0.3s !important;
}

.tooldic-live-search-form .search-wrapper:focus-within .search-field::placeholder,
body .header-search-bar form:focus-within input[type="search"]::placeholder {
    color: #bbb !important;
}

/* Submit button - with "Szukaj" text */
.tooldic-live-search-form .search-submit,
body .tooldic-live-search-form .search-submit,
body .header-search-bar button[type="submit"],
body .woocommerce-product-search button[type="submit"] {
    position: absolute !important;
    right: 5px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    border: none !important;
    background: #e05c0b !important;
    color: white !important;
    cursor: pointer !important;
    padding: 0 !important;
    border-radius: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    z-index: 3 !important;
    width: 110px !important;
    min-width: 110px !important;
    height: 50px !important;
    font-weight: 600 !important;
    font-size: 0 !important;
}

/* Hide button text (we use ::after instead) */
.tooldic-live-search-form .search-submit .button-text,
body .header-search-bar button[type="submit"] .button-text,
body .woocommerce-product-search button[type="submit"] .button-text {
    display: none !important;
    visibility: hidden !important;
    font-size: 0 !important;
}

/* Add "Szukaj" text with ::after */
.tooldic-live-search-form .search-submit::after,
body .header-search-bar button[type="submit"]::after,
body .woocommerce-product-search button[type="submit"]::after {
    content: "Szukaj" !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #fff !important;
    display: block !important;
}

/* Button hover */
.tooldic-live-search-form .search-submit:hover,
body .header-search-bar button[type="submit"]:hover,
body .woocommerce-product-search button[type="submit"]:hover {
    background: #d04a0a !important;
    transform: translateY(-50%) scale(1.02) !important;
}

/* Hide ALL search icons (lupka) */
.tooldic-live-search-form .search-submit svg,
body .header-search-bar button[type="submit"] svg,
body .woocommerce-product-search button[type="submit"] svg,
body .header-search-bar .base-search-icon-wrap,
body .base-search-icon-wrap {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

/* Results Container */
.tooldic-search-results-container {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    right: 0;
    background: #ffffff !important;
    border: 1px solid rgba(224, 92, 11, 0.2);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(224, 92, 11, 0.05);
    z-index: 9999;
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideDown 0.3s ease-out;
    scrollbar-width: thin;
    scrollbar-color: #e05c0b rgba(224, 92, 11, 0.2);
    display: none;
    width: 100%;
    color: #333 !important;
}

/* Force all text inside results to be dark - override header white text */
.tooldic-search-results-container *,
.tooldic-search-results-container a,
.tooldic-search-results-container span,
.tooldic-search-results-container li,
.tooldic-search-results-container div {
    color: #333 !important;
    background-color: transparent !important;
}

.tooldic-search-results-container .search-result-price,
.tooldic-search-results-container .view-all a {
    color: #e05c0b !important;
}

.tooldic-search-results-container .search-result-sku {
    color: #777 !important;
}

.tooldic-search-results-container .view-all a {
    background: rgba(224, 92, 11, 0.1) !important;
}

.tooldic-search-results-container .tooldic-search-results li a {
    color: #333 !important;
    background: transparent !important;
}

.tooldic-search-results-container .tooldic-search-results li a:hover {
    background: rgba(224, 92, 11, 0.05) !important;
    color: #333 !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooldic-search-results-container::-webkit-scrollbar {
    width: 6px;
}

.tooldic-search-results-container::-webkit-scrollbar-track {
    background: rgba(224, 92, 11, 0.1);
    border-radius: 3px;
}

.tooldic-search-results-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #e05c0b, #ff6b35);
    border-radius: 3px;
}

/* Search Results */
.tooldic-search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: hidden;
}

.tooldic-search-results li {
    border-bottom: 1px solid rgba(224, 92, 11, 0.1);
    transition: all 0.2s ease;
    width: 100%;
    overflow: hidden;
}

.tooldic-search-results li:last-child {
    border-bottom: none;
}

.tooldic-search-results li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tooldic-search-results li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(224, 92, 11, 0.05), transparent);
    transition: left 0.4s;
}

.tooldic-search-results li a:hover::before {
    left: 100%;
}

.tooldic-search-results li a:hover {
    background: linear-gradient(135deg, rgba(224, 92, 11, 0.05), rgba(255, 107, 53, 0.05));
}

.search-result-thumb img {
    border-radius: 10px;
    margin-right: 15px;
    object-fit: cover;
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.tooldic-search-results li a:hover .search-result-thumb img {
    transform: scale(1.1);
}

.search-result-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.search-result-title {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    margin-bottom: 5px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-price {
    color: #e05c0b;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 3px;
}

.search-result-price ins {
    text-decoration: none;
}

.search-result-price del {
    color: #999;
    font-weight: 400;
    margin-right: 5px;
}

.search-result-sku {
    font-size: 12px;
    color: #777;
    font-style: italic;
}

.view-all {
    width: 100%;
    overflow: hidden;
}

.view-all a {
    justify-content: center;
    font-weight: bold;
    color: #e05c0b;
    padding: 15px !important;
    background: linear-gradient(135deg, rgba(224, 92, 11, 0.1), rgba(255, 107, 53, 0.1));
    border-radius: 0 0 15px 15px;
    transition: all 0.3s ease;
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

.view-all a:hover {
    background: linear-gradient(135deg, rgba(224, 92, 11, 0.2), rgba(255, 107, 53, 0.2));
    color: #d04a0a;
}

.search-loading, .no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.search-loading {
    color: #e05c0b;
}

/* Responsive */
@media (max-width: 768px) {
    .tooldic-live-search-form {
        max-width: 100%;
    }

    .tooldic-live-search-form .search-wrapper {
        padding: 6px 20px;
    }

    .tooldic-live-search-form .search-field {
        font-size: 14px;
        padding: 10px 8px;
    }

    .tooldic-live-search-form .search-submit {
        width: 35px;
        height: 35px;
        padding: 8px;
    }

    .tooldic-search-results li a {
        padding: 12px 15px;
    }

    .search-result-thumb img {
        width: 40px;
        height: 40px;
    }

    .search-result-title {
        font-size: 14px;
    }

    .search-result-price {
        font-size: 13px;
    }
}

/* RESPONSYWNOSC dla SHORTCODE - wazne aby bylo na koncu! */
@media screen and (max-width: 850px) {
    .tooldic-live-search-form,
    body .tooldic-live-search-form,
    .page .tooldic-live-search-form,
    .tooldic-live-search-form .search-wrapper,
    body .tooldic-live-search-form .search-wrapper {
        min-width: unset !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media screen and (max-width: 600px) {
    .tooldic-live-search-form,
    body .tooldic-live-search-form,
    .page .tooldic-live-search-form,
    .tooldic-live-search-form .search-wrapper,
    body .tooldic-live-search-form .search-wrapper {
        min-width: unset !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .navbar-search {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* ============================================
   WERSJA MOBILNA - [tooldic_search_mobile]
   ============================================ */

/* Wersja mobilna ZAWSZE 100% szerokości - bez min-width! */
.tooldic-live-search-form.tooldic-mobile,
body .tooldic-live-search-form.tooldic-mobile,
.page .tooldic-live-search-form.tooldic-mobile,
.site .tooldic-live-search-form.tooldic-mobile,
article .tooldic-live-search-form.tooldic-mobile,
div .tooldic-live-search-form.tooldic-mobile,
section .tooldic-live-search-form.tooldic-mobile {
    position: relative !important;
    width: 100% !important;
    min-width: auto !important; /* USUN min-width */
    max-width: 100% !important; /* 100% zamiast 800px */
    margin: 0 auto !important;
    border: none !important;
    background: transparent !important;
    display: block !important;
}

.tooldic-live-search-form.tooldic-mobile .search-wrapper,
body .tooldic-live-search-form.tooldic-mobile .search-wrapper,
.page .tooldic-live-search-form.tooldic-mobile .search-wrapper,
.site .tooldic-live-search-form.tooldic-mobile .search-wrapper {
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 50px !important;
    padding: 5px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    position: relative !important;
    overflow: visible !important;
    width: 100% !important;
    min-width: auto !important; /* USUN min-width */
    max-width: 100% !important; /* 100% zamiast 800px */
    margin: 0 auto !important;
}

/* Pole input w wersji mobilnej */
.tooldic-live-search-form.tooldic-mobile .search-field {
    padding: 14px 110px 14px 20px !important; /* Mniejsze paddingi dla mobile */
    font-size: 15px !important;
}

/* Przycisk w wersji mobilnej */
.tooldic-live-search-form.tooldic-mobile .search-submit {
    width: 100px !important; /* Trochę węższy przycisk */
    height: 45px !important;
    font-size: 14px !important;
}

/* Wyniki wyszukiwania dla mobile - węższe */
.tooldic-live-search-form.tooldic-mobile + .tooldic-search-results-container,
.tooldic-live-search-form.tooldic-mobile ~ .tooldic-search-results-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: auto !important;
}

