/* orders.css - the Orders section (My Account), Track Order page and Checkout page */

/* ----- My Account: Orders section ----- */
.ord__intro { margin: 0 0 14px; font-size: 13px; }
.ord__intro a { color: var(--orange); font-weight: 600; text-decoration: none; }
.ord__list { list-style: none; display: grid; gap: 12px; margin: 0 0 14px; padding: 0; }
.ord__empty { margin: 0 0 14px; padding: 18px 14px; border: 1px dashed #e7dfd0; border-radius: 12px; text-align: center; font-size: 14px; line-height: 1.5; color: var(--grey); }
.ord__empty a { color: var(--orange); font-weight: 600; text-decoration: none; }

.ord__card { padding: 14px; border: 1px solid #f0e9dc; border-radius: 14px; background: #fffdf9; }
.ord__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ord__date { font-size: 13px; color: var(--grey); }

.ord__badge { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #fff1e0; color: #8a4b00; }
.ord__badge--confirmed { background: #e8f0fb; color: #1a5fb4; }
.ord__badge--on_the_way { background: #ffe6d1; color: #b34d00; }
.ord__badge--delivered { background: #e5f2ed; color: var(--green); }
.ord__badge--cancelled { background: #fdecec; color: #b3261e; }

.ord__items { list-style: none; display: grid; gap: 6px; margin: 0 0 10px; padding: 0; }
.ord__items li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: #333; }
.ord__items span { min-width: 0; overflow-wrap: anywhere; }
.ord__items b { flex: none; font-weight: 600; color: var(--grey); }

.ord__total { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid #f0e9dc; font-size: 14px; color: var(--grey); }
.ord__total b { font-weight: 600; color: #111; }

.ord__code { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fff8f0; }
.ord__code > span { font-size: 11px; line-height: 1.2; color: var(--grey); }
.ord__code code { margin-left: auto; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; color: #111; }
.ord__copy { flex: none; height: 32px; padding: 0 10px; border-radius: 8px; border: 1.5px solid #e7dfd0; background: transparent; color: var(--orange); font-size: 12px; font-weight: 600; }

.ord__link { display: block; margin-top: 10px; text-align: right; font-size: 14px; font-weight: 600; color: var(--orange); text-decoration: none; }
.ord__btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.ord__copy:focus-visible, .ord__link:focus-visible, .ord__btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ----- Track Order page ----- */
.ord__codeinput { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.ord__codeinput::placeholder { text-transform: none; letter-spacing: 0.02em; font-weight: 400; }
.track { margin-top: 22px; padding-top: 20px; border-top: 1px solid #f0e9dc; }
.track__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.track__code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 17px; font-weight: 700; letter-spacing: 0.04em; color: #111; }
.track__sub { margin: 0 0 16px; font-size: 13px; color: var(--grey); }

.steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.steps li { position: relative; padding-top: 26px; text-align: center; font-size: 11.5px; line-height: 1.3; color: #9a9184; }
.steps li::before { content: ""; position: absolute; top: 6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #e7dfd0; z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: #e7dfd0; }
.steps li:first-child::after { display: none; }
.steps li.is-done { color: #111; font-weight: 600; }
.steps li.is-done::before, .steps li.is-done::after { background: var(--green); }
.steps li.is-now::before { background: var(--orange); box-shadow: 0 0 0 4px rgba(242, 106, 0, 0.2); }

.track__h { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: #111; }
.history { list-style: none; margin: 0 0 16px; padding: 0 0 0 16px; border-left: 2px solid #f0e9dc; display: grid; gap: 14px; }
.history li { position: relative; font-size: 14px; color: #333; line-height: 1.4; }
.history li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.history li:first-child::before { background: var(--orange); }
.history small { display: block; margin-top: 2px; font-size: 12px; color: var(--grey); }

/* ----- Checkout page ----- */
.ord__textarea { height: auto; min-height: 88px; padding: 12px 14px; line-height: 1.4; resize: vertical; }
.co__box { margin: 0 0 16px; padding: 14px; border-radius: 12px; background: #fff8f0; }
.co__box .ord__items { margin-bottom: 10px; }
.co__box .ord__total { border-top-color: #ecdcc4; }
.co__pay { margin: 10px 0 0; font-size: 13px; color: var(--grey); }
.co__done { text-align: center; }
.co__done .auth__title { margin-bottom: 8px; }
.co__tick { width: 60px; height: 60px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-size: 30px; }
.co__done .ord__code { justify-content: center; margin: 16px 0; }
.co__done .ord__code code { margin-left: 0; font-size: 18px; }
.co__done .auth__btn { margin-top: 10px; }

select.auth__input { appearance: auto; padding-right: 10px; }
select.auth__input:disabled { opacity: 0.55; }
.ord__btn--second { margin-top: 12px; background: transparent; color: var(--orange); border: 1.5px solid var(--orange); }
.co__done .auth__btn:disabled { opacity: 0.7; }

.ord__shoplink { margin-top: 22px; text-align: center; }

/* dark mode */
html[data-theme="dark"] .ord__empty { border-color: #3a3836; }
html[data-theme="dark"] .ord__card { background: #2a2826; border-color: #3a3836; }
html[data-theme="dark"] .ord__items li { color: #d6d1ca; }
html[data-theme="dark"] .ord__total { border-top-color: #3a3836; }
html[data-theme="dark"] .ord__total b,
html[data-theme="dark"] .ord__code code,
html[data-theme="dark"] .track__code,
html[data-theme="dark"] .track__h,
html[data-theme="dark"] .steps li.is-done { color: #f5f5f5; }
html[data-theme="dark"] .ord__code,
html[data-theme="dark"] .co__box { background: #2e2a26; }
html[data-theme="dark"] .co__box .ord__total { border-top-color: #4a443d; }
html[data-theme="dark"] .ord__copy { border-color: #4a443d; }
html[data-theme="dark"] .ord__badge { background: #3a2a1d; color: #f2b787; }
html[data-theme="dark"] .ord__badge--confirmed { background: rgba(26, 95, 180, 0.25); color: #8db8f0; }
html[data-theme="dark"] .ord__badge--on_the_way { background: rgba(242, 106, 0, 0.22); color: #ffb27a; }
html[data-theme="dark"] .ord__badge--delivered { background: rgba(0, 160, 120, 0.2); color: #5fd1ac; }
html[data-theme="dark"] .ord__badge--cancelled { background: rgba(179, 38, 30, 0.2); color: #ff9c94; }
html[data-theme="dark"] .track { border-top-color: #3a3836; }
html[data-theme="dark"] .steps li { color: #8d8882; }
html[data-theme="dark"] .steps li::before,
html[data-theme="dark"] .steps li::after { background: #4a443d; }
html[data-theme="dark"] .steps li.is-done::before,
html[data-theme="dark"] .steps li.is-done::after { background: var(--green); }
html[data-theme="dark"] .steps li.is-now::before { background: var(--orange); }
html[data-theme="dark"] .history { border-left-color: #3a3836; }
html[data-theme="dark"] .history li { color: #d6d1ca; }

/* desktop (also "Desktop site" mode on phones) */
@media (min-width: 900px) {
  .ord__copy, .ord__link { cursor: pointer; }
  .ord__link:hover, .ord__intro a:hover, .ord__empty a:hover { text-decoration: underline; }
  .ord__copy:hover { border-color: var(--orange); }
}
