/* ================================================
   AllCalculate.com — assets/css/nav.css
   Navigation styles — header, search, dropdowns, mobile
   ================================================ */

/* ── HEADER ── */
.ac-hdr {
  background: #fff;
  border-bottom: 1px solid #e8e5df;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(26,24,20,.06);
  font-family: "DM Sans", sans-serif;
}
.ac-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 0;
}

/* ── LOGO ── */
.ac-logo {
  font-family: "DM Serif Display", serif;
  font-size: 1.4rem;
  color: #1a1814;
  text-decoration: none;
  letter-spacing: -.4px;
  flex-shrink: 0;
  margin-right: 20px;
}
.ac-logo span { color: #d4521a; }

/* ── DESKTOP SEARCH ── */
.ac-search {
  position: relative;
  flex: 1;
  max-width: 340px;
  margin-right: 16px;
}
.ac-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ac-search-ico {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: #9a9890;
  pointer-events: none;
}
.ac-search-input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  border: 1.5px solid #e8e5df;
  border-radius: 100px;
  font-size: .875rem;
  font-family: "DM Sans", sans-serif;
  background: #f7f5f0;
  color: #1a1814;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.ac-search-input:focus {
  border-color: #d4521a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(212,82,26,.1);
}
.ac-search-input::placeholder { color: #9a9890; }
.ac-search-clear {
  position: absolute;
  right: 10px;
  background: #e8e5df;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b6760;
  padding: 0;
  transition: background .15s;
}
.ac-search-clear:hover { background: #d0cec5; }

/* Search results */
.ac-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e8e5df;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(26,24,20,.14);
  overflow: hidden;
  display: none;
  z-index: 10000;
  animation: acFadeIn .15s ease;
}
.ac-search-results.show { display: block; }
@keyframes acFadeIn {
  from { opacity:0; transform:translateY(4px); }
  to   { opacity:1; transform:none; }
}
.ac-search-results a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  text-decoration: none;
  color: #1a1814;
  font-size: .875rem;
  border-bottom: 1px solid #e8e5df;
  transition: background .1s;
  font-family: "DM Sans", sans-serif;
}
.ac-search-results a:last-child { border-bottom: none; }
.ac-search-results a:hover { background: #f7f5f0; }
.ac-sr-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0; background: #f7f5f0;
}
.ac-sr-name { font-weight: 600; font-size: .875rem; display: block; }
.ac-sr-cat  { font-size: .72rem; color: #9a9890; display: block; margin-top: 1px; }

/* ── DESKTOP NAV ── */
.ac-nav {
  display: flex;
  align-items: center;
  height: 100%;
}
.ac-ni {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
.ac-nl {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 13px;
  height: 100%;
  text-decoration: none;
  color: #6b6760;
  font-size: .875rem;
  font-weight: 500;
  transition: color .15s;
  white-space: nowrap;
  border: none;
  background: none;
  font-family: "DM Sans", sans-serif;
  cursor: pointer;
}
.ac-nl:hover, .ac-ni:hover > .ac-nl { color: #d4521a; }
.ac-arr {
  width: 13px; height: 13px;
  transition: transform .2s;
  opacity: .4; flex-shrink: 0;
}
.ac-ni:hover > .ac-nl .ac-arr { transform: rotate(180deg); opacity: 1; }
.ac-ni::after {
  content: "";
  position: absolute;
  bottom: 0; left: 13px; right: 13px;
  height: 2px;
  background: #d4521a;
  transform: scaleX(0);
  transition: transform .2s;
  border-radius: 2px 2px 0 0;
}
.ac-ni:hover::after { transform: scaleX(1); }

/* ── DROPDOWN ── */
.ac-dd {
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #fff;
  border: 1px solid #e8e5df;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(26,24,20,.13);
  padding: 16px;
  min-width: 420px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
  font-family: "DM Sans", sans-serif;
}
.ac-dd-right {
  left: auto;
  right: 0;
  transform: translateY(10px);
}
.ac-dd::before {
  content: "";
  position: absolute;
  top: -12px; left: 0; right: 0; height: 12px;
}
.ac-ni:hover > .ac-dd {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear 0s;
}
.ac-ni:hover > .ac-dd-right {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateY(0);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear 0s;
}
.ac-ddh {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e5df;
  margin-bottom: 12px;
}
.ac-ddhi {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.ac-ddh strong { display: block; font-size: .9rem; color: #1a1814; font-weight: 600; }
.ac-ddh p { font-size: .71rem; color: #9a9890; margin-top: 1px; }
.ac-ddg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ac-ddi {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 9px;
  text-decoration: none; color: #1a1814;
  transition: background .12s; border: 1px solid transparent;
}
.ac-ddi:hover { background: #f7f5f0; border-color: #e8e5df; }
.ac-diico {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: .88rem; flex-shrink: 0;
}
.ac-ddi b    { font-size: .82rem; font-weight: 600; color: #1a1814; display: block; line-height: 1.3; }
.ac-ddi span { font-size: .69rem; color: #9a9890; display: block; }
.ac-ddf {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid #e8e5df; text-align: center;
}
.ac-ddf a { font-size: .78rem; color: #d4521a; text-decoration: none; font-weight: 600; }
.ac-ddf a:hover { text-decoration: underline; }

/* ── MOBILE BUTTON ── */
.ac-mob-btn {
  display: none;
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  padding: 8px; color: #1a1814;
  -webkit-tap-highlight-color: transparent;
}

/* ── MOBILE OVERLAY ── */
.ac-mob-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(26,24,20,.45);
  z-index: 99998;
}
.ac-mob-overlay.open { display: block; }
.ac-mob-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(340px, 92vw);
  background: #fff; z-index: 99999;
  overflow-y: auto; padding: 20px;
  transform: translateX(100%);
  transition: transform .25s ease;
  font-family: "DM Sans", sans-serif;
}
.ac-mob-overlay.open .ac-mob-panel { transform: translateX(0); }
.ac-mob-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #e8e5df;
}
.ac-mob-close {
  background: #f7f5f0; border: none; cursor: pointer;
  padding: 7px; color: #1a1814; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.ac-mob-close:hover { background: #e8e5df; }

/* Mobile search */
.ac-mob-search { margin-bottom: 16px; }
.ac-mob-sw { position: relative; }
.ac-mob-sw input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid #e8e5df;
  border-radius: 10px;
  font-size: .9rem;
  font-family: "DM Sans", sans-serif;
  background: #f7f5f0;
  color: #1a1814;
  outline: none;
  transition: border-color .2s, background .2s;
  min-height: 46px;
}
.ac-mob-sw input:focus { border-color: #d4521a; background: #fff; }
.ac-mob-results {
  margin-top: 6px; background: #fff;
  border: 1px solid #e8e5df; border-radius: 10px;
  overflow: hidden; display: none;
}
.ac-mob-results.show { display: block; }
.ac-mob-results a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; text-decoration: none; color: #1a1814;
  font-size: .875rem; border-bottom: 1px solid #e8e5df;
  transition: background .1s; min-height: 46px;
  font-family: "DM Sans", sans-serif;
}
.ac-mob-results a:last-child { border-bottom: none; }
.ac-mob-results a:active { background: #f7f5f0; }

/* Mobile sections */
.ac-mob-sec { margin-bottom: 20px; }
.ac-mob-st {
  font-size: .7rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: #9a9890;
  padding: 0 4px; margin-bottom: 8px;
  font-family: "DM Sans", sans-serif;
}
.ac-ml {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  text-decoration: none; color: #1a1814;
  font-size: .88rem; transition: background .12s;
  margin-bottom: 2px; min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  font-family: "DM Sans", sans-serif;
}
.ac-ml:hover, .ac-ml:active { background: #f7f5f0; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) { .ac-search { max-width: 220px; } }
@media (max-width: 860px) {
  .ac-nav    { display: none; }
  .ac-search { display: none; }
  .ac-mob-btn { display: flex; }
  .ac-logo { margin-right: 0; }
}
@media (max-width: 480px) {
  .ac-hdr { padding: 0 14px; }
  .ac-logo { font-size: 1.2rem; }
}
