/* ==========================================================================
   MAADANOL — Product Compare
   ========================================================================== */

/* ---------- Search / picker (dlc-* pattern repeated per-page, same
   convention as downloads.css/industries.css/etc.) ---------- */
.cmp-picker__search{ position: relative; margin-bottom: 16px; }
.cmp-picker__search svg{
  position:absolute; inset-inline-start: 14px; top:16px; color: var(--gray-light); pointer-events: none;
}
.cmp-picker__search input{
  width:100%; padding: 13px 16px 13px 44px; border-radius: 999px; border: 1.5px solid var(--line);
  font-size: 14px; font-family: inherit; background: var(--bg);
}
html[dir="rtl"] .cmp-picker__search input{ padding: 13px 44px 13px 16px; }
.cmp-picker__search input:focus{ outline:none; border-color: var(--accent); background: var(--white); }

.cmp-picker__suggestions{
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; inset-inline-end: 0; z-index: 40;
  background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  max-height: 360px; overflow-y: auto; padding: 8px;
}
.cmp-suggestion{
  display:flex; align-items:center; justify-content: space-between; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-sm); cursor: pointer; transition: background .15s;
}
.cmp-suggestion:hover, .cmp-suggestion:focus{ background: var(--bg); outline: none; }
.cmp-suggestion__name{ font-size: 13.5px; font-weight: 700; color: var(--primary); }
.cmp-suggestion__meta{ font-size: 11.5px; color: var(--gray-light); }
.cmp-suggestion__add{
  font-size: 11px; font-weight: 800; color: var(--accent-text); background: rgba(30,136,229,0.08);
  padding: 4px 10px; border-radius: 999px; flex-shrink:0;
}
.cmp-suggestion.is-disabled{ opacity: .45; cursor: not-allowed; }

.cmp-picker__filters{ display:flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.dlc-filter{
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white);
  font-size: 13px; font-weight: 600; color: var(--gray); font-family: inherit; transition: all .2s;
  white-space: nowrap;
}
.dlc-filter:hover{ border-color: var(--primary); color: var(--primary); }
.dlc-filter.is-active{ background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Selected-product slots ---------- */
.cmp-slots{ display:grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 10px; }
@media (max-width: 1000px){ .cmp-slots{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px){ .cmp-slots{ grid-template-columns: repeat(2, 1fr); } }
.cmp-slot{
  border: 1.5px dashed var(--line); border-radius: var(--radius-md); padding: 14px; text-align:center;
  min-height: 100px; display:flex; flex-direction: column; align-items:center; justify-content:center; gap: 6px;
}
.cmp-slot--filled{ border-style: solid; border-color: var(--accent); background: var(--bg); text-align: start; align-items: stretch; }
.cmp-slot__empty{ font-size: 12px; color: var(--gray-light); }
.cmp-slot__brand{ font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-text); }
.cmp-slot__name{ font-size: 13px; font-weight: 700; color: var(--primary); line-height: 1.4; }
.cmp-slot__remove{
  align-self: flex-end; font-size: 11px; font-weight: 700; color: var(--gray); background: none; border: none;
  padding: 2px 0; margin-top: 4px;
}
.cmp-slot__remove:hover{ color: #d64545; }

.cmp-hint{ font-size: 12.5px; color: var(--gray); text-align:center; margin: 0 0 28px; }

/* ---------- Toolbar ---------- */
.cmp-toolbar{
  display:flex; align-items:center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  padding: 14px 18px; background: var(--bg); border-radius: var(--radius-md); margin-bottom: 22px;
}
.cmp-toggle{ display:flex; align-items:center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer; }
.cmp-toolbar__actions{ display:flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Rule-based summary ---------- */
.cmp-summary{ background: var(--primary); border-radius: var(--radius-lg); padding: 26px 28px; margin-bottom: 28px; color: #fff; }
.cmp-summary__disclaimer{ font-size: 11.5px; color: rgba(255,255,255,0.6); margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px dashed rgba(255,255,255,0.2); }
.cmp-summary h4{ font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--secondary); margin: 14px 0 6px; }
.cmp-summary h4:first-of-type{ margin-top: 0; }
.cmp-summary p, .cmp-summary li{ font-size: 13.5px; line-height: 1.8; color: rgba(255,255,255,0.9); margin: 0; }
.cmp-summary ul{ margin: 0; padding-inline-start: 20px; }

/* ---------- Comparison table (desktop/tablet) ---------- */
.cmp-table-wrap{ overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.cmp-table{ width: 100%; border-collapse: collapse; min-width: 640px; }
.cmp-table th, .cmp-table td{ padding: 14px 16px; text-align: start; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: top; }
.cmp-table thead th{
  background: var(--bg); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  color: var(--primary); position: sticky; top: 0;
}
.cmp-table tbody tr:last-child td{ border-bottom: none; }
.cmp-table .cmp-row-label{ font-weight: 700; color: var(--gray); white-space: nowrap; background: var(--bg); }
.cmp-table td.cmp-cell--empty{ color: var(--gray-light); }
.cmp-table td.cmp-cell--diff{ background: rgba(242,140,40,0.06); }
.cmp-product-head{ display:flex; flex-direction: column; gap: 8px; min-width: 160px; }
.cmp-product-head__media{ width: 100%; aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden; background: linear-gradient(135deg, var(--primary), #1a3f6b); }
.cmp-product-head__media img{ width:100%; height:100%; object-fit: cover; display:block; }
.cmp-product-head__brand{ font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--accent-text); }
.cmp-product-head__name{ font-size: 13.5px; font-weight: 700; color: var(--primary); }
.cmp-product-head__actions{ display:flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cmp-product-head__actions a, .cmp-product-head__actions button{
  font-size: 11px; font-weight: 700; padding: 7px 10px; border-radius: var(--radius-sm); text-align:center; border: none;
}
.cmp-btn--equiv{ background: rgba(30,145,99,0.1); color: #1E9163; }
.cmp-btn--quote{ background: var(--secondary-text); color: #fff; }
.cmp-btn--contact{ background: var(--bg); color: var(--gray); border: 1px solid var(--line) !important; }

.cmp-group-toggle{
  width: 100%; text-align: start; padding: 10px 16px; background: var(--bg); border: none; border-top: 2px solid var(--white);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--primary); cursor: pointer;
}

/* ---------- Mobile card-based comparison (swap in under 760px) ---------- */
.cmp-cards{ display: flex; flex-direction: column; gap: 20px; }
.cmp-card{ border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.cmp-card__media{ width: 100%; aspect-ratio: 16/10; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 14px; background: linear-gradient(135deg, var(--primary), #1a3f6b); }
.cmp-card__media img{ width:100%; height:100%; object-fit: cover; display:block; }
.cmp-card__brand{ font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--accent-text); }
.cmp-card h3{ font-size: 17px; margin: 4px 0 14px; }
.cmp-card__spec{ display:flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cmp-card__spec:last-child{ border-bottom: none; }
.cmp-card__spec span{ color: var(--gray); flex-shrink:0; }
.cmp-card__spec strong{ color: var(--primary); text-align: end; }
.cmp-card__actions{ display:flex; flex-direction: column; gap: 8px; margin-top: 16px; }

@media (max-width: 760px){
  .cmp-table-wrap{ display: none; }
  .cmp-cards{ display: flex; }
}
@media (min-width: 761px){
  .cmp-cards{ display: none; }
}

.cmp-empty{ text-align:center; color: var(--gray); font-size: 13.5px; padding: 40px 0; }

/* ---------- Print ---------- */
@media print{
  .nav, .footer, .mai, .back-to-top, .cmp-picker, .cmp-slots, .cmp-hint, .cmp-toolbar, .breadcrumb{ display: none !important; }
  .cmp-table-wrap{ display: block !important; overflow: visible; }
  .cmp-cards{ display: none !important; }
}
