/* Buyer-panel UI polish — loaded AFTER buyerPanel.css; everything scoped to .buyer-container so it
   only affects the panel. Adds a sidebar card backdrop (tabs + logo), an avatar halo, and visible
   outlined form inputs (My Details / Change Password). */

/* --- Sidebar card: a backdrop behind the avatar + nav tabs (legacy MasterBuyerPanel look) --- */
.buyer-container .buyer-nav.white {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 16px;
  padding: 28px 22px;
  box-shadow: 0 8px 28px rgba(17, 24, 39, 0.07);
}

/* Soft halo behind the user-circle logo. */
.buyer-container .buyer-nav__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-color, #e3fdee);
}

/* Nav tabs: pill hover/active backdrop. */
.buyer-container .buyer-nav .nav.nav-sidebar .nav-item a {
  display: block;
  padding: 9px 14px;
  border-radius: 10px;
  color: #434343;
  transition: background 0.15s ease, color 0.15s ease;
}
.buyer-container .buyer-nav .nav.nav-sidebar .nav-item a:hover {
  background: var(--bg-color, #e3fdee);
  color: #434343; /* keep the tab text grey on hover (not the theme colour) */
}
.buyer-container .buyer-nav .nav.nav-sidebar .nav-item.active a {
  background: var(--bg-color, #e3fdee);
  color: #434343; /* keep the selected tab text grey; bold + bg highlight indicate selection */
  font-weight: 700;
}

/* --- Form fields: visible, outlined inputs --- */
.buyer-container .form-control {
  display: block;
  width: 100%;
  padding: 11px 14px;
  margin-top: 6px;
  border: 1px solid #cfd4dc;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  line-height: 1.4;
  color: #434343;
  box-shadow: none;
  height: auto;
}
.buyer-container .form-control:focus {
  outline: none;
  border-color: var(--bgcolor-theme);
  box-shadow: 0 0 0 3px rgba(131, 255, 193, 0.45);
}
.buyer-container .control-label {
  display: inline-block;
  font-weight: 700;
  margin-bottom: 2px;
}
.buyer-container .form-group {
  margin-bottom: 20px;
}

/* --- My Emails rows: left-aligned cards (don't inherit .request-item's space-between) --- */
.buyer-container .buyer-email-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  cursor: pointer;
}
.buyer-container .buyer-email-row input[type='checkbox'] {
  margin-top: 4px;
  flex: 0 0 auto;
}

/* Breathing room below the panel content so the Save button isn't flush against the footer
   (and stays clear once the success alert pushes it down). */
.buyer-container .buyer-content {
  padding-bottom: 32px;
}

/* --- Mobile / tablet (< 992px): the sidebar column is now visible (was hidden-xs/hidden-sm),
   so collapse the vertical rail into a compact horizontal pill bar that wraps — every tab stays
   on screen and reachable, and the "nav bar" no longer disappears. --- */
@media (max-width: 991px) {
  .buyer-container .buyer-nav.white {
    padding: 14px 14px 12px;
    border-radius: 14px;
    margin-bottom: 18px;
  }
  /* Drop the big avatar/halo on mobile — it only eats vertical space above the tabs. */
  .buyer-container .buyer-nav__avatar-row {
    display: none;
  }
  .buyer-container .buyer-nav__links-row {
    margin-bottom: 0 !important;
  }
  /* Tabs: wrapping, centered pill row (all options visible, no horizontal scroll needed). */
  .buyer-container .buyer-nav .nav.nav-sidebar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
  }
  .buyer-container .buyer-nav .nav.nav-sidebar > li.nav-item {
    flex: 0 0 auto;
    float: none;
    margin: 0 !important;
  }
  .buyer-container .buyer-nav .nav.nav-sidebar .nav-item a {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #e3e7ec;
    background: #f6f8fa;
    color: #434343;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .buyer-container .buyer-nav .nav.nav-sidebar .nav-item a:hover {
    background: var(--bg-color, #e3fdee);
  }
  .buyer-container .buyer-nav .nav.nav-sidebar .nav-item.active a {
    background: var(--bgcolor-theme);
    border-color: var(--bgcolor-theme);
    color: #434343;
    font-weight: 700;
  }
  /* Logout: centred under the pills (its desktop text-right would strand it in the corner). */
  .buyer-container .buyer-nav__logout-row {
    margin-top: 12px;
  }
  .buyer-container .buyer-nav__logout-row .col-md-12 {
    text-align: center !important;
  }
  .buyer-container .buyer-nav__logout-row a {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #434343;
    text-decoration: underline;
  }
}

/* ===== My Emails (redesigned) — toggle-based email preferences ===== */
.me-emails { max-width: 660px; }
.me-emails .me-sub { font-size: 13px; color: #6b7280; margin: 8px 0 18px; }

.me-card {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.05);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.me-card > h2 { font-size: 16px; font-weight: 700; margin: 0 0 2px; color: #434343; }
.me-card .me-lead { font-size: 12.5px; color: #6b7280; margin: 0 0 12px; }

.me-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #f1f3f5; }
.me-row.me-row--first { border-top: 0; }
.me-ico {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px;
  background: var(--bg-color, #e3fdee); color: #0f6e56;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.me-txt { flex: 1; min-width: 0; }
.me-txt b { font-size: 14px; font-weight: 600; display: block; }
.me-txt small { font-size: 12px; color: #6b7280; }
.me-cad { font-size: 11px; color: #0f6e56; background: var(--bg-color, #e3fdee); border-radius: 20px; padding: 3px 9px; white-space: nowrap; }

/* Toggle switch — EA green when on. */
.me-sw {
  flex: 0 0 auto; width: 42px; height: 24px; border-radius: 20px;
  background: #cfd4dc; position: relative; cursor: pointer;
  transition: background 0.15s; border: none; padding: 0;
}
.me-sw::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.me-sw[aria-checked="true"] { background: #34d17e; }
.me-sw[aria-checked="true"]::after { transform: translateX(18px); }
.me-sw:focus-visible { outline: 2px solid #0f6e56; outline-offset: 2px; }
.me-sw:disabled { opacity: 0.5; cursor: not-allowed; }
.me-sw--danger[aria-checked="true"] { background: #e2696e; }

.me-savebtn {
  background: var(--bgcolor-theme, #83FFC1); color: var(--textcolorcontrast-theme, #0f6e56);
  border: none; border-radius: 22px; font-weight: 600; font-size: 14px; padding: 9px 22px;
  cursor: pointer; margin-top: 14px;
}
.me-savebtn:hover { filter: brightness(0.96); }
.me-savebtn:disabled { opacity: 0.6; cursor: default; }
.me-saved { font-size: 13px; color: #0f6e56; margin-left: 12px; }
.me-saved--err { color: #b91c1c; }

.me-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.me-search { flex: 1; min-width: 160px; border: 1px solid #cfd4dc; border-radius: 20px; padding: 8px 14px; font-size: 13px; outline: none; }
.me-search:focus { border-color: var(--bgcolor-theme, #83FFC1); box-shadow: 0 0 0 3px rgba(131, 255, 193, 0.4); }
.me-link { font-size: 12.5px; color: #0f6e56; font-weight: 600; cursor: pointer; white-space: nowrap; background: none; border: none; padding: 0; }
.me-link:hover { text-decoration: underline; }
.me-link:disabled { color: #9ca3af; cursor: default; text-decoration: none; }

.me-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.me-grid.me-grid--disabled { opacity: 0.45; pointer-events: none; }
.me-dir { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 9px; }
.me-dir > span { flex: 1; font-size: 13px; }
.me-tag { font-size: 10px; color: #0f6e56; background: var(--bg-color, #e3fdee); border-radius: 10px; padding: 1px 7px; margin-left: 6px; }
.me-empty { font-size: 13px; color: #6b7280; padding: 8px 0; }

.me-unsub { background: #fff; border: 1px solid #f0dcdc; border-radius: 14px; padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.me-unsub .me-ico { background: #fdecec; color: #a4353a; }
.me-unsub .me-txt b { color: #a4353a; }

@media (max-width: 640px) { .me-grid { grid-template-columns: 1fr; } }

/* ===== Select consistency across browsers =====
   Native selects (State/Country on My Details) render differently: Safari collapses to
   content-width, Chrome/Edge reserve no padding for their native arrow so text bleeds to
   the right edge. Strip the native chrome, draw our own caret via SVG background, and
   reserve right-side padding so text never overlaps the arrow. Applies everywhere in
   .buyer-container so future selects inherit the same behaviour. */
.buyer-container select.form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23434343' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  min-width: 100%; /* Safari otherwise sizes to intrinsic content width and looks narrow */
}
/* IE10+ hides the native arrow via ::-ms-expand */
.buyer-container select.form-control::-ms-expand { display: none; }

/* ===== My Quote Requests — portal filter tabs =====
   Solid EA green must be reserved for the CURRENTLY SELECTED filter (the tab without
   .i-button--outline--color). Non-selected tabs get the outline treatment: green border
   over a soft grey background. Without these overrides the shared .i-button--round base
   still bleeds theme colour through unselected tabs and makes the active one hard to
   spot. */
.buyer-container .buyer-quote-filters .i-button.i-button--outline--color {
  background: #f6f8fa;
  border: 1.5px solid var(--bgcolor-theme, #83FFC1);
  color: #434343;
  box-shadow: none;
}
.buyer-container .buyer-quote-filters .i-button.i-button--outline--color:hover {
  background: var(--bg-color, #e3fdee);
  color: #434343;
  /* Cancel the generic .i-button:not(:disabled):hover { opacity: 0.8 } from site.min.css.
     The filter tabs' visual feedback is the bg swap (grey → mint) — no opacity fade needed
     on top; the text should stay a crisp #434343, not dim. */
  opacity: 1;
}
.buyer-container .buyer-quote-filters .i-button.i-button--outline--color:focus-visible {
  outline: 2px solid var(--bgcolor-theme, #83FFC1);
  outline-offset: 2px;
}
