/* ============================================================
   RX Prescription Upload — Stylesheet v1.2.0
   ============================================================ */

.rxocr-wrap {
    --blue:        #2563eb;
    --blue-dark:   #1d4ed8;
    --blue-light:  #eff6ff;
    --green:       #15803d;
    --green-bg:    #f0fdf4;
    --green-bdr:   #86efac;
    --yellow:      #92400e;
    --yellow-bg:   #fffbeb;
    --yellow-bdr:  #fde68a;
    --sky:         #0369a1;
    --sky-bg:      #f0f9ff;
    --sky-bdr:     #7dd3fc;
    --red:         #b91c1c;
    --red-bg:      #fef2f2;
    --red-bdr:     #fca5a5;
    --border:      #e2e8f0;
    --bg:          #f8fafc;
    --white:       #ffffff;
    --text:        #0f172a;
    --muted:       #64748b;
    --radius:      12px;
    --shadow:      0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

    max-width: 700px;
    margin: 2rem auto;
    padding: 0 1rem 4rem;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.6;
    box-sizing: border-box;
}
.rxocr-wrap *, .rxocr-wrap *::before, .rxocr-wrap *::after { box-sizing: inherit; }

/* ── Header ─────────────────────────────────────────────── */
.rxocr-header          { text-align: center; margin-bottom: 1.8rem; }
.rxocr-header__icon    { font-size: 3.5rem; line-height: 1; margin-bottom: .5rem; }
.rxocr-header__title   { font-size: 1.75rem; font-weight: 800; margin: 0 0 .3rem; letter-spacing: -.02em; }
.rxocr-header__sub     { color: var(--muted); font-size: .95rem; margin: 0 auto; max-width: 500px; }

/* ── Alerts ──────────────────────────────────────────────── */
.rxocr-notice {
    border-radius: 8px; padding: .9rem 1.1rem;
    margin-bottom: 1rem; font-size: .93rem; border-left: 4px solid;
}
.rxocr-notice--success { background: var(--green-bg);  border-color: var(--green);  color: var(--green); }
.rxocr-notice--error   { background: var(--red-bg);    border-color: var(--red);    color: var(--red); }
.rxocr-notice--warning { background: var(--yellow-bg); border-color: var(--yellow); color: var(--yellow); }
.rxocr-notice--info    { background: var(--sky-bg);    border-color: var(--sky);    color: var(--sky); }

/* ── Card ────────────────────────────────────────────────── */
.rxocr-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.75rem;
    box-shadow: var(--shadow); margin-bottom: 1rem;
}

/* ── Dropzone ────────────────────────────────────────────── */
.rxocr-dropzone {
    border: 2px dashed var(--border); border-radius: 10px;
    padding: 3rem 1.5rem; text-align: center; cursor: pointer;
    background: var(--bg); transition: border-color .2s, background .2s;
    outline: none; user-select: none;
}
.rxocr-dropzone:hover, .rxocr-dropzone:focus, .rxocr-dropzone.is-over {
    border-color: var(--blue); background: var(--blue-light);
}
.rxocr-dropzone__icon  { font-size: 3.2rem; line-height: 1; }
.rxocr-dropzone__title { font-size: 1rem; font-weight: 600; margin: .55rem 0 .2rem; }
.rxocr-dropzone__or    { font-size: .82rem; color: var(--muted); margin: 0 0 .9rem; }
.rxocr-dropzone__hint  { font-size: .79rem; color: var(--muted); margin: .95rem 0 0; }

/* ── File bar ────────────────────────────────────────────── */
.rxocr-file-bar {
    display: flex; align-items: center; gap: .5rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; padding: .65rem 1rem; margin-top: .9rem; font-size: .9rem;
}
.rxocr-file-bar__name   { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rxocr-file-bar__size   { color: var(--muted); font-size: .8rem; flex-shrink: 0; }
.rxocr-file-bar__remove {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 1rem; padding: 2px 6px; border-radius: 4px;
    transition: color .15s, background .15s;
}
.rxocr-file-bar__remove:hover { color: var(--red); background: var(--red-bg); }

/* ── Buttons ─────────────────────────────────────────────── */
.rxocr-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .45rem; padding: .75rem 1.5rem; border-radius: 8px;
    font-size: .95rem; font-weight: 600; cursor: pointer;
    text-decoration: none !important; border: 2px solid transparent;
    transition: all .18s ease; line-height: 1.3; white-space: nowrap;
}
.rxocr-btn--primary { background: var(--blue); color: #fff !important; border-color: var(--blue); }
.rxocr-btn--primary:hover:not(:disabled) {
    background: var(--blue-dark); border-color: var(--blue-dark);
    box-shadow: 0 4px 14px rgba(37,99,235,.3); transform: translateY(-1px);
}
.rxocr-btn--primary:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.rxocr-btn--outline { background: var(--white); color: var(--blue) !important; border-color: var(--blue); }
.rxocr-btn--outline:hover { background: var(--blue-light); }
.rxocr-btn--block { width: 100%; margin-top: 1.1rem; }

/* ── Spinner ─────────────────────────────────────────────── */
.rxocr-spinner {
    width: 18px; height: 18px;
    border: 3px solid rgba(255,255,255,.35); border-top-color: #fff;
    border-radius: 50%; animation: rxocr-spin .7s linear infinite; flex-shrink: 0;
}
@keyframes rxocr-spin { to { transform: rotate(360deg); } }

/* ── Results section ─────────────────────────────────────── */
.rxocr-results { margin-top: .5rem; }

/* ═══════════════════════════════════════════════════════════
   BANNERS  (added / already-in-cart)
   ═══════════════════════════════════════════════════════════ */
.rxocr-banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; border-radius: var(--radius); padding: 1.1rem 1.4rem;
    margin-bottom: 1rem; box-shadow: 0 2px 12px rgba(0,0,0,.08);
    animation: rxocr-slide-in .3s ease both;
}
@keyframes rxocr-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rxocr-banner--added  {
    background: linear-gradient(135deg,#f0fdf4 0%,#dcfce7 100%);
    border: 2px solid var(--green-bdr);
}
.rxocr-banner--incart {
    background: linear-gradient(135deg,#f0f9ff 0%,#e0f2fe 100%);
    border: 2px solid var(--sky-bdr);
}
.rxocr-banner__left {
    display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0;
}
.rxocr-banner__icon  { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.rxocr-banner__title { display: block; font-size: 1rem; font-weight: 700; color: var(--green); }
.rxocr-banner__sub   { display: block; font-size: .85rem; color: #4d7c0f; margin-top: 1px; }
.rxocr-banner--incart .rxocr-banner__title { color: var(--sky); }
.rxocr-banner--incart .rxocr-banner__sub   { color: #075985; }
.rxocr-banner__btns  {
    display: flex; gap: .6rem; flex-shrink: 0;
    align-items: center; flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   BOTTOM CTA BAR
   ═══════════════════════════════════════════════════════════ */
/* action-row: holds cart buttons + upload another side by side */
.rxocr-action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.25rem;
    padding: 1.1rem 1.4rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.rxocr-cart-btns {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}
/* keep old class names working in case cached template is served */
.rxocr-bottom-cta {
    display: flex; gap: .75rem; justify-content: center;
    flex-wrap: wrap; margin: 1.25rem 0 .5rem;
    padding: 1.2rem 1.5rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.rxocr-upload-another-wrap {
    display: flex; justify-content: center; margin-top: .75rem;
}

/* ── Result blocks ───────────────────────────────────────── */
.rxocr-result-block {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    margin-bottom: .85rem; box-shadow: var(--shadow);
}
.rxocr-result-block__header {
    display: flex; align-items: center; gap: .6rem;
    padding: .9rem 1.2rem; background: var(--bg);
    border-bottom: 1px solid var(--border); font-size: .95rem;
}
.rxocr-result-block--success .rxocr-result-block__header { background: var(--green-bg); border-color: var(--green-bdr); color: var(--green); }
.rxocr-result-block--warning .rxocr-result-block__header { background: var(--yellow-bg);border-color: var(--yellow-bdr);color: var(--yellow); }
.rxocr-result-block--info    .rxocr-result-block__header { background: var(--sky-bg);   border-color: var(--sky-bdr);   color: var(--sky); }
.rxocr-result-block__note { font-size: .85rem; color: var(--muted); padding: .6rem 1.2rem 0; margin: 0; }

/* ── Lists ───────────────────────────────────────────────── */
.rxocr-list { list-style: none; margin: 0; padding: .6rem .8rem; }
.rxocr-list li {
    display: flex; align-items: baseline; gap: .5rem;
    padding: .38rem .6rem; border-radius: 6px; font-size: .9rem;
}
.rxocr-list li + li  { margin-top: .2rem; }
.rxocr-list--plain   li { background: var(--bg); }
.rxocr-list--success li { background: var(--green-bg);  color: var(--green); }
.rxocr-list--warning li { background: var(--yellow-bg); color: var(--yellow); }
.rxocr-list--info    li { background: var(--sky-bg);    color: var(--sky); }
.rxocr-list__price   { font-size: .8rem; opacity: .75; margin-left: auto; }
.rxocr-list__sub     { font-size: .8rem; opacity: .7; }

/* ── How it works ────────────────────────────────────────── */
.rxocr-howto {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem 1.5rem;
    margin-top: 2rem; font-size: .88rem;
}
.rxocr-howto__title   { font-size: .95rem; font-weight: 700; margin: 0 0 1rem; }
.rxocr-steps          { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-bottom: .85rem; }
.rxocr-step           { display: flex; gap: .65rem; align-items: flex-start; }
.rxocr-step__num      {
    background: var(--blue); color: #fff; font-size: .73rem; font-weight: 700;
    min-width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 1px;
}
.rxocr-step p         { margin: 0; color: var(--muted); line-height: 1.4; }
.rxocr-howto__validity { color: var(--muted); margin: .5rem 0 0; padding-top: .75rem; border-top: 1px solid var(--border); }

/* ── Utility ─────────────────────────────────────────────── */
.rxocr-hidden { display: none !important; }
.rxocr-sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ══ ORDER META ══════════════════════════════════════════════ */
.rxocr-order-section { margin-top: 2.5rem; }
.rxocr-order-section__title {
    display: flex; align-items: center; gap: .5rem;
    font-size: 1.1rem; font-weight: 700; color: #0f172a;
    margin: 0 0 1rem; padding-bottom: .75rem;
    border-bottom: 2px solid #e2e8f0;
}
.rxocr-order-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rxocr-order-table th, .rxocr-order-table td {
    padding: .65rem .75rem; border-bottom: 1px solid #f1f5f9; text-align: left; vertical-align: top;
}
.rxocr-order-table th { width: 160px; font-weight: 600; color: #475569; background: #f8fafc; white-space: nowrap; }
.rxocr-order-table tr:last-child th, .rxocr-order-table tr:last-child td { border-bottom: none; }
.rxocr-download-link {
    display: inline-flex; align-items: center; gap: .4rem;
    color: #2563eb !important; text-decoration: none !important; font-weight: 500;
}
.rxocr-download-link:hover { text-decoration: underline !important; }
.rxocr-download-link__badge {
    display: inline-block; background: #eff6ff; color: #2563eb;
    font-size: .75rem; font-weight: 600; padding: 1px 6px;
    border-radius: 4px; border: 1px solid #bfdbfe;
}
.rxocr-medicines-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; }
.rxocr-medicines-list li {
    display: inline-block; background: #f0fdf4; color: #15803d;
    border: 1px solid #bbf7d0; border-radius: 20px;
    font-size: .82rem; font-weight: 500; padding: 2px 10px;
}
.rxocr-unavail-cell { color: #92400e; }
.rxocr-unavail-note { display: block; font-size: .8rem; color: #b45309; margin-top: 3px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .rxocr-steps          { grid-template-columns: 1fr; }
    .rxocr-dropzone       { padding: 2rem 1rem; }
    .rxocr-header__title  { font-size: 1.4rem; }
    .rxocr-card           { padding: 1.1rem; }
    .rxocr-btn--block     { font-size: .88rem; }
    .rxocr-banner         { flex-direction: column; align-items: stretch; text-align: center; }
    .rxocr-banner__left   { justify-content: center; }
    .rxocr-banner__btns   { flex-direction: column; }
    .rxocr-banner__btns a { justify-content: center !important; }
    .rxocr-action-row   { flex-direction: column; align-items: stretch; }
    .rxocr-cart-btns    { flex-direction: column; }
    
    .rxocr-order-table th { width: 120px; font-size: .85rem; }
    .rxocr-order-table td { font-size: .85rem; }
}
