/* PShowBlockSearch - Modal Search (Figma Design) */

/* ===== BODY SCROLL LOCK ===== */
html.scroll-block {
    overflow: hidden;
    scrollbar-gutter: stable;
}

body.scroll-block {
    overflow: hidden;
}

/* ===== TRIGGER BUTTON (looks like input) ===== */
.search-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 240px;
    height: 50px;
    padding: 0 24px;
    background: #ffffff;
    border: 1px solid #E2E2E2;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: Lato;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 3%;
    color: #374053;
    margin-right: 32px;
}

.search-trigger svg {
    flex-shrink: 0;
}

.search-trigger__text {
    color: #B5B5B5;
    flex-grow: 1;
    text-align: left;
}

.search-trigger:hover {
    border-color: #0bbf20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ===== MODAL ===== */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 150px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.search-modal.active {
    opacity: 1;
    pointer-events: auto;
}

/* Backdrop */
.search-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.15);
    backdrop-filter: blur(2px);
}

/* Modal Container - Figma structure: padding on container, not children */
.search-modal__container {
    position: relative;
    width: 962px;
    background: rgba(255,255,255,0.98);
    border: 1px solid #E6E7E7;
    border-radius: 20px;
    box-shadow: 0px 8px 30px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.25s ease;
    padding: 24px 24px 0 24px;
}

.search-modal.active .search-modal__container {
    transform: translateY(0);
}

/* ===== MODAL HEADER ===== */
.search-modal__header {
    display: flex;
    align-items: center;
    gap: 62px;
    margin-bottom: 20px;
    height: 84px;
}

.search-modal__input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 713px;
    height: 58px;
    padding: 0 24px;
    background: #F2F4F8;
    border: 1px solid #E2E2E2;
    border-radius: 100px;
    transition: all 0.25s ease;
}

.search-modal__input-wrapper:focus-within {
    background: #fff;
    border-color: #0bbf20;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.search-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.search-modal__input {
    border: none;
    background: transparent;
    flex-grow: 1;
    width: 560px;
    height: 100%;
    padding: 0;
    font-weight: 500;
    font-size: 14px;
    line-height: 26px;
    color: #000;
    outline: none;
}

.search-modal__input::placeholder {
    color: #B5B5B5;
    font-weight: 500;
}

.search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #fff;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    flex-shrink: 0;
    color: #717680;
    transition: color 0.2s, background 0.2s;
}

.search-clear:hover {
    color: #ff4d4f;
}

.search-clear svg {
    width: 16px;
    height: 16px;
}

/* Search Submit Button (magnifying glass) */
.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    color: #374053;
    transition: color 0.2s ease, opacity 0.2s;
}

.search-submit:hover {
    color: #0bbf20;
}

.search-submit svg {
    width: 24px;
    height: 24px;
}

/* Cancel Button - Desktop: text "Anuluj", Mobile: X icon */
.search-modal__cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 48px;
    padding: 24px;
    background: transparent;
    border: 1px solid #000;
    border-radius: 100px;
    cursor: pointer;
      
    font-weight: 600;
    font-size: 14px;
    color: #606167;
    flex-shrink: 0;
    transition: all 0.2s;
}

.search-modal__cancel:hover {
    background: #f5f5f5;
    border-color: #ff4d4f;
    color: #ff4d4f;
}

/* Desktop: show text, hide icon */
.search-modal__cancel .cancel-text {
    display: block;
}

.search-modal__cancel .cancel-icon {
    display: none;
}

/* ===== MODAL CONTENT ===== */
.search-modal__content {
    height: 423px;
    overflow: hidden;
}

.search-modal__columns {
    display: flex;
    gap: 20px;
}

.search-modal__left {
    flex: 1;
    padding-right: 0;
}

.search-modal__right {
    width: 419px;
    padding-left: 0;
}

/* Section Title - Figma Specs */
.section-title {
      
    font-weight: 600;
    font-size: 14px;
    color: #000;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    padding: 8px 4px;
    border-radius: 4px;
    height: 32px;
    line-height: 16px;
    margin-bottom: 0;
}

/* Right column title has more padding */
.search-modal__right .section-title {
    padding: 8px 12px;
}

/* Tags */
.search-section {
    margin-bottom: 20px;
}

.tags-container {
    padding-right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
      
    font-weight: 400;
    font-size: 14px;
    color: #000;
    text-decoration: none;
    transition: all 0.2s;
    height: 32px;
    line-height: 16px;
}

.history-tag-wrapper {
    position: relative;
    display: inline-block;
}

.history-tag-wrapper:hover {
    z-index: 100;
}

.history-tag {
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.history-tag:hover {
    border-color: transparent;
    box-shadow: none;
    transform: translateY(-2px);
}

.history-tag::after {
    content: attr(data-full-name);
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 12px 0 32px;
    background: #fff;
    border: 1px solid #26e644;
    border-radius: 4px;
      
    font-size: 14px;
    color: #000;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 11;
}

.history-tag:hover::after {
    opacity: 1;
}

.history-tag svg {
    position: relative;
    z-index: 12;
}

.popular-tag {
    background: #fff;
    border: 2px solid #e8eaee;
    gap: 4px;
    margin-top: 12px;
}

.popular-tag:hover {
    border-color: #0bbf20;
    color: #0bbf20;
}

.history-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.remove-icon {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    margin-left: 4px;
    transition: all 0.2s;
}

.popular-tag:hover .remove-icon path {
    stroke: #ff4d4f;
}

/* Promoted Products */
.promoted-products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 12px;
}

/* Scrollbar for promoted products */
.promoted-products-list::-webkit-scrollbar {
    width: 4px;
}

.promoted-products-list::-webkit-scrollbar-track {
    background: transparent;
}

.promoted-products-list::-webkit-scrollbar-thumb {
    background: #0bbf20;
    border-radius: 100px;
}

.promoted-products-list::-webkit-scrollbar-thumb:hover {
    background: #099a1a;
}

.promoted-products-list {
    scrollbar-width: thin;
    scrollbar-color: #0bbf20 transparent;
}

.promoted-product-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid #f8f8f8;
    border-radius: 40px;
    text-decoration: none;
    transition: all 0.2s;
}

.promoted-product-card:hover {
    background: #ede9e9;
    border-color: #0bbf20;
}

.product-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 4px rgba(206,206,206,0.05);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
}

.product-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.product-name {
    font-weight: 700;
    font-size: 20px;
    color: #000;
    line-height: 28px;
}

.product-meta {
      
    font-weight: 400;
    font-size: 14px;
    color: #999faa;
    display: flex;
    gap: 12px;
    align-items: center;
    line-height: 20px;
}

.product-meta .separator {
    width: 1px;
    /* height: 24px;
    background: #e8eaee; */
}

/* Results */
.search-modal__results {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.results-tabs {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 0;
    margin-bottom: 20px;
    padding-left: 24px;
}

.results-tabs__label {
      
    font-weight: 600;
    font-size: 16px;
    line-height: 16px;
    color: #000;
}

.results-tab {
    display: flex;
    align-items: center;
    gap: 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 0;
    cursor: pointer;
      
    font-weight: 600;
    font-size: 14px;
    line-height: 16px;
    color: #000;
    transition: all 0.2s;
}

.results-tab.active {
    border-bottom-color: #26e644;
}

.results-tab .tab-name {
    font-size: 14px;
}

.results-tab .tab-count {
    font-size: 10px;
    color: rgba(151, 151, 151, 0.6);
    margin-left: 2px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: scroll;
    overflow-x: hidden;
    padding-right: 12px;
    padding-bottom: 8px;
    scrollbar-gutter: stable;
}

/* Scrollbar for results */
.results-container::-webkit-scrollbar {
    width: 4px;
}

.results-container::-webkit-scrollbar-track {
    background: transparent;
}

.results-container::-webkit-scrollbar-thumb {
    background: #0bbf20;
    border-radius: 100px;
}

.results-container::-webkit-scrollbar-thumb:hover {
    background: #099a1a;
}

.results-container {
    scrollbar-width: thin;
    scrollbar-color: #0bbf20 transparent;
}

.result-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 40px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 40px;
    text-decoration: none;
    transition: all 0.2s;    
    box-sizing: border-box;
    gap: 70px;
}


.result-card:hover {
    border-color: #0bbf20;
    background: #ede9e9;
}

.result-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.result-card-right {
    display: flex;
    align-items: center;
    gap: 70px;
    flex: 1;
    justify-content: flex-end;
}

.result-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0px 4px 4px 0px rgba(206,206,206,0.05);
    padding: 15px 0;
}

.result-icon-product {
    background: #fff;
}

.result-icon-product img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.result-icon-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 24px;
}

.result-icon-page {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    font-size: 24px;
}

.result-icon-manufacturer {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
    font-size: 24px;
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    min-width: 0;
}

.result-name {
       
    font-weight: 700;
    font-size: 16px;
    color: #000;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-meta {
      
    font-weight: 400;
    font-size: 14px;
    color: #999faa;
    line-height: 1.2;
}

.result-price {
       
    font-weight: 600;
    font-size: 16px;
    color: #000;
    width: 138px;
    text-align: center;
}

.check-btn {
    background: #0bbf20;
    color: #fff;
    padding: 8px 24px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100px;
      
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    width: 104px;
}

.result-card:hover .check-btn {
    background: #099a1a;
}

/* No Results */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.no-results-title {
      
    font-weight: 600;
    font-size: 18px;
    color: #374053;
    margin-bottom: 8px;
}

.no-results-subtitle {
       
    font-size: 14px;
    color: #999faa;
}

/* ===== MODAL FOOTER ===== */
.search-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 29px 20px;
    border-top: none;
    background: #fff;
    border-radius: 0 0 20px 20px;
}

.footer-text {
    color: #999faa;
    font-size: 14px;
}

.results-count {
      
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #999faa;
}

.all-results-link {
      
    font-weight: 700;
    font-size: 16px;
    line-height: 22px;
    color: #000;
    text-decoration: underline;
    display: flex;
    align-items: center;
    gap: 8px;
}

.all-results-link i {
    font-size: 12px;
}

.all-results-link:hover {
    color: #0bbf20;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .search-modal__container {
        width: calc(100% - 40px);
    }

    .search-modal__columns {
        flex-direction: column;
    }

    .search-modal__left,
    .search-modal__right {
        width: 100%;
        padding: 0;
        border: none;
    }
}

/* ===== MOBILE RESPONSIVE (< 768px) ===== */
@media (max-width: 992px) {
    .search-trigger {
        display: none !important;
    }

    .search-modal {
        padding-top: 0;
        align-items: stretch;
    }

    .search-modal__container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        padding: 16px 16px 0 16px;
    }

    .search-modal__header {
        gap: 12px;
        margin-bottom: 10px;
        flex-direction: row-reverse;
    }

    .search-modal__input-wrapper {
        width: auto;
        flex-grow: 1;
        height: 48px;
        padding: 0 16px;
    }

    .search-modal__input {
        width: 100%;
        font-size: 16px;
    }

    .search-modal__cancel {
        width: 48px;
        height: 48px;
        padding: 0;
        border-radius: 50%;
    }

    .search-modal__cancel .cancel-text {
        display: none;
    }

    .search-modal__cancel .cancel-icon {
        display: block;
    }

    .search-modal__columns {
        flex-direction: column;
        gap: 0;
    }

    .search-modal__left,
    .search-modal__right {
        width: 100%;
    }

    .search-modal__right {
        width: 100%;
    }

    .results-count {
        font-size: 12px;
    }

    .results-tabs {
        padding-left: 12px;
        padding-right: 6px;
        gap: 18px;
    }

    .all-results-link {
        font-size: 14px;
    }

    .promoted-product-card {
        padding: 8px 12px;
    }

    .product-image {
        width: 50px;
        height: 50px;
    }

    .product-name {
        font-size: 14px;
    }

    .product-meta {
        font-size: 12px;
    }

    .result-card {
        padding: 8px 16px;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .result-card-left {
        gap: 12px;
    }

    .result-card-right {
        gap: 0;
        justify-content: flex-end;
    }

    .result-icon {
        width: 50px;
        height: 50px;
        padding: 10px 0;
    }

    .result-icon-product img {
        width: 40px;
        height: 40px;
    }

    .result-name {
        font-size: 14px;
    }

    .result-meta {
        font-size: 12px;
    }

    .result-price {
        font-size: 14px;
        flex: 1;
        text-align: center;
        width: auto;
    }

    .check-btn {
        height: 38px;
        padding: 0 16px;
        font-size: 11px;
        margin-left: auto;
    }

    .results-tabs__label {
        display: none;
    }

    .search-modal__content {
        height: auto;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        overflow-x: hidden;
    }

    .promoted-products-list,
    .results-container {
        max-height: none;
        overflow: visible;
        padding-right: 8px;
    }

    /* Scrollbar for mobile content */
    .search-modal__content::-webkit-scrollbar {
        width: 4px;
    }

    .search-modal__content::-webkit-scrollbar-track {
        background: transparent;
    }

    .search-modal__content::-webkit-scrollbar-thumb {
        background: #0bbf20;
        border-radius: 100px;
    }
}

@media (max-width: 384px) {
    .results-tabs {
        padding-left: 0;
    }
}
