/* public/css/public-shipping-calculator.css */

/* =========================================================
   Scroll behaviour
   ========================================================= */
html {
  scroll-behavior: smooth;
}
/* Removed overscroll-behavior — was causing Android scroll lock */
#pscResults { scroll-margin-top: 80px; }
#calculator  { scroll-margin-top: 70px; }

/* =========================================================
   HERO
   ========================================================= */
.psc-hero {
  background: linear-gradient(180deg, rgba(31,120,200,.10), rgba(255,255,255,1));
  padding: 44px 0 26px;
}
.psc-hero-inner { display: flex; flex-direction: column; gap: 14px; }
.psc-title {
  margin: 0;
  font-size: 56px;
  line-height: 1.03;
  letter-spacing: -0.02em;
  color: #1e2a33;
  font-family: var(--font-main, 'Manrope', system-ui, sans-serif);
}
.psc-lead {
  margin: 0;
  max-width: 780px;
  color: var(--muted, rgba(30,42,51,.65));
  font-size: 20px;
  line-height: 1.6;
  font-family: var(--font-main, 'Manrope', system-ui, sans-serif);
}
.psc-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.psc-hero-btn {
  padding: 16px 22px;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(45,179,106,.18);
}

/* =========================================================
   CALCULATOR SECTION
   ========================================================= */
.psc-wrap { padding: 28px 0 48px; background: #fff; }

.psc-card {
  border: 1px solid var(--border, rgba(20,40,60,.12));
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(0,0,0,.06);
  background: #fff;
  padding: 20px;
}
.psc-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.psc-icon {
  width: 46px; height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: rgba(31,120,200,.10);
  border: 1px solid rgba(31,120,200,.18);
  flex: 0 0 auto;
}
.psc-h1 {
  font-weight: 900;
  color: #0b3550;
  font-size: 20px;
  font-family: var(--font-main, system-ui, sans-serif);
}
.psc-sub {
  margin-top: 4px;
  color: var(--muted, rgba(30,42,51,.65));
  font-weight: 700;
  font-size: 14px;
  line-height: 1.45;
  font-family: var(--font-main, system-ui, sans-serif);
}

.psc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 12px;
}
.psc-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* Labels — display only, not interactive */
.psc-label {
  font-weight: 800;
  color: #0b3550;
  font-size: 13px;
  font-family: var(--font-main, system-ui, sans-serif);
  line-height: 1.3;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* =========================================================
   ALL INPUTS & SELECTS — one unified style
   Native selects used throughout for cross-device reliability
   ========================================================= */
.psc-input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid rgba(20,40,60,.14);
  border-radius: 14px;
  padding: 13px 14px;
  font-family: var(--font-main, 'Manrope', system-ui, sans-serif);
  font-size: 16px;        /* 16px everywhere — prevents iOS auto-zoom */
  font-weight: 600;
  color: #0b3550;
  background: #fff;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}

.psc-input:focus {
  border-color: rgba(31,120,200,.50);
  box-shadow: 0 0 0 3px rgba(31,120,200,.12);
}

.psc-input::placeholder {
  color: rgba(11,53,80,.35);
  font-weight: 500;
}

/* Native select — Option A style: clean line border, grey arrow, blue focus ring */
select.psc-input {
  cursor: pointer;
  padding-right: 36px;
  border: 1.5px solid rgba(20,40,60,.20);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select.psc-input:focus {
  border-color: #1f78c8;
  box-shadow: 0 0 0 3px rgba(31,120,200,.14);
}

/* Placeholder option */
select.psc-input option[value=""] { color: rgba(11,53,80,.40); }

/* =========================================================
   ACTIONS
   ========================================================= */
.psc-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.psc-btn { padding: 14px 22px; border-radius: 14px; }
.psc-msg {
  font-weight: 700;
  color: var(--muted, rgba(30,42,51,.65));
  font-size: 13px;
  line-height: 1.4;
  font-family: var(--font-main, system-ui, sans-serif);
}
.psc-msg.is-error { color: #b42318; }
.psc-msg.is-ok    { color: #067647; }

/* =========================================================
   DIMENSIONS PANEL
   ========================================================= */
.psc-dim-tools {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.psc-dim-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  color: #1f78c8;
  font-weight: 800;
  font-size: 14px;
  font-family: var(--font-main, system-ui, sans-serif);
  cursor: pointer;
  text-decoration: underline;
}
.psc-dim-help {
  color: var(--muted, rgba(30,42,51,.65));
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-main, system-ui, sans-serif);
}
.psc-dim-panel {
  grid-column: 1 / -1;
  border: 1px solid rgba(20,40,60,.10);
  border-radius: 14px;
  background: rgba(20,40,60,.02);
  padding: 14px;
}
.psc-dim-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.psc-dim-note {
  margin-top: 10px;
  color: var(--muted, rgba(30,42,51,.65));
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main, system-ui, sans-serif);
  line-height: 1.5;
}

/* =========================================================
   RESULTS
   ========================================================= */
.psc-results {
  margin-top: 18px;
  border: 1px solid var(--border, rgba(20,40,60,.12));
  border-radius: 22px;
  background: #fff;
  padding: 16px;
}
.psc-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.psc-results-title {
  font-weight: 900;
  color: #0b3550;
  font-family: var(--font-main, system-ui, sans-serif);
}
.psc-results-meta {
  color: var(--muted, rgba(30,42,51,.65));
  font-weight: 700;
  font-size: 12.5px;
  font-family: var(--font-main, system-ui, sans-serif);
}
.psc-rate-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.psc-rate-card {
  border: 1px solid rgba(20,40,60,.10);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}
.psc-rate-card.is-best {
  border-color: rgba(45,179,106,.45);
  box-shadow: 0 14px 30px rgba(45,179,106,.14);
}
.psc-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.psc-carrier-left {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.psc-badge {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
  font-family: var(--font-main, system-ui, sans-serif);
  color: #0b3550;
  background: rgba(31,120,200,.10);
  border: 1px solid rgba(31,120,200,.18);
  flex-shrink: 0;
}
.psc-carrier-name {
  font-weight: 900;
  color: #0b3550;
  font-size: 16px;
  font-family: var(--font-main, system-ui, sans-serif);
}
.psc-carrier-sub {
  margin-top: 2px;
  color: rgba(30,42,51,.65);
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-main, system-ui, sans-serif);
}
.psc-price {
  font-weight: 900;
  font-size: 20px;
  color: #0b3550;
  white-space: nowrap;
  font-family: var(--font-main, system-ui, sans-serif);
  flex-shrink: 0;
}
.psc-divider { height: 1px; background: rgba(20,40,60,.08); margin: 12px 0; }
.psc-notes-title {
  font-weight: 900;
  color: #0b3550;
  font-size: 15px;
  font-family: var(--font-main, system-ui, sans-serif);
  margin-bottom: 8px;
}
.psc-notes-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(30,42,51,.78);
  font-weight: 700;
  line-height: 1.55;
  font-size: 13.5px;
  font-family: var(--font-main, system-ui, sans-serif);
}
.psc-footnote {
  margin-top: 10px;
  color: rgba(30,42,51,.70);
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-main, system-ui, sans-serif);
  line-height: 1.55;
}
.psc-chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.psc-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20,40,60,.04);
  border: 1px solid rgba(20,40,60,.10);
  color: rgba(30,42,51,.85);
  font-weight: 800;
  font-size: 12px;
  font-family: var(--font-main, system-ui, sans-serif);
}
.psc-note {
  margin-top: 12px;
  color: var(--muted, rgba(30,42,51,.65));
  font-weight: 700;
  font-size: 13.5px;
  font-family: var(--font-main, system-ui, sans-serif);
  line-height: 1.6;
}
.psc-empty {
  padding: 16px;
  color: var(--muted, rgba(30,42,51,.65));
  font-weight: 700;
  font-family: var(--font-main, system-ui, sans-serif);
  text-align: center;
}

/* =========================================================
   iOS sticky/backdrop fix
   ========================================================= */
@supports (-webkit-touch-callout: none) {
  .header {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    position: relative !important;
  }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .psc-title    { font-size: 46px; }
  .psc-lead     { font-size: 18px; }
  .psc-grid     { grid-template-columns: 1fr 1fr; }
  .psc-rate-grid{ grid-template-columns: 1fr; }
  .psc-dim-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .psc-hero  { padding: 24px 0 16px; }
  .psc-title { font-size: 32px; }
  .psc-lead  { font-size: 16px; }
  .psc-hero-btn { width: 100%; justify-content: center; }

  .psc-grid  { grid-template-columns: 1fr; gap: 12px; }
  .psc-card  { padding: 14px; border-radius: 18px; }

  .psc-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .psc-btn     { width: 100%; justify-content: center; }

  .psc-results  { border-radius: 18px; padding: 14px; }
  .psc-rate-grid{ grid-template-columns: 1fr; }

  .psc-dim-grid { grid-template-columns: 1fr; }
  .psc-dim-tools{ flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .psc-title { font-size: 28px; }
  .psc-lead  { font-size: 15px; }
  .psc-price { font-size: 18px; }
}

/* =========================================================
   Extra sections
   ========================================================= */
.psc-section      { padding: 54px 0; background: #fff; }
.psc-section--alt { background: linear-gradient(180deg, rgba(31,120,200,.06), rgba(255,255,255,1)); }
.psc-section-head  { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.psc-section-title { margin: 0; font-size: 34px; letter-spacing: -0.02em; color: #0b3550; font-weight: 900; font-family: var(--font-main, system-ui, sans-serif); }
.psc-section-lead  { margin: 0; color: var(--muted, rgba(30,42,51,.65)); font-weight: 700; line-height: 1.6; max-width: 760px; font-family: var(--font-main, system-ui, sans-serif); }
.psc-section-cta   { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.psc-steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.psc-step       { border: 1px solid rgba(20,40,60,.10); border-radius: 20px; background: #fff; padding: 16px; box-shadow: 0 14px 34px rgba(0,0,0,.06); }
.psc-step-badge { display: inline-block; padding: 7px 10px; border-radius: 999px; background: rgba(31,120,200,.10); border: 1px solid rgba(31,120,200,.18); color: #0b3550; font-weight: 900; font-size: 12px; margin-bottom: 10px; }
.psc-step-title { margin: 0 0 6px; font-weight: 900; color: #0b3550; font-size: 18px; }
.psc-step-text  { margin: 0 0 12px; color: var(--muted, rgba(30,42,51,.65)); font-weight: 700; line-height: 1.6; }
.psc-step-link  { font-weight: 900; color: var(--blue, #1f78c8); text-decoration: none; }
.psc-step-link:hover { text-decoration: underline; }

.psc-faq      { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.psc-faq-item { border: 1px solid rgba(20,40,60,.10); border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: 0 12px 28px rgba(0,0,0,.05); overflow: hidden; }
.psc-faq-q    { cursor: pointer; padding: 14px; font-weight: 900; color: #0b3550; list-style: none; }
.psc-faq-q::-webkit-details-marker { display: none; }
.psc-faq-a    { padding: 0 14px 14px; color: var(--muted, rgba(30,42,51,.65)); font-weight: 700; line-height: 1.6; }

@media (max-width: 1024px) {
  .psc-steps-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   CUSTOM INLINE-EXPAND SELECT — shipping calculator
   Append to bottom of public-shipping-calculator.css
   Scoped to .psc-cs to avoid conflicts with auth page selects
   ========================================================= */

.psc-cs {
  display: flex;
  flex-direction: column;
  border: 1.5px solid rgba(20,40,60,.20);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.psc-cs:focus-within {
  border-color: #1f78c8;
  box-shadow: 0 0 0 3px rgba(31,120,200,.14);
}

/* Trigger — overrides psc-input border/radius since wrapper owns them */
.psc-cs .cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 14px;
  background: transparent;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  font-size: 16px;
  font-family: var(--font-main, 'Manrope', system-ui, sans-serif);
  font-weight: 600;
  color: #0b3550;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.psc-cs .cs-trigger .cs-label {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.psc-cs .cs-trigger .cs-label.is-placeholder {
  color: rgba(11,53,80,.35);
  font-weight: 500;
}

.psc-cs .cs-chevron {
  flex-shrink: 0;
  color: rgba(11,53,80,.45);
  transition: transform 0.22s ease;
  margin-left: 8px;
}
.psc-cs.cs-open .cs-chevron {
  transform: rotate(180deg);
}

/* List */
.psc-cs .cs-list {
  max-height: 0;
  overflow: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: max-height 0.25s ease;
  border-top: 0 solid rgba(20,40,60,.10);
  background: #fff;
}
.psc-cs.cs-open .cs-list {
  max-height: 210px;
  border-top-width: 1px;
}

/* Options */
.psc-cs .cs-opt {
  padding: 12px 14px;
  font-size: 16px;
  font-family: var(--font-main, 'Manrope', system-ui, sans-serif);
  font-weight: 600;
  color: #0b3550;
  cursor: pointer;
  border-bottom: 1px solid rgba(20,40,60,.07);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  outline: none;
}
.psc-cs .cs-opt:last-child {
  border-bottom: none;
}
.psc-cs .cs-opt:hover,
.psc-cs .cs-opt:focus {
  background: rgba(31,120,200,.06);
}
.psc-cs .cs-opt[aria-selected="true"] {
  font-weight: 700;
  color: #1f78c8;
  background: rgba(31,120,200,.05);
}

.psc-cs[data-searchable="true"].cs-open .cs-list {
  max-height: 280px;
}
.psc-cs-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid rgba(20,40,60,.10);
  font-size: 16px;
  font-family: var(--font-main, 'Manrope', system-ui, sans-serif);
  font-weight: 500;
  color: #0b3550;
  background: #f7f9fb;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.psc-cs-search::placeholder { color: rgba(11,53,80,.35); }
.psc-cs-search:focus { background: #fff; border-bottom-color: #1f78c8; }