/* Typesense Search Results Styling */

.typesense-search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.typesense-search-form {
    position: relative;
    width: 100%;
    height: 42px; /* Fixed height to prevent jumping */
}

.typesense-search-container.mobile {
    width: 100%;
}

.typesense-search-container.desktop .typesense-search-input {
    width: 260px;
}

.typesense-search-container .typesense-search-form .typesense-search-close-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    display: none;
    width: 20px;
    height: 20px;
    text-align: center;
    z-index: 2;
}

.typesense-search-container .typesense-search-form .typesense-search-close-btn.show {
    display: block;
}

.typesense-search-container .typesense-search-form .typesense-search-close-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.typesense-search-container .typesense-search-input {
    flex-grow: 1;
    padding: 8px;
    border: 2px solid #fff;
    background-color: transparent !important;
    background: transparent !important;
    color: #fff;
}

.typesense-search-container .typesense-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.typesense-search-input:focus {
    outline: none;
    border-color: #fff;
    color: #fff;
}

/* For WebKit browsers (Chrome, Safari) */
.typesense-search-input::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* For Firefox */
.typesense-search-input::-moz-placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* For Internet Explorer */
.typesense-search-input:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* For Edge */
.typesense-search-input::-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.typesense-search-container.mobile .typesense-search-results,
.typesense-search-container.desktop .typesense-search-results {
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
}

.typesense-search-container.mobile .typesense-search-results {
    max-width: 500px;
    width: 90vw;
    left: 50%;
    transform: translateX(-60%);
}

.typesense-search-container.desktop .typesense-search-results {
    width: 550px;
    right: 0;
    left: auto;
}

.typesense-search-results {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    border: 1px solid #ccc;
    background: white;
    z-index: 1000;
    line-height: 1;
    height: 0;
    max-height: 0;
    padding: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.typesense-search-results.show {
    display: block !important;
    visibility: visible;
    opacity: 1;
    height: auto;
    max-height: 500px;
    padding: 10px;
    overflow-y: auto;
}

.typesense-search-input:focus + .typesense-search-results,
.typesense-search-results.show {
    display: block;
}

/* Category Styling */
.typesense-result-category-item {
    color: #d50277;
    font-size: 1.1em;
    margin-bottom: 1px;
    transition: background-color 0.2s ease;
    margin: 0 10px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Update mobile category styling */
@media screen and (max-width: 767px) {
    .typesense-result-category-item {
        font-size: 0.9em;
        margin: 0 5px;
    }

    .typesense-result-category-item a {
        padding: 1px 5px 1px 20px;
        font-size: 1em;
    }
}

.typesense-result-category-item:first-child {
    margin-top: 5px;
}

.typesense-result-category-item:last-child {
    margin-bottom: 5px;
}

.typesense-result-category-item a {
    color: #d50277;
    font-size: 1.0em;
    text-decoration: none;
    display: block;
    padding: 2px 5px 2px 25px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.typesense-result-category-item a:hover {
    text-decoration: underline;
}

/* Product Styling */
.typesense-result-product {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0;
    margin: 0;
    border-bottom: none;
}

.typesense-result-product > a {
    flex: 0 0 30px;
    align-self: flex-start;
}


.typesense-result-product img {
    display: block;
    width: 30px;
    height: 30px;
    margin-right: 5px;
    object-fit: cover;
    max-width: 30px;
    max-height: 30px;
}

.typesense-result-product-details {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.typesense-result-product-title {
    font-weight: 600;
    font-size: 1.14em;
    margin: 0;
    padding: 0;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.85);
}

/* 3rd row (e.g., Lungimi range) */
.typesense-result-product-meta{
    font-size: 0.95em;
    opacity: 0.9;
    color: #d50277;
}


/* Code line: "Cod: <SKU> <extra info>" */
.typesense-result-product-code{
    font-size: 0.95em;
    opacity: 0.95;
}

.typesense-code-label{
    font-weight: 400;
}

.typesense-code-value{
    font-weight: 400;
}

.typesense-code-extra{
    /* match the old meta look, but inline */
    font-size: 0.95em;
    opacity: 1;
    color: #d50277;
    font-weight: 600;
}

.typesense-result-product-title a {
    color: rgba(0, 0, 0, 0.85);
    text-decoration: none;

    /* Clamp long names to 2 lines with ellipsis */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.typesense-result-product-title a:hover {
    text-decoration: underline;
}

.typesense-result-product-tags {
    color: #0066cc;
    font-size: 1em;
    margin: 0;
    padding: 0;
}

.typesense-search-container .typesense-search-input {
    flex-grow: 1;
    width: 100%;
    padding: 8px 35px 8px 8px;
}

/* Optional: style for the bullet separator */
.typesense-result-product-tags span + span::before {
    content: " ";
    display: inline-block;
    margin: 0 2px;
}

.typesense-search-container {
    position: relative;
    width: 100%;
}

.typesense-search-container.desktop,
.typesense-search-container.mobile {
    display: flex;
    align-items: center;
}

.typesense-search-container .typesense-search-input {
    width: 100%;
    padding: 8px 40px 8px 8px;
    border: 2px solid #fff;
    background-color: transparent !important;
    background: transparent !important;
    color: #fff;
    box-sizing: border-box;
}

/* Force hide the blog title and related elements */
body.search .page-title,
body.search .title-blog,
body.search .entry-header,
body.search .page-header {
    display: none !important;
}

/* Reset any theme padding that might affect our container */
body.search .main-page-wrapper,
body.search .site-content {
    padding-top: 0 !important;
}

/* Container styles */
.schcss-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.schcss-title {
    margin-bottom: 10px;
    font-size: 16px;
    text-align: left;
}

/* Force grid layout for products */
.schcss-products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Product card styles */
.schcss-product {
    display: flex !important;
    align-items: flex-start !important;
    padding: 15px !important;
    border: 1px solid #eee !important;
    border-radius: 4px !important;
    background: #fff !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.schcss-product-image {
    width: 100px !important;
    height: 100px !important;
    object-fit: cover !important;
    margin-right: 15px !important;
    flex-shrink: 0 !important;
}

.schcss-product-details {
    flex: 1 !important;
    min-width: 0 !important;
}

.schcss-product-title {
    margin-bottom: 10px !important;
}

.schcss-product-title a {
    color: #333 !important;
    text-decoration: none !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    display: block !important;
    line-height: 1.4 !important;
}

.schcss-product-title a:hover {
    text-decoration: underline !important;
    text-decoration-color: black !important;  /* Add this line */
}

.schcss-product-tags {
    color: #666 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

/* Categories styling */
.schcss-categories {
    margin-bottom: 30px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

.schcss-category-item {
    margin: 0 !important;
}

.schcss-category-item a {
    color: #d50277 !important;
    text-decoration: none !important;
    padding: 5px 10px !important;
    border: 1px solid #d50277 !important;
    border-radius: 4px !important;
    display: inline-block !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .schcss-products {
        grid-template-columns: 1fr !important;
    }
    
    .schcss-product-image {
        width: 80px !important;
        height: 80px !important;
    }
    
    .schcss-container {
        padding: 0 15px;
    }
}

/* Additional theme-specific overrides */
body.search .title-design-centered,
body.search .page-title-default {
    display: none !important;
}

/* Remove any unwanted margins from theme */
body.search .site-content > .container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Force our styles to take precedence */
body.search .main-page-wrapper {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Promo badge (debug + can stay) */
.typesense-result-badge-promo{
  display:inline-block;
  margin-left:8px;
  padding:2px 6px;
  border-radius:4px;
  background:#ffeb3b;
  color:#000;
  font-weight:600;
  font-size:12px;
  line-height:1.2;
}

/* Footer message: remaining results */
.typesense-result-more {
  padding: 10px 12px;
  font-size: 13px;
  opacity: 0.85;
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* footer message for remaining results */
.typesense-more-results{
  padding: 2px 5px 2px 25px;
  margin: 10px 10px 0 10px; /* add spacing from last product */
  color: #d50277;
  font-size: 1.0em;
  opacity: 1;
  font-weight: 600;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Mobile: match category style/spacing */
@media screen and (max-width: 767px) {
  .typesense-more-results{
    padding: 1px 5px 1px 20px;
    margin: 8px 5px 0 5px;
    font-size: 0.9em;
    font-weight: 600;
  }
}


/* ===== Search results page (/search/<q>/) ===== */
.schcss-container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}
.schcss-title{
  font-size: 18px;
  font-weight: 600;
  margin: 10px 0 18px;
}
.schcss-cats{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
}
.schcss-cat{
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 2px solid #d50277;
  color: #d50277;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.2;
}
.schcss-cat:hover{ opacity: .9; }

.schcss-error{
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 8px;
  margin-bottom: 14px;
}

.schcss-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 768px){
  .schcss-grid{ grid-template-columns: 1fr; }
}

.schcss-card{
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  min-height: 120px;
}
.schcss-thumb{
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.schcss-thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.schcss-body{
  flex: 1 1 auto;
  min-width: 0;
}
.schcss-name{
  font-size: 18px;
  font-weight: 600;
  color: rgba(0,0,0,.85);
  line-height: 1.25;
  margin: 2px 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.schcss-cod{
  font-size: 15px;
  color: rgba(0,0,0,.75);
}
.schcss-cod-label{ font-weight: 400; }
.schcss-cod-val{ font-weight: 500; }

.schcss-extra{
  margin-left: 10px;
  font-weight: 700;
  color: #d50277;
}

.schcss-len{
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.25;
}
.schcss-len-label,
.schcss-len-mm{
  color: #d50277;
  font-weight: 700;
}
.schcss-len-black{
  color: rgba(0,0,0,.85);
  font-weight: 400;
}
