//Dropdown Sort By Selection

.caketu-site-search-wrapper{
    border-top-left-radius: 0.5em;
    border-top-right-radius: 0.5em;
}
.caketu-sort-dropdown select {
    padding: 4px 6px;
    border-radius: 4px;
}
.caketu-sort-dropdown label {
    margin-right: 6px;
}

.caketu-results-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 1em;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
}
@media (max-width: 767px) {
  .caketu-results-row {
    flex-wrap: wrap;      /* allow wrapping */
    flex-direction: column; /* stack vertically */
    align-items: flex-start; /* align text and dropdown left (or as needed) */
    justify-content: flex-start;
    gap: 0.5em;
  }

  .caketu-results-text,
  .caketu-sort-wrapper {
    width: 100%;      /* full width on mobile for stacking */
  }
}

.caketu-results-text {
  flex: 1 1 auto;
  min-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  color: inherit;
  line-height: inherit;
}

.caketu-sort-wrapper {
    display: flex;
    align-items: center;
    justify-content: var(--caketu-sort-align, flex-start); /* default fallback */
    gap: 0.5em;
}

.caketu-sort-wrapper label {
    margin: 0;
    font-weight: 600;
}

.caketu-sort-wrapper select {
    font-size: 1em;
    padding: 0.25em;
}

.caketu-sort-form {
  display: flex;
  justify-content: var(--flex-horizontal-alignment, flex-start);
  align-items: center;
  gap: 0.5em;
  flex-wrap: wrap;
  text-align: inherit;

}

@media (min-width: 768px) {
  .caketu-results-text {
    white-space: nowrap;
  }
}

.caketu-sort-select {
  padding: 0.4em;
  border-radius: 0.375rem; /* = 6px */
  border: 1px solid #ccc;
  font-size: 1rem;
  max-width: 15rem; /* ~240px */
}
/* ===== Grid Layout ===== */
.caketu-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .5em;
  padding: .5em;
  align-items: stretch;
  background: #fff900;
}

/* 2 columns on mobile (≥360px assumed), 3 on medium screens, 4 on large */
@media (min-width: 480px) {
  .caketu-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 768px) {
  .caketu-results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1200px) {
  .caketu-results-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== Card Wrapper ===== */
.caketu-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1em;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 1rem;
  box-shadow: 0 px 0.5em rgba(0,0,0,0.05);
  gap: 0.75rem;
  box-sizing: border-box;
  overflow: hidden;
}

.caketu-card > * {
  flex-grow: 0;
}

.caketu-card-section {
  margin-top: 0.25rem;
}

.caketu-card-element {
  flex-shrink: 0; /* prevent collapsing */
}

/*temporary debug
.caketu-card-price,
.caketu-card-options {
  outline: 1px dotted red;
}
.caketu-card-price { background-color: rgba(255,0,0,0.05); }
.caketu-card-options { background-color: rgba(0,0,255,0.05); }

.caketu-card-title-wrapper {
  outline: 2px solid limegreen;
  background: rgba(0, 255, 0, 0.2);
}

.caketu-card-product-title {
  outline: 2px dashed darkgreen;
  background: rgba(0, 128, 0, 0.2);
}
end temp debug*/

/* ===== Image Square Crop ===== */
.caketu-card-product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #f8f8f8;
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
}

.caketu-card-product-image img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0.5rem; /* Match container */
}

/* Wrapper for title that creates equal space on all cards */
.caketu-card-title-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  display: block;
  flex-grow: 1;
}

/* ===== Title (natural height, max 3 lines) ===== */
.caketu-card-product-title {
  margin: 0;
  padding: 0;
  max-height: 3.6em;
  font-size: 1rem;  /*remove once Elementor Controls in place*/
  font-weight: 600; /*remove once Elementor Controls in place*/
  line-height: 1.2; /*remove once Elementor Controls in place*/
  text-align: center; /*remove once Elementor Controls in place*/
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Price ===== */
.caketu-card-price {
  margin: 0.2em 0 0 0 !important;
  padding: 0 !important;
  line-height: 1.2;
  font-size: 1rem; /*remove once Elementor Controls in place*/
  font-weight: 500; /*remove once Elementor Controls in place*/
  color: #333;      /*remove once Elementor Controls in place*/
  text-align: center; /*remove once Elementor Controls in place*/
}

/* ===== Options Summary ===== */
.caketu-card-options {
  margin: 0.2em 0 0 0; /* small top spacing only */
  padding: 0;
  line-height: 1em;
  min-height: 1.2em !important;
  /*font-size: 0.9rem; remove once Elementor Controls in place*/
  text-align: center; remove once Elementor Controls in place
}

/* ===== Icon Array ===== */
.caketu-card-icon-array {
  display: flex;
  gap: 0.1rem;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 0 12px;
  margin-top: 0.3em;
}


.caketu-card-icon-array .caketu-card-icon-inner,{
    display: inline-block;
}
/* Align icons array */
{{WRAPPER}} .caketu-card-icon-array {
  text-align: inherit; /* Let Elementor control it */
}
{{WRAPPER}} .caketu-card-icon-inner {
  display: inline-block; /* Makes icons respect text alignment */
}
.caketu-icon-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background-color: #eee;
  font-size: 1em;
  overflow: hidden;
  flex-shrink: 0;
  line-height: 1;
  font-size: 0.9em;
  text-align: center;
}


/* ===== Vendor Info ===== */
.caketu-card-vendor {
  display: flex;
  align-items: center !important;
  gap: 0.2rem;
  font-size: 0.9rem;
  justify-content: center;
  text-align: center;
}

.caketu-card-vendor-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.caketu-vendor-logo {
  height: 2em !important;
  width: 2em !important;
  border-radius: 50% !important;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  margin-right: .3em;
}

/* LEGEND BAR*/
.caketu-icon-legend {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background-color: #fff900; /* reverted to on-brand yellow */
}

/* "Key:" label */
.caketu-legend-label {
  font-weight: bold;
  margin-right: 0.5rem;
  white-space: nowrap;
}

/* Grouping of icon items */
.caketu-legend-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Each item (icon + label) */
.caketu-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* The dot-style icon */
.caketu-legend-item .caketu-icon-dots {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 1rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  line-height: 1;
}

/* Optional: stack legend groups vertically on very small screens */
@media (max-width: 480px) {
  .caketu-icon-legend {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .caketu-legend-group {
    flex-wrap: wrap;
    flex-direction: row; /* Make sure it stays horizontal */
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
  }
}

/* Pagination */
.caketu-pagination {
    text-align: center;
    margin: 1rem 0;
    width: 100%;
}

.caketu-page-info {
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.caketu-results-area {
  width: 100%;
  text-align: center;
}

.caketu-results-banner {
    flex-wrap: wrap;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    width: 100%;
    display: block;
}

.caketu-pagination-container {
    background-color: #fff900;
    text-align: center;
    padding: 0.5em;
    width: 100% !important;
    //margin-top: .5em;
    margin-bottom: .5em;
    border-bottom-left-radius: 0.5em;
    border-bottom-right-radius: 0.5em;
}

/* Fix vertical stacking below legend */
.caketu-results-banner-text {
    display: block;
    width: 100% !important;
    text-align: center;
    padding: 0.5em 1em;
    background-color: #fff900;
    box-sizing: border-box;
}

.caketu-load-more-button {
    display: block;
    margin: 0.5em auto 1em auto;
    background-color: #fff !important;
    color: #333 !important;
    border: 2px solid #63D83B !important;
    transition: all 0.3s ease;
}
.caketu-load-more-button:hover {
    background-color: #63D83B !important;
    color: white !important;
}

/* ===== Utility Safety Net ===== */
.caketu-card * {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ===== Fix scrolling behaviour when filter menu open ===== */
body.caketu-scroll-locked {
  overflow: hidden;
  position: fixed;
  width: 100%;
}
