/* Expandable Search Container */
.zemyna-search-expandable {
    display: flex;
    align-items: center;
    background-color: transparent; /* Changed: Transparent by default so it looks just like an icon */
    border-radius: 100px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 48px;
    width: 48px; /* Same as icon button */
    border: 1px solid transparent;
}

/* Override the pink background bleed from global styles */
.zemyna-search-expandable .zemyna-search-trigger {
    background: transparent !important;
    border: none !important;
    padding: 0;
    cursor: pointer;
    color: #4a5c51 !important; /* Always green */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 48px;
    flex-shrink: 0;
    box-shadow: none !important;
}

.zemyna-search-expandable .zemyna-search-trigger:focus-visible {
    outline: none;
}

.zemyna-search-expandable.is-expanded {
    background-color: #ffffff;
    width: 250px;
    border-color: rgba(74, 92, 81, 0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.zemyna-search-input {
    flex-grow: 1;
    border: none !important;
    background: transparent !important;
    color: #1b2622;
    font-family: var(--zemyna-font-primary, "Inter", sans-serif);
    font-size: 0.95rem;
    padding: 0 !important;
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
    outline: none !important;
    box-shadow: none !important;
}

.zemyna-search-input::placeholder {
    color: rgba(27, 38, 34, 0.4);
}

.zemyna-search-expandable.is-expanded .zemyna-search-input {
    width: auto;
    opacity: 1;
    padding: 0 5px 0 0 !important;
}

.zemyna-search-clear {
    background: transparent !important;
    border: none !important;
    color: rgba(27, 38, 34, 0.4);
    cursor: pointer;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    box-shadow: none !important;
}

.zemyna-search-clear:hover {
    color: #1b2622;
}

/* Search Dropdown Modal - now attaches below */
.zemyna-search-dropdown {
    position: fixed;
    width: 380px;
    background: #ffffff; 
    border: 1px solid rgba(27, 38, 34, 0.08);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.zemyna-search-dropdown.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .zemyna-search-expandable {
        width: 44px;
        height: 44px;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }
    .zemyna-search-expandable .zemyna-search-trigger {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }
    .zemyna-search-expandable.is-expanded {
        flex-grow: 1;
        width: 100%;
        max-width: none;
        background-color: #ffffff;
    }
    
    .zemyna-header__nav {
        flex: 1 1 0%;
        min-width: 0;
        display: flex;
        justify-content: flex-end;
    }
    
    .zemyna-header__mobile-actions-wrapper {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
        flex: 1 1 0%;
        min-width: 0;
    }
    
    .zemyna-search-dropdown {
        position: fixed;
        top: 120px; /* Shifted down to clear header + add a gap */
        left: 20px;
        right: 20px;
        width: auto;
        z-index: 1002;
        max-height: calc(100vh - 140px);
    }
}

/* Hide mobile actions wrapper on desktop */
@media (min-width: 769px) {
    .zemyna-header__mobile-actions-wrapper {
        display: none;
    }
}

@media (max-width: 768px) {
    #zemyna-desktop-search {
        display: none !important;
    }
}

/* Search Input Header */
.zemyna-search-dropdown__header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(27, 38, 34, 0.08);
}

.zemyna-search-dropdown__icon {
    color: #4a5c51;
    margin-right: 1rem;
    flex-shrink: 0;
}

.zemyna-search-dropdown__input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: var(--zemyna-font-primary, "Inter", sans-serif);
    font-size: 1rem;
    color: #1b2622;
    outline: none;
}

.zemyna-search-dropdown__input::placeholder {
    color: rgba(27, 38, 34, 0.4);
}

.zemyna-search-dropdown__close {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: rgba(27, 38, 34, 0.5);
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.zemyna-search-dropdown__close:hover,
.zemyna-search-dropdown__close:focus-visible {
    color: #1b2622;
}

/* Results Area */
.zemyna-search-dropdown__results {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem 0;
}

/* Scrollbar */
.zemyna-search-dropdown__results::-webkit-scrollbar {
    width: 6px;
}
.zemyna-search-dropdown__results::-webkit-scrollbar-track {
    background: transparent;
}
.zemyna-search-dropdown__results::-webkit-scrollbar-thumb {
    background: rgba(27, 38, 34, 0.1);
    border-radius: 10px;
}

.zemyna-search-dropdown__status {
    padding: 1.5rem;
    text-align: center;
    font-family: var(--zemyna-font-primary, "Inter", sans-serif);
    font-size: 0.9rem;
    color: rgba(27, 38, 34, 0.6);
}

.zemyna-search-dropdown__spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(74, 92, 81, 0.2);
    border-top-color: #4a5c51;
    border-radius: 50%;
    animation: zemynaSearchSpin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes zemynaSearchSpin {
    to { transform: rotate(360deg); }
}

/* Single Result Item */
.zemyna-search-dropdown__item {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.zemyna-search-dropdown__item:hover,
.zemyna-search-dropdown__item:focus {
    background-color: #ffffff;
    outline: none;
}

.zemyna-search-dropdown__item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.zemyna-search-dropdown__item-title {
    font-family: var(--zemyna-font-heading, Georgia, serif);
    font-size: 1.1rem;
    color: #1b2622;
    margin: 0;
    font-weight: 500;
}

.zemyna-search-dropdown__item-type {
    font-family: var(--zemyna-font-primary, "Inter", sans-serif);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4a5c51;
    background: rgba(74, 92, 81, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.zemyna-search-dropdown__item-excerpt {
    font-family: var(--zemyna-font-primary, "Inter", sans-serif);
    font-size: 0.85rem;
    color: rgba(27, 38, 34, 0.7);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
