/* =========================================
   EC Product Compare - Styles
   File: assets/css/compare.css
   ========================================= */

:root {
  --ec-border: #ececec;
  --ec-muted: #6b7280;
  --ec-bg-soft: #fafafa;
  --ec-white: #ffffff;
  --ec-black: #111111;
  --ec-shadow: 0 10px 30px rgba(0,0,0,.08);
  --ec-shadow-soft: 0 6px 18px rgba(0,0,0,.08);
  --ec-radius: 16px;
  --ec-radius-sm: 12px;
  --ec-radius-xs: 10px;
}

/* =========================================
   Compare Button (shortcode)
   ========================================= */
.ec-compare-btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 12px;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: #111;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  opacity: .95;
  border-radius: 50px !important;
}

.ec-compare-btn:before {
  content: "⇆";
  font-size: 16px;
  line-height: 1;
  opacity: .85;
}

.ec-compare-btn:hover {
  opacity: 1;
  text-decoration: underline;
  background-color: #0177D7;
}

.ec-compare-btn.is-added {
  color: #fff;
  opacity: .85;
  background-color: #000;
}

.ec-compare-btn.is-loading {
  opacity: .6;
  pointer-events: none;
}

/* =========================================
   Toast
   ========================================= */
.ec-compare-toast {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 999999;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(17, 17, 17, 0.95);
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  font-size: 14px;
  box-shadow: var(--ec-shadow-soft);
}
.ec-compare-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   Compare Bar (bottom)
   Shortcode: [ec_compare_bar]
   ========================================= */
.ec-compare-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--ec-border);
}

.ec-compare-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 14px;
  align-items: center;
  direction: rtl; /* האתר שלך RTL */
}

.ec-compare-bar-title {
  font-size: 22px;
  font-weight: 800;
  color: #111;
  white-space: nowrap;
}

.ec-compare-bar-items {
  display: flex;
  gap: 12px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.ec-compare-bar-items::-webkit-scrollbar {
  height: 6px;
}
.ec-compare-bar-items::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
  border-radius: 20px;
}

.ec-compare-bar-empty {
  color: var(--ec-muted);
  font-size: 14px;
  white-space: nowrap;
}

.ec-compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ec-white);
  border: 1px solid var(--ec-border);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,.05);
  min-height: 44px;
}

.ec-compare-chip-img img {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

.ec-compare-chip-title {
  text-decoration: none;
  color: #111;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.ec-compare-chip-title:hover {
  text-decoration: underline;
}

.ec-compare-chip-remove {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--ec-border);
  background: #fff;
  cursor: pointer;
  line-height: 28px;
  font-size: 18px;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ec-compare-bar-actions {
  display: flex;
  justify-content: flex-start;
}

.ec-compare-bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  color: #fff !important;
  background-color: #0177D7;
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
  white-space: nowrap;
}

.ec-compare-bar-btn:hover {
  filter: brightness(.98);
}

.ec-compare-bar-btn.is-disabled {
  opacity: .5;
  pointer-events: none;
}

/* כדי שלא יכסה תוכן האתר (אופציונלי) */


/* =========================================
   Compare Table (matrix layout)
   Shortcode: [ec_compare_table layout="matrix"]
   ========================================= */
.ec-compare-wrap {
  direction: rtl;
}

.ec-compare-actions {
  display: flex;
  gap: 10px;
  margin: 0 0 12px;
}

.ec-compare-clear {
  appearance: none;
  border: 1px solid var(--ec-border);
  background: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.ec-compare-clear:hover {
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}

.ec-compare-empty {
  padding: 14px;
  border: 1px dashed #ddd;
  border-radius: var(--ec-radius-sm);
  background: #fff;
  direction: rtl;
}

/* matrix wrapper */
.ec-compare-matrix-wrap {
  width: 100%;
  overflow: auto;
  border-radius: var(--ec-radius);
  border: 1px solid var(--ec-border);
  background: #fff;
  box-shadow: var(--ec-shadow-soft);
}

.ec-compare-matrix {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px; /* כדי שהעמודות ייראו כמו בדוגמא */
}

.ec-compare-matrix th,
.ec-compare-matrix td {
  border-bottom: 1px solid var(--ec-border);
  border-left: 1px solid var(--ec-border);
  padding: 14px 14px;
  vertical-align: middle;
}

.ec-compare-matrix tr:last-child th,
.ec-compare-matrix tr:last-child td {
  border-bottom: 0;
}

.ec-compare-matrix th:last-child,
.ec-compare-matrix td:last-child {
  border-left: 0;
}

.ec-compare-matrix-label-col {
  width: 210px;
  background: #fcfcfc;
}

.ec-compare-matrix-label {
  background: #fcfcfc;
  font-weight: 800;
  color: #111;
  white-space: nowrap;
  font-size: 15px;
}

.ec-compare-matrix-product-col {
  position: relative;
  text-align: center;
  min-width: 280px;
  padding-top: 22px;
}

.ec-compare-remove-circle {
  position: absolute;
  top: 12px;
  left: 12px; /* RTL: זה נראה טוב גם */
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--ec-border);
  background: #fff;
  cursor: pointer;
  line-height: 28px;
  font-size: 18px;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0,0,0,.06);
}

.ec-compare-card-thumb img {
  width: 120px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
}

.ec-compare-card-title {
  display: block;
  text-decoration: none;
  font-weight: 900;
  color: #111;
  margin: 0 auto 12px;
  max-width: 220px;
  line-height: 1.2;
}

.ec-compare-card-title:hover {
  text-decoration: underline;
}

.ec-compare-card-cart .button,
.ec-compare-card-cart a.button {
  width: 100%;
  max-width: 220px;
  border-radius: 999px !important;
  font-weight: 800;
}

/* cells */
.ec-compare-matrix-cell {
  text-align: center;
  font-weight: 600;
}

/* Woo price styling inside matrix */
.ec-compare-matrix-cell del {
  opacity: .45;
  margin-inline: 6px;
}
.ec-compare-matrix-cell ins {
  text-decoration: none;
  font-weight: 900;
}

/* =========================================
   Fallback Table (if layout="table")
   ========================================= */
.ec-compare-table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: var(--ec-radius);
  border: 1px solid var(--ec-border);
  background: #fff;
  box-shadow: var(--ec-shadow-soft);
}

.ec-compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.ec-compare-table th,
.ec-compare-table td {
  border-bottom: 1px solid var(--ec-border);
  padding: 12px;
  vertical-align: middle;
}

.ec-compare-product {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ec-compare-thumb img {
  width: 70px;
  height: auto;
  display: block;
  border-radius: 10px;
}

.ec-compare-title {
  text-decoration: none;
  font-weight: 800;
  color: #111;
}

.ec-compare-remove-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  padding: 6px 8px;
}

.ec-compare-bar.is-hidden {
  display: none !important;
}



/* =========================================
   Responsive
   ========================================= */
@media (max-width: 1024px) {
  .ec-compare-bar-inner {
    grid-template-columns: 160px 1fr 160px;
  }
  .ec-compare-bar-title {
    font-size: 18px;
  }
}

@media (max-width: 768px) {


  .ec-compare-bar-inner {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }

  .ec-compare-bar-actions {
    justify-content: center;
  }

  .ec-compare-bar-items {
    justify-content: center;
  }

  .ec-compare-chip-title {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ec-compare-matrix {
    min-width: 760px;
  }
}