/**
 * WooCommerce Smart Shipping Calculator — styles
 */

:root {
  --wss-accent: #2271b1;
  --wss-accent-h: #135e96;
  --wss-locked-bg: #f6f7f7;
  --wss-locked-fg: #a7aaad;
  --wss-border: #dcdcde;
  --wss-border-focus: #2271b1;
  --wss-error-bg: #fcf0f1;
  --wss-error-bd: #d63638;
  --wss-error-fg: #d63638;
  --wss-radius: 4px;
}

/* ── Wrapper ────────────────────────────────────────────────── */
.wss-calculator {
  margin: 0;
  padding: 0;
}

/* ── Common input styles ────────────────────────────────────── */
.wss-select,
.wss-input {
  width: 100%;
  padding: 0.35em;
  border: 1px solid var(--wss-border);
  border-radius: var(--wss-radius);
  background-color: #fff;
  color: inherit;
  font-size: 1em;
  line-height: 1.5;
  box-sizing: border-box;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.wss-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23646970' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6em center;
  cursor: pointer;
}

.wss-select:focus,
.wss-input:focus {
  border-color: var(--wss-border-focus);
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
  outline: none;
}

/* Locked / disabled */
.wss-input.wss-locked,
.wss-input:disabled {
  background-color: var(--wss-locked-bg);
  color: var(--wss-locked-fg);
  border-color: var(--wss-border);
  cursor: not-allowed;
}

/* ── Autocomplete field wrapper ─────────────────────────────── */
.wss-ac-field {
  position: relative;
  display: block;
}

/* ── Dropdown list ──────────────────────────────────────────── */
.wss-ac-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--wss-border);
  border-radius: var(--wss-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

.wss-ac-list li {
  padding: 0.45em 0.75em;
  cursor: pointer;
  font-size: 0.92em;
  color: #1d2327;
  line-height: 1.4;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wss-ac-list li:last-child {
  border-bottom: none;
}

.wss-ac-list li:hover,
.wss-ac-list li.wss-ac-active {
  background: #f0f6fc;
  color: var(--wss-accent);
}

/* ── Smart mode faded when inactive ─────────────────────────── */
#wss-smart-mode.wss-mode-inactive {
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}

/* ── Manual mode separator ──────────────────────────────────── */
#wss-manual-mode {
  border-top: 1px dashed var(--wss-border);
  margin-top: 0.75em;
  padding-top: 0.75em;
}

/* ── Error box ──────────────────────────────────────────────── */
.wss-error {
  background: var(--wss-error-bg);
  border-left: 3px solid var(--wss-error-bd);
  color: var(--wss-error-fg);
  font-size: 0.88em;
  padding: 0.5em 0.85em;
  border-radius: var(--wss-radius);
  margin-bottom: 0.75em;
}

/* ── Submit ─────────────────────────────────────────────────── */
.wss-submit {
  width: 100%;
}

/* ── Manual toggle link ─────────────────────────────────────── */
.wss-toggle-row {
  text-align: center;
  margin: 0.4em 0 0;
}

.wss-link-btn {
  background: none;
  border: none;
  color: var(--wss-accent);
  cursor: pointer;
  font-size: 0.83em;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wss-link-btn:hover {
  color: var(--wss-accent-h);
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wss-select,
  .wss-input {
    font-size: 16px;
  }
}

/* ── Product page mode ──────────────────────────────────────── */

/* Hide the native rp-plugin field rows — they stay in the DOM and
   are read/written by JS, just not visible to the user. */
.wss-native-hidden {
  display: none !important;
}

/* Our injected UI inherits the rp plugin's form-row styling naturally.
   Just ensure the ac-field wrapper is relative so dropdowns anchor. */
.wss-prod-ui .wss-ac-field {
  position: relative;
  display: block;
}

/* Match the rp plugin's input sizing so our UI looks native */
.wss-prod-ui .input-text,
.wss-prod-ui select {
  width: 100%;
  box-sizing: border-box;
}

/* Dropdown list */
.wss-prod-ui .wss-ac-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 99999;
}

/* ── Cart toggle button ─────────────────────────────────────── */
.wss-calc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6em 0.85em;
  background: var(--wss-locked-bg);
  border: 1px solid var(--wss-border);
  border-radius: var(--wss-radius);
  color: inherit;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  margin-bottom: 0.75em;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.wss-calc-toggle:hover {
  background: #eaeaea;
  border-color: #c0c0c0;
}

.wss-calc-toggle--has-location .wss-calc-toggle__label {
  color: #1d2327;
}

/* Chevron icon — rotates when open */
.wss-calc-toggle__icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  margin-left: 0.5em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23646970' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}

.wss-calc-toggle[aria-expanded="true"] .wss-calc-toggle__icon {
  transform: rotate(180deg);
}

/* ── Cart collapsible body ──────────────────────────────────── */
.wss-calc-body {
  /* no extra padding needed — the form-rows provide their own spacing */
}

/* ── Product page — postcode lock display ───────────────────── */
.wss-pc-lock {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 0.75em;
  background: var(--wss-locked-bg);
  border: 1px solid var(--wss-border);
  border-radius: var(--wss-radius);
  font-size: 1em;
  line-height: 1.5;
}

.wss-pc-display {
  font-weight: 600;
  flex: 1;
}

.wss-pc-edit {
  /* inherits .wss-link-btn */
  font-size: 0.82em;
  white-space: nowrap;
}

/* Hide the raw autocomplete input when locked */
.wss-pc-unlocked {
  display: none;
}

.form-row-wide .wss-ac-list {
  padding-left: 0 !important;
}
.form-row-wide .wss-ac-list li {
  margin-bottom: 0 !important;
}

.shipping-calculator-form{
    text-align: left;
}
/* ── No suburbs hint ────────────────────────────────────────── */
.wss-hint {
    font-size: .85em;
    padding: .4em .7em;
    border-radius: var(--wss-radius);
    margin-top: .35em;
}

.wss-hint--warn {
    background: #fff8e5;
    border-left: 3px solid #dba617;
    color: #7a5800;
}

/* ── Checkout smart UI ───────────────────────────────────────── */
.wss-checkout-ui {
    margin-bottom: .5em;
}

.wss-checkout-ui .wss-ac-field {
    position: relative;
    display: block;
}

.wss-checkout-ui .wss-ac-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999;
}

.wss-checkout-ui select,
.wss-checkout-ui .input-text {
    width: 100%;
    box-sizing: border-box;
}

.wss-co-row {
    margin-bottom: .5em;
}

/* ── Product page mode ──────────────────────────────────────────── */
.wss-native-hidden {
    display: none !important;
}

.wss-prod-ui .wss-ac-field {
    position: relative;
    display: block;
}

.wss-prod-ui select,
.wss-prod-ui .input-text {
    width: 100%;
    box-sizing: border-box;
}

.wss-prod-ui .wss-ac-list,
.wss-checkout-ui .wss-ac-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999;
}

/* ── Product page: postcode "select state first" placeholder ─── */
.wss-pc-no-state {
    display: block;
    padding: .5em .75em;
    background: var(--wss-locked-bg, #f6f7f7);
    border: 1px solid var(--wss-border, #dcdcde);
    border-radius: var(--wss-radius, 4px);
    color: var(--wss-locked-fg, #a7aaad);
    font-size: 1em;
    line-height: 1.5;
}

.wss-prod-row label, 
.wss-prod-row input,
.wss-ac-wrap label, 
.wss-ac-wrap input
{
    width: 100%!important;
}