/* ════════════════════════════════════════════════════════
   HAM Drill Finder — Elementor Widget Styles
   Codenbytes · v1.1.0
   ════════════════════════════════════════════════════════ */

:root {
  --hdf-brand:   #0072bc;
  --hdf-brand2:  #005a96;
  --hdf-bg:      #f5f7fa;
  --hdf-surface: #ffffff;
  --hdf-border:  #dde3ec;
  --hdf-text:    #1a2035;
  --hdf-muted:   #6b7a99;
  --hdf-subtle:  #a0adc0;
  --hdf-radius:  8px;
  --hdf-sw:      240px;

  /* Material tag colors */
  --hdf-steel:       #3b82f6;
  --hdf-stainless:   #f59e0b;
  --hdf-cast-iron:   #8b5cf6;
  --hdf-aluminium:   #22c55e;
  --hdf-copper:      #f97316;
  --hdf-superalloy:  #ec4899;
  --hdf-titanium:    #14b8a6;
  --hdf-composites:  #eab308;
}

/* ── Wrapper ── */
.hdf-wrap {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--hdf-text);
  background: var(--hdf-bg);
  border: 1px solid var(--hdf-border);
  border-radius: var(--hdf-radius);
  /* NO overflow property here — any overflow value except visible
     creates a scroll container and kills position:sticky on children */
}

/* ══════════════════════════════════════
   FILTER BAR
══════════════════════════════════════ */
.hdf-filterbar {
  background: linear-gradient(135deg, #f8fafd 0%, #ffffff 100%);
  border-bottom: 3px solid var(--hdf-brand);
  padding: 16px 20px 0;
  box-shadow: 0 2px 8px rgba(0,114,188,.06);
}

/* Single row — all controls in one clean line */
.hdf-filter-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  align-items: stretch;
  margin-bottom: 12px;
  background: #fff;
  border: 1.5px solid var(--hdf-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  min-height: 46px;
}

/* Divider between fields */
.hdf-filter-row > * + * {
  border-left: 1px solid var(--hdf-border);
}

/* Search */
.hdf-search-group {
  position: relative;
  flex: 2 1 0;
  min-width: 0;
}
.hdf-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--hdf-brand);
  pointer-events: none;
  opacity: .7;
}
.hdf-search {
  width: 100%;
  height: 100%;
  padding: 12px 12px 12px 38px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--hdf-text);
  background: transparent;
  outline: none;
  box-sizing: border-box;
}
.hdf-search::placeholder { color: var(--hdf-subtle); font-weight: 400; }
.hdf-search:focus { background: #f5f9ff; }

/* Individual select wrappers */
.hdf-field-group {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
}
.hdf-field-group::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--hdf-muted);
  pointer-events: none;
}

/* Selects */
.hdf-select {
  width: 100%;
  height: 100%;
  padding: 12px 28px 12px 12px;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--hdf-text);
  background: transparent;
  appearance: none;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  transition: background 0.15s;
}
.hdf-select:focus { background: #f5f9ff; }
.hdf-select option { font-weight: 400; }

/* Highlight when a filter is active */
.hdf-select:not([value=""]):not(:placeholder-shown) { color: var(--hdf-brand); }
.hdf-select option:not(:first-child) { color: var(--hdf-text); }

/* Reset button */
.hdf-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 16px;
  border: none;
  border-left: 1px solid var(--hdf-border) !important;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--hdf-muted);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.hdf-reset-btn:hover {
  background: #fff0f0;
  color: #e53e3e;
}
.hdf-reset-btn svg { flex-shrink: 0; }

/* Result info bar */
.hdf-result-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  font-size: 12px;
  color: var(--hdf-muted);
  border-top: 1px solid var(--hdf-border);
}
.hdf-result-bar strong { color: var(--hdf-brand); }
.hdf-result-sep { opacity: .35; }
.hdf-active-label {
  color: var(--hdf-brand);
  font-weight: 600;
}

/* ══════════════════════════════════════
   BODY
══════════════════════════════════════ */
.hdf-body {
  display: flex;
  width: 100%;
  align-items: flex-start;
  /* Must NOT have overflow set — would break sticky inside */
}

/* ── Sidebar — sticky inside .hdf-body scroll container (set by JS) ── */
.hdf-sidebar {
  width: var(--hdf-sw);
  min-width: var(--hdf-sw);
  background: var(--hdf-surface);
  border-right: 1px solid var(--hdf-border);
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex-shrink: 0;
}

.hdf-sidebar-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hdf-subtle);
  padding: 0 18px 10px;
}

.hdf-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hdf-nav-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--hdf-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.18s;
  line-height: 1.4;
}
.hdf-nav-link:hover {
  color: var(--hdf-brand);
  background: #f0f7ff;
  border-left-color: #b3d9f5;
}
.hdf-nav-link.active {
  color: var(--hdf-brand);
  background: #e8f4fd;
  border-left-color: var(--hdf-brand);
  font-weight: 600;
}

.hdf-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-top: 5px;
  flex-shrink: 0;
  opacity: 0.5;
}
.hdf-nav-link.active .hdf-nav-dot { opacity: 1; }

.hdf-sidebar-note {
  margin-top: auto;
  padding: 14px 18px;
  font-size: 11px;
  color: var(--hdf-subtle);
  line-height: 1.5;
  border-top: 1px solid var(--hdf-border);
}

/* ── Content — JS sets height + overflow-y on desktop to scroll internally ── */
.hdf-content {
  flex: 1;
  min-width: 0;
  padding: 0;
  /* overflow-y is set by JS on desktop; on mobile it stays default (auto) */
}

/* Section blocks */
.hdf-section {
  padding: 24px 24px 0;
  scroll-margin-top: 20px;
}
.hdf-section:last-child { padding-bottom: 32px; }

/* Section header */
.hdf-sec-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hdf-border);
}
.hdf-sec-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--hdf-brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hdf-sec-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--hdf-text);
  margin: 0 0 4px;
  line-height: 1.3;
}
.hdf-sec-sub {
  font-size: 12px;
  color: var(--hdf-muted);
  margin: 0;
  line-height: 1.5;
}

/* Section divider */
.hdf-section + .hdf-section {
  border-top: 2px solid var(--hdf-border);
  margin-top: 8px;
}

/* ══════════════════════════════════════
   TABLE
══════════════════════════════════════ */
.hdf-table-wrap {
  overflow-x: auto;
  border-radius: var(--hdf-radius);
  border: 1px solid var(--hdf-border);
  margin-bottom: 24px;
}

.hdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.hdf-table thead th {
  background: #f0f5fb;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hdf-muted);
  border-bottom: 1px solid var(--hdf-border);
  white-space: nowrap;
}
.hdf-table tbody tr {
  border-bottom: 1px solid var(--hdf-border);
  transition: background 0.15s;
}
.hdf-table tbody tr:last-child { border-bottom: none; }
.hdf-table tbody tr:hover { background: #f5f9ff; }
.hdf-table td { padding: 9px 14px; vertical-align: middle; }

.hdf-pn {
  font-weight: 700;
  color: var(--hdf-brand);
  font-size: 13px;
  white-space: nowrap;
}
.hdf-dia {
  white-space: nowrap;
  color: var(--hdf-text);
  font-weight: 500;
}

/* Depth pill */
.hdf-depth-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  background: #e8f4fd;
  color: var(--hdf-brand);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Coolant badge */
.hdf-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.hdf-badge.ct {
  background: #dbeafe;
  color: #1d4ed8;
}
.hdf-badge.nc {
  background: #f3f4f6;
  color: #6b7280;
}

/* Catalog page link */
.hdf-page-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hdf-brand);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid #b3d9f5;
  transition: all 0.15s;
  white-space: nowrap;
}
.hdf-page-link:hover {
  background: var(--hdf-brand);
  color: #fff;
  border-color: var(--hdf-brand);
}
.hdf-page-nolink {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}

/* ── Hidden rows/sections ── */
.hdf-row.hdf-hidden         { display: none; }
.hdf-section.hdf-sec-hidden { display: none; }

/* ── No results ── */
.hdf-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--hdf-muted);
  text-align: center;
  gap: 14px;
}
.hdf-no-results svg {
  width: 56px;
  height: 56px;
  color: var(--hdf-subtle);
}
.hdf-no-results p { margin: 0; font-size: 14px; }
.hdf-no-results button {
  padding: 8px 18px;
  border: 1.5px solid var(--hdf-brand);
  border-radius: 6px;
  background: transparent;
  color: var(--hdf-brand);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.hdf-no-results button:hover {
  background: var(--hdf-brand);
  color: #fff;
}

/* ── Scrollbars ── */
.hdf-sidebar::-webkit-scrollbar { width: 5px; }
.hdf-sidebar::-webkit-scrollbar-track { background: transparent; }
.hdf-sidebar::-webkit-scrollbar-thumb { background: var(--hdf-border); border-radius: 3px; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 768px) {
  .hdf-body {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
  }
  .hdf-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    position: static !important;
    top: auto !important;
    height: auto !important;
    max-height: 220px;
    overflow-y: auto;
    border-right: none;
    border-bottom: 1px solid var(--hdf-border);
  }
  .hdf-content {
    width: 100% !important;
    height: auto !important;
    overflow-y: visible !important;
  }
  .hdf-filter-row {
    flex-wrap: wrap;
    border-radius: 8px;
  }
  .hdf-search-group { flex: 1 1 100%; border-left: none !important; }
  .hdf-field-group  { flex: 1 1 calc(50% - 1px); }
  .hdf-reset-btn    { flex: 1 1 100%; justify-content: center; border-top: 1px solid var(--hdf-border) !important; border-left: none !important; }
}
