/* ============================================================
   digtiali-core: Home sections shortcode [digtiali_home_products]
============================================================ */

/* ── Outer wrapper ── */
.dsa-home-sections {
  font-family: "Almarai", sans-serif !important;
  color: #191c1d;
  direction: rtl;
  --dsa-tab-border: rgba(120, 27, 175, 0.2);
  --dsa-tab-bg: #fff;
  --dsa-tab-shadow: 0 4px 20px rgba(78, 0, 120, 0.08);
  --dsa-tab-active-bg: #781baf;
  --dsa-tab-active-text: #fff;
  --dsa-tab-inactive: #5a4d6a;
  --dsa-tab-inactive-hover: #4e0078;
  --dsa-tab-more-bg: rgba(120, 27, 175, 0.1);
  --dsa-tab-more-text: #781baf;
}

.dsa-home-sections *,
.dsa-home-sections *::before,
.dsa-home-sections *::after {
  box-sizing: border-box;
}

/* ── Section intro (title + tabs on one row) ── */
.dsa-home-sections__bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dsa-home-sections__intro {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}

/* Main heading */
.dsa-home-sections__heading {
  margin: 0;
  font-family: "Almarai", sans-serif !important;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

/* Description paragraph */
.dsa-home-sections__desc {
  margin: 0;
  font-size: 0.875rem;
  color: #6b21a8;
  line-height: 1.5;
}


/* ── Tab bar wrapper (for dropdown positioning) ── */
.dsa-home-sections__tabwrap {
  position: relative;
  flex: 0 1 auto;
  width: auto;
  max-width: min(100%, 680px);
  margin-inline-start: auto;
}

/* ── Tab bar — pill container beside section title ── */
.dsa-home-sections__tabs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  direction: rtl;
  flex-wrap: nowrap;
  gap: 0.25rem;
  width: fit-content;
  max-width: 100%;
  padding: 5px 6px;
  overflow: hidden;
  border: 1px solid var(--dsa-tab-border);
  border-radius: 999px;
  background: var(--dsa-tab-bg) !important;
  box-shadow: var(--dsa-tab-shadow);
}

/* wpautop can inject <br> / empty <p> when this block is nested in page content */
.dsa-home-sections__tabwrap > p:empty {
  display: none !important;
  margin: 0 !important;
}

.dsa-home-sections__tab br {
  display: none !important;
}

/* ── Inactive tab ── */
.dsa-home-sections__tab {
  flex-shrink: 0;
  direction: rtl;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.45rem 1rem;
  border: none;
  border-radius: 999px;
  background: transparent !important;
  color: var(--dsa-tab-inactive) !important;
  font-family: "Almarai", sans-serif !important;
  font-size: 0.875rem;
  font-weight: 700 !important;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
}

.dsa-home-sections__tab:hover {
  color: var(--dsa-tab-inactive-hover) !important;
}

.dsa-home-sections__tab::after {
  display: none;
}

/* ── Active tab — solid filled pill ── */
.dsa-home-sections__tab--active {
  background: var(--dsa-tab-active-bg) !important;
  color: var(--dsa-tab-active-text) !important;
  box-shadow: 0 2px 10px rgba(120, 27, 175, 0.28);
}

.dsa-home-sections__tab--active:hover {
  color: var(--dsa-tab-active-text) !important;
  filter: brightness(1.05);
}

/* ── Overflow "…" button ── */
.dsa-home-sections__more {
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: var(--dsa-tab-more-bg);
  color: var(--dsa-tab-more-text);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
  letter-spacing: 0.08em;
}

.dsa-home-sections__more:hover {
  background: rgba(120, 27, 175, 0.16);
  color: #5a1280;
}

/* ── Overflow dropdown ── */
.dsa-home-sections__dropdown {
  position: absolute;
  z-index: 200;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  background: #fff;
  border: 1.5px solid #c4b5fd;
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(78, 0, 120, 0.14);
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
}

.dsa-home-sections__dropdown.is-open {
  display: flex;
}

.dsa-home-sections__dropdown .dsa-home-sections__tab {
  border-radius: 999px;
  text-align: right;
  width: 100%;
  justify-content: flex-start;
}

.dsa-home-sections__dropdown .dsa-home-sections__tab--active {
  box-shadow: none;
}

@media (max-width: 767px) {
  .dsa-home-sections__bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .dsa-home-sections__intro {
    width: 100%;
  }

  .dsa-home-sections__tabwrap {
    width: 100%;
    max-width: 100%;
    margin-inline-start: 0;
  }

  .dsa-home-sections__tabs {
    width: 100%;
    border-radius: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 6px;
    gap: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .dsa-home-sections__tabs::-webkit-scrollbar {
    display: none;
  }

  .dsa-home-sections__tab {
    font-size: 0.8125rem;
    padding: 0.4rem 0.85rem;
  }

  .dsa-home-sections__more {
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
  }
}

/* ── Section panels ── */
.dsa-home-section {
  padding: 0.25rem 0 2rem;
}

/* Per-panel title + description */
.dsa-home-section__header {
  margin-bottom: 1.25rem;
}

.dsa-home-section__title {
  margin: 0 0 0.3rem;
  font-family: "Almarai", sans-serif !important;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.dsa-home-section__desc {
  margin: 0;
  font-size: 0.875rem;
  color: #6b21a8;
  line-height: 1.6;
}

.dsa-home-section[hidden] {
  display: none !important;
}
