.amilano-pa { margin: 12px 0; }
.amilano-pa-btn { display: block; width: 100%; max-width: 480px; background: #d71920; color: #fff; border: 0; border-radius: 3px; padding: 14px 18px; font: inherit; font-weight: 700; cursor: pointer; text-align: center; }
.amilano-pa-btn:hover { background: #ad1018; }
.amilano-pa-btn:disabled { opacity: .65; cursor: default; }
.amilano-pa-btn:focus-visible, .amilano-pa-modal button:focus-visible, .amilano-pa-modal select:focus-visible, .amilano-pa-modal input:focus-visible { outline: 3px solid #1765b5; outline-offset: 3px; }
.amilano-pa-backdrop { position: fixed; inset: 0; background: #0009; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 15px; }
.amilano-pa-backdrop, .amilano-pa-backdrop * { box-sizing: border-box; }
.amilano-pa-modal { background: white; color: #222; max-width: 520px; width: 100%; padding: 24px; border-radius: 6px; max-height: calc(100dvh - 30px); overflow: auto; box-shadow: 0 15px 60px #0005; }
.amilano-pa-modal h2 { font-size: 1.5rem; margin: 0 36px 16px 0; }
.amilano-pa-modal fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.amilano-pa-modal label { display: block; margin: 12px 0; }
.amilano-pa-modal input, .amilano-pa-modal select { display: block; width: 100%; padding: 10px; border: 1px solid #aaa; border-radius: 3px; font: inherit; }
.amilano-pa-modal .pa-close { float: right; background: none; color: #222; border: 0; padding: 0 6px; font-size: 28px; cursor: pointer; }
.amilano-pa-modal .pa-error { color: #b00; }
.amilano-pa-modal .pa-success { color: #17652e; }
.amilano-pa-modal .pa-product { overflow-wrap: anywhere; }
.amilano-pa-modal .pa-hp { position: absolute; left: -99999px; width: 1px; height: 1px; overflow: hidden; }
.amilano-pa-modal .pa-status { margin: 12px 0 0; }
@media (max-width: 480px) { .amilano-pa-modal { padding: 18px; } }

/* v0.4.11: restrict layout changes to modal form controls only. */
.amilano-pa-modal label { margin: 14px 0 20px; line-height: 1.5; }
.amilano-pa-modal input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
.amilano-pa-modal select { box-sizing: border-box; width: 100%; height: 50px; min-height: 50px; padding: 10px 12px; line-height: 1.4; }
.amilano-pa-modal input:focus-visible, .amilano-pa-modal select:focus-visible { outline-offset: 2px; }

/* v0.4.14: customer type selector */
.amilano-pa-modal .pa-customer-switch { display: flex; gap: 10px; margin: 8px 0 18px; }
.amilano-pa-modal .pa-customer-choice { flex: 1; padding: 12px 8px; background: #f6f6f6; border: 1px solid #aaa; border-radius: 4px; color: #222; font: inherit; cursor: pointer; }
.amilano-pa-modal .pa-customer-choice[aria-pressed="true"] { background: #d71920; border-color: #d71920; color: white; font-weight: 700; }
.amilano-pa-modal [hidden] { display: none !important; }

/* v0.4.15: best price guarantee, two sections, shipping explanation */
.amilano-pa-modal .pa-best-price { background:#fff2df; border:1px solid #f5a623; border-left:5px solid #e47700; border-radius:5px; padding:13px 15px; margin:14px 0 20px; color:#603400; }
.amilano-pa-modal .pa-best-price strong { display:block; font-weight:800; color:#a84e00; margin-bottom:5px; }
.amilano-pa-modal .pa-best-price span { display:block; line-height:1.45; }
.amilano-pa-modal .pa-section-title { font-size:1.12rem; font-weight:700; margin:22px 0 10px; }
.amilano-pa-modal .pa-shipping-header { display:flex; align-items:center; gap:10px; margin-top:10px; }
.amilano-pa-modal .pa-shipping-header .pa-section-title { margin:0; line-height:1.3; }
.amilano-pa-modal .pa-info-button { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; flex:0 0 26px; padding:0; margin:0; align-self:center; border-radius:50%; border:1px solid #0875d1; background:#0875d1; color:#fff; font:bold 15px/1 sans-serif; cursor:pointer; vertical-align:middle; }
.amilano-pa-modal .pa-info-button:hover { background:#075ea7; border-color:#075ea7; }
.amilano-pa-modal .pa-info-button:focus-visible { outline:3px solid #ff9b22; outline-offset:3px; }
.amilano-pa-modal .pa-shipping-subtitle { color:#555; font-size:.9rem; margin:4px 0 12px; line-height:1.4; }
.amilano-pa-modal .pa-shipping-info { background:#f5f7fa; border:1px solid #d6dce3; border-radius:5px; padding:14px; margin:10px 0 14px; line-height:1.5; }
.amilano-pa-modal .pa-shipping-info p { margin:7px 0 0; white-space:pre-line; }

/* v0.4.21: stable mobile viewport and iOS input focus without browser zoom. */
@media (max-width: 767px) {
  .amilano-pa-backdrop {
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    overscroll-behavior: contain;
    align-items: center;
  }
  .amilano-pa-modal {
    max-height: calc(100vh - 30px);
    max-height: calc(100svh - 30px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .amilano-pa-modal input,
  .amilano-pa-modal select,
  .amilano-pa-modal textarea {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
  }
}

/* v0.4.22: mobile dialog stays anchored when the on-screen keyboard appears.
   CSS is loaded with a new asset version from Controller.php. */
@media (max-width: 767px) {
  .amilano-pa-backdrop {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100svh !important;
    min-height: 0 !important;
    padding: 10px !important;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow: hidden !important;
  }
  .amilano-pa-modal {
    display: block !important;
    flex: 0 1 100%;
    width: 100% !important;
    height: calc(100svh - 20px) !important;
    max-height: calc(100svh - 20px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scroll-padding-top: 24px;
    scroll-padding-bottom: 80px;
    -webkit-overflow-scrolling: touch;
  }
  .amilano-pa-modal input:not([type="hidden"]),
  .amilano-pa-modal select,
  .amilano-pa-modal textarea {
    font-size: 16px !important;
    line-height: normal !important;
    transform: none !important;
  }
}

/* v0.4.23: size the dialog to the visible viewport when the keyboard is open.
   JS updates backdrop height/offset using visualViewport on iOS and Android. */
@media (max-width: 767px) {
  .amilano-pa-backdrop {
    bottom: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 8px !important;
  }
  .amilano-pa-modal {
    height: 100% !important;
    max-height: 100% !important;
    scroll-padding-top: 22px;
    scroll-padding-bottom: 32px;
  }
}

/* v0.4.26: postal code gets the same visible autofill indication as other fields. */
@keyframes pa-autofill-detected { from { opacity: 1; } to { opacity: 1; } }
.amilano-pa-modal input[name="postal_code"]:-webkit-autofill {
  animation-name: pa-autofill-detected;
  animation-duration: 0.01s;
}
.amilano-pa-modal input[name="postal_code"].pa-autofilled {
  background-color: #faffbd !important;
  -webkit-box-shadow: 0 0 0 1000px #faffbd inset !important;
  box-shadow: 0 0 0 1000px #faffbd inset !important;
}

/* v0.4.30: use one identical highlight for all browser-autofilled fields,
   including postal code marked by the mobile input handler. */
.amilano-pa-modal input:-webkit-autofill,
.amilano-pa-modal input:-webkit-autofill:hover,
.amilano-pa-modal input:-webkit-autofill:focus,
.amilano-pa-modal input.pa-autofilled,
.amilano-pa-modal input.pa-autofilled:focus {
  background-color: #faffbd !important;
  -webkit-box-shadow: 0 0 0 1000px #faffbd inset !important;
  box-shadow: 0 0 0 1000px #faffbd inset !important;
  -webkit-text-fill-color: #222 !important;
  transition: background-color 9999s ease-out 0s;
}

/* v0.4.31: detect Safari telephone autofill and use the shared highlight. */
.amilano-pa-modal input[name="mobile_phone"]:-webkit-autofill {
  animation-name: pa-autofill-detected;
  animation-duration: 0.01s;
}

/* v0.4.33: optional separate delivery address, mobile-friendly checkbox. */
.amilano-pa-modal .pa-different-address { display:flex; align-items:center; gap:12px; margin:22px 0 10px; cursor:pointer; font-weight:600; }
.amilano-pa-modal .pa-different-address input[type="checkbox"] { width:22px !important; height:22px !important; min-height:22px !important; flex:0 0 22px; margin:0; accent-color:#d71920; }
.amilano-pa-modal .pa-extra-shipping { border-top:1px solid #ddd; margin-top:12px; padding-top:4px; }

/* v0.4.36: quote creation progress and animated success */
.amilano-pa-modal .pa-progress { text-align:center; padding:20px 10px 12px; margin-top:12px; border-radius:10px; background:#f7f9fa; }
.amilano-pa-modal .pa-progress-message { margin:10px auto 0; line-height:1.55; max-width:420px; white-space:pre-line; overflow-wrap:anywhere; }
.amilano-pa-modal .pa-progress-success { background:#f0faf3; color:#17652e; }
.amilano-pa-modal .pa-progress-error { background:#fff4f4; color:#a20b14; }
.amilano-pa-modal .pa-progress-info { background:#f2f7fc; color:#264b70; }
.amilano-pa-modal .pa-spinner { display:block; width:42px; height:42px; margin:0 auto; border:4px solid #d9e5e9; border-top-color:#1976a7; border-radius:50%; animation:pa-spin .8s linear infinite; }
@keyframes pa-spin { to { transform:rotate(360deg); } }
.amilano-pa-modal .pa-check { display:block; width:74px; height:74px; margin:0 auto; overflow:visible; animation:pa-pop .35s ease-out .8s both; }
.amilano-pa-modal .pa-check-circle { fill:none; stroke:#24964a; stroke-width:4; stroke-linecap:round; stroke-dasharray:170; stroke-dashoffset:170; animation:pa-draw-circle .55s ease-out forwards; transform:rotate(-90deg); transform-origin:32px 32px; }
.amilano-pa-modal .pa-check-path { fill:none; stroke:#24964a; stroke-width:5; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:44; stroke-dashoffset:44; animation:pa-draw-check .35s ease-out .52s forwards; }
@keyframes pa-draw-circle { to { stroke-dashoffset:0; } }
@keyframes pa-draw-check { to { stroke-dashoffset:0; } }
@keyframes pa-pop { 0% { transform:scale(.94); } 65% { transform:scale(1.06); } 100% { transform:scale(1); } }
@media (prefers-reduced-motion: reduce) { .amilano-pa-modal .pa-spinner { animation-duration:2s; } .amilano-pa-modal .pa-check, .amilano-pa-modal .pa-check-circle, .amilano-pa-modal .pa-check-path { animation:none; } .amilano-pa-modal .pa-check-circle, .amilano-pa-modal .pa-check-path { stroke-dashoffset:0; } }


/* v0.4.37: compact, viewport-centred status view replaces the long form. */
.amilano-pa-modal { transition: max-width .28s ease, border-radius .28s ease, padding .28s ease; }
.amilano-pa-modal.pa-compact { max-width: 430px; padding: 30px 28px 34px; border-radius: 16px; overflow: hidden; }
.amilano-pa-modal.pa-compact .pa-content { width: 100%; }
.amilano-pa-modal.pa-compact .pa-progress { margin: 0; padding: 30px 14px 24px; background: transparent; }
.amilano-pa-modal.pa-compact .pa-progress-success { color: #17652e; }
.amilano-pa-modal.pa-compact .pa-progress-info { color: #264b70; }
.amilano-pa-modal.pa-compact .pa-progress-message { font-size: 1.05rem; font-weight: 500; line-height: 1.7; }
.amilano-pa-modal.pa-compact .pa-spinner { width: 58px; height: 58px; border-width: 5px; }
.amilano-pa-modal.pa-compact .pa-close { position: relative; z-index: 1; line-height: 1; }
@media (max-width: 767px) {
  .amilano-pa-backdrop:has(.pa-compact) { align-items: center !important; }
  .amilano-pa-modal.pa-compact {
    flex: 0 1 430px;
    width: 100% !important;
    height: auto !important;
    max-height: calc(100% - 16px) !important;
    margin: auto 0 !important;
    padding: 24px 16px 28px;
    overflow-y: auto !important;
  }
}
@media (prefers-reduced-motion: reduce) { .amilano-pa-modal { transition: none; } }

/* v0.4.38: readable, left-aligned confirmation with a prominent quotation reference. */
.amilano-pa-modal.pa-compact .pa-progress-success .pa-check { margin: 0 auto 22px; }
.amilano-pa-modal.pa-compact .pa-success-details { text-align: left; width: 100%; max-width: 420px; margin: 0 auto; overflow-wrap: anywhere; }
.amilano-pa-modal.pa-compact .pa-success-details p { text-align: left; margin: 0; line-height: 1.55; }
.amilano-pa-modal.pa-compact .pa-success-heading { font-size: 1.05rem; font-weight: 500; }
.amilano-pa-modal.pa-compact .pa-success-number { font-size: 1.13rem; font-weight: 800; margin: 18px 0 !important; }
.amilano-pa-modal.pa-compact .pa-success-email { font-size: 1.05rem; font-weight: 500; }
