/*!
 * Schematic Parts – sp-overrides.css
 * Path: assets/css/sp-overrides.css
 *
 * UNLAYERED – selle faili reeglid on teadlikult väljaspool @layer'd,
 * et nad võidaksid alati teema/Woo CSS-i üle (layered CSS < unlayered CSS).
 */

/* ═══════════════════════════════════════════════════════════════
 * ASTRA KONTEINER-RESET (ainult SP vaadetel: body.sp-view)
 *
 * Astra loob get_header() kaudu:
 *   #page > .site-content > .ast-container > #primary
 * Need konteinerid lisavad max-width, padding, sidebar-ruumi jne.
 * Resetime need, et SP saaks oma layout'i kontrollida.
 * ═══════════════════════════════════════════════════════════════ */

/* 1) .ast-container: eemalda max-width ja kesktamine
 *    NB: AINULT .site-content sees – header/footer jääb puutumata! */
body.sp-view .site-content > .ast-container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* 2) .site-content: eemalda flex-sidebar layout */
body.sp-view .site-content {
  display: block;
}

/* 3) #primary / .content-area: eemalda laiusepiirangud */
body.sp-view #primary,
body.sp-view .content-area {
  width: 100%;
  max-width: 100%;
  float: none;
  margin: 0;
}

/* 4) Peida sidebar SP vaadetel */
body.sp-view #secondary,
body.sp-view .widget-area,
body.sp-view .sidebar-main {
  display: none;
}

/* 5) Astra separate-container: eemalda article padding */
body.sp-view.ast-separate-container #primary,
body.sp-view.ast-separate-container .ast-article-single,
body.sp-view.ast-separate-container .ast-article-post,
body.sp-view .ast-article-single,
body.sp-view .ast-article-post {
  padding: 0;
  margin: 0;
  background: transparent;
}

/* 6) Astra page-header (Title bar) – peidame SP vaadetel,
   sest SP genereerib oma H1 pealkirja */
body.sp-view .ast-page-header-section,
body.sp-view .entry-header {
  display: none;
}

/* 7) SP wrapper: vaba laiusega, teema piiranguteta */
body.sp-view .sp-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
 * SP KOMPONENTIDE OVERRIDES (Woo / YITH konfliktid)
 * ═══════════════════════════════════════════════════════════════ */

/* Viimane kaitsekiht ainult päris teema/Woo konfliktidele */
.sp-parts-table .sp-col-actions .button.sp-atc--icon,
.sp-parts-table .sp-col-actions .button.add_to_cart_button.sp-atc--icon {
  background: var(--tm-red) !important;
  color: #fff !important;
  border: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════
 * SP TOAST – UNLAYERED overrides
 * sp-base.css toast on @layer sp sees → Astra unlayered reset
 * tapab nupu stiilid. Need reeglid tagastavad korrektse välimuse.
 * ═══════════════════════════════════════════════════════════════ */

.sp-page #sp-toast-wrap .sp-toast {
  padding: 28px 34px 24px;
  min-width: 360px;
  text-align: left;
}

.sp-page #sp-toast-wrap .sp-toast .sp-title {
  font-weight: 700;
  font-size: 14px;
  padding-right: 56px;
}

.sp-page #sp-toast-wrap .sp-toast .sp-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--sp-border-color, #d1d1d1);
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  padding: 0;
  min-width: 0;
  min-height: 0;
  transition: border-color .15s, background .15s;
}

.sp-page #sp-toast-wrap .sp-toast .sp-x:hover {
  border-color: #aaa;
  background: var(--sp-muted-bg, #f5f5f5);
  filter: none;
}

.sp-page #sp-toast-wrap .sp-toast .sp-actions {
  display: flex;
  justify-content: flex-start;
  gap: 24px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eef0f3;
}

.sp-page #sp-toast-wrap .sp-toast .sp-link {
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  color: var(--tm-red, #e10600);
  background: transparent;
  border: none;
  padding: 0;
}

.sp-page #sp-toast-wrap .sp-toast .sp-link:hover {
  text-decoration: underline;
}
