/* ==========================================================================
   THEME: MENU MIN KONTO SVG (My Account Menu Icon)
   ========================================================================== */

/* "Min Konto" Menu -> Replaces text with an SVG icon while preserving theme style */
.menu-myaccount-talitor > a {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-indent: -9999px; /* Hides the text visually but keeps it accessible */
    padding-left: 2.0em;
}

/* Inserts the SVG icon using a CSS mask for dynamic color inheritance (currentColor) */
.menu-myaccount-talitor > a::before {
    content: "";
    position: absolute;
    left: 0.2em;
    top: 50%;
    transform: translateY(-50%);
    width: 1.4em;
    height: 1.4em;
    background-color: currentColor; /* Inherits the link color seamlessly */
    pointer-events: none;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a5 5 0 1 0-5-5a5 5 0 0 0 5 5Zm0 2c-4.42 0-8 2.24-8 5v1h16v-1c0-2.76-3.58-5-8-5Z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a5 5 0 1 0-5-5a5 5 0 0 0 5 5Zm0 2c-4.42 0-8 2.24-8 5v1h16v-1c0-2.76-3.58-5-8-5Z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Accessibility: Visible outline when focused via keyboard */
.menu-myaccount-talitor > a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}


/* ==========================================================================
   THEME: SEARCH RESULT
   ========================================================================== */

/* --- 1. WRAPPER: Force full width and Flexbox centering --- */
.search-results .kadence-image-inner-intrisic,      
.search-results .post-thumbnail,     
.search-results .product-image-link {            
    height: 200px !important;        
    width: 100% !important;             /* Forces the box to take full available space */
    margin-top: 6px !important;         /* Top spacing */
    margin-bottom: 0 !important;
    padding: 0 !important;
    display: flex !important;           /* Enables Flexbox for layout control */
    justify-content: center !important; /* Horizontal centering */
    align-items: center !important;     /* Vertical centering */
    background: transparent !important;
}

/* --- 2. IMAGE: Strict centering and sizing rules --- */
.search-results .kadence-image-inner-intrisic img,
.search-results .post-thumbnail img,
.search-results .product-image-link img,
.search-results .product img {
    max-height: 250px !important;       
    max-width: 80% !important;
    height: auto !important;            
    width: auto !important;             
    object-fit: contain !important;     /* Ensures image aspect ratio is preserved */
    border-radius: 10px !important;      
    
    /* Forces auto margins as a fallback for centering */
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    
    display: block !important;
}

/* --- 3. PARENT LINK: Ensure the global link container is centered --- */
.search-results .woocommerce-loop-product__link {
    display: block !important;           
    text-align: center !important;      /* Centers inline content (text/images) within */
    width: 100% !important;
}

/* --- 4. TEXT TRUNCATION: Limit description length strictly on search page --- */

/* Targets post excerpts, page content, and product short descriptions */
.search-results .entry-summary,                         
.search-results .entry-content,                         
.search-results .woocommerce-product-details__short-description { 
    display: -webkit-box;
    -webkit-line-clamp: 4;      /* Cuts off text after 4 lines (Webkit engine) */
    line-clamp: 4;              /* Standard property for cross-browser future-proofing */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;    /* Appends "..." at the end of the truncated text */
}