/* All order-history selectors are scoped, including the embedded storefront panel. */
#ordersScreen { display: none !important; width: 100%; height: 100%; min-width: 0; overflow-y: auto; background: #f0f4f8; }
body #ordersScreen.active { display: block !important; overflow-y: auto !important; overflow-x: hidden !important; }
.afrand-order-history { color: #203448; font-family: "Vazirmatn", Tahoma, sans-serif; font-size: 14px; line-height: 1.85; min-width: 0; }
.afrand-order-history *, .afrand-order-history *::before, .afrand-order-history *::after { box-sizing: border-box; }
.afrand-orders-embedded { padding: 18px; }
.afrand-orders-intro { padding: 23px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.afrand-orders-intro > span, .afrand-orders-intro > div > span { display: block; color: #85622d; font-size: 11px; font-weight: 750; }
.afrand-orders-intro h1, .afrand-orders-intro h2 { margin: 3px 0; font-size: 24px; width: 100%; }
.afrand-orders-intro p { color: #596b7a; font-size: 12px; margin: 3px 0 0; width: 100%; }
.afrand-orders-intro > .afrand-order-button { margin-inline-start: auto; }
.afrand-order-history button, .afrand-order-history input { font: inherit; }
.afrand-orders-toolbar { padding: 12px; border: 1px solid #d2dce5; background: #fff; border-radius: 10px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.afrand-order-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.afrand-order-filters button { border: 0; padding: 9px 11px; border-radius: 7px; min-height: 42px; font-size: 11px; color: #596b7a; background: transparent; cursor: pointer; }
.afrand-order-filters button.active { background: #203f5b; color: #fff; }
.afrand-order-filters button > span { padding-inline-start: 6px; }
.afrand-order-search { min-width: 0; flex: 1 1 220px; max-width: 300px; }
.afrand-order-search input { width: 100%; min-height: 44px; padding: 9px 12px; color: #203448; font-size: 13px; border: 1px solid #c5d4df; border-radius: 7px; background: #f9fbfd; }
.afrand-orders-list { display: grid; gap: 16px; }
.afrand-order-card { border: 1px solid #d2dce5; background: #fff; border-radius: 11px; overflow: hidden; }
.afrand-order-card-header { padding: 15px 18px; background: #f8fafc; display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 14px; align-items: center; border-bottom: 1px solid #e0e8ef; }
.afrand-order-card-header > div { min-width: 0; }
.afrand-order-card-header > div > span:not(.afrand-status) { display: block; color: #596b7a; font-size: 10px; margin-bottom: 4px; }
.afrand-order-card-header strong { font-size: 12px; overflow-wrap: anywhere; display: block; }
.afrand-order-status { text-align: end; }
.afrand-order-status small { display: block; color: #596b7a; font-size: 10px; margin-top: 7px; }
.afrand-status { display: inline-block; border-radius: 6px; padding: 5px 9px; font-size: 11px; font-weight: 750; border: 1px solid #d2dce5; color: #4d6374; background: #eef3f7; }
.afrand-status-pending { background: #fff5df; border-color: #ead5a7; color: #805b1e; }
.afrand-status-paid { background: #eaf6ef; border-color: #c1dccd; color: #2b6d4e; }
.afrand-status-cancelled { background: #fff0f2; border-color: #e4c0c7; color: #99364a; }
.afrand-status-payment_review { background: #f0eefb; border-color: #cdc7e8; color: #665497; }
.afrand-order-demo { margin: 0; padding: 8px 18px; font-size: 11px; background: #fff8ea; color: #85622d; }
.afrand-order-products { padding: 4px 18px; }
.afrand-order-products > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 0; }
.afrand-order-products > div + div { border-top: 1px solid #e6edf2; }
.afrand-order-products strong { font-size: 13px; }
.afrand-order-products span { font-size: 11px; color: #596b7a; white-space: nowrap; }
.afrand-order-card-footer { padding: 14px 18px; border-top: 1px solid #e0e8ef; display: flex; gap: 14px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.afrand-order-delivery { flex: 1; min-width: 170px; font-size: 11px; }
.afrand-order-delivery strong { display: block; font-size: 11px; }
.afrand-order-delivery span { display: block; color: #596b7a; font-size: 10px; }
.afrand-order-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.afrand-order-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #bdcdd9; border-radius: 7px; padding: 8px 12px; color: #203f5b; background: #fff; font-size: 11px; font-weight: 750; text-decoration: none; cursor: pointer; }
.afrand-order-button-primary { background: #203f5b; border-color: #203f5b; color: #fff; }
.afrand-order-button-cancel { border-color: #ead6dc; color: #99364a; }
.afrand-order-button:hover { border-color: #57748b; }
.afrand-order-empty { border: 1px dashed #bdcdd9; border-radius: 12px; background: #fff; text-align: center; padding: 35px 18px; color: #596b7a; }
.afrand-order-empty h3 { font-size: 20px; margin: 0; color: #203448; }
.afrand-order-empty p { font-size: 13px; margin: 10px 0 20px; }
.afrand-order-message { padding: 12px 16px; margin-top: 15px; background: #fff; border: 1px solid #d2dce5; border-radius: 9px; font-size: 13px; }
.afrand-order-message p { margin: 0; }
.afrand-order-history :focus-visible { outline: 3px solid #9c7436; outline-offset: 3px; }
@media (max-width: 1000px) { .afrand-order-card-header { grid-template-columns: 1.4fr 1fr; } .afrand-order-status { text-align: start; } }
@media (max-width: 600px) { .afrand-orders-embedded { padding: 12px; } .afrand-orders-intro { padding-top: 14px; } .afrand-orders-intro h1, .afrand-orders-intro h2 { font-size: 22px; } .afrand-orders-intro > .afrand-order-button { margin-inline-start: 0; } .afrand-orders-toolbar { padding: 9px; } .afrand-order-search { max-width: none; } .afrand-order-filters { gap: 3px; } .afrand-order-filters button { padding-inline: 8px; } .afrand-order-card-header { padding: 13px; gap: 14px 10px; } .afrand-order-card-header strong { font-size: 11px; } .afrand-order-products { padding-inline: 13px; } .afrand-order-products > div { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; } .afrand-order-products strong { grid-column: 1 / -1; } .afrand-order-products > div span:last-child { text-align: end; } .afrand-order-card-footer { padding: 13px; } .afrand-order-actions { width: 100%; } .afrand-order-actions > * { flex: 1; } .afrand-order-actions form > button { width: 100%; } }
