:root {
  --yellow: #ffe600;
  --blue: #3483fa;
  --blue-hover: #2968c8;
  --green: #00a650;
  --red: #f23d4f;
  --amber: #9a6700;
  --text: rgba(0, 0, 0, .9);
  --muted: rgba(0, 0, 0, .55);
  --line: rgba(0, 0, 0, .1);
  --white: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: #ededed;
  font-family: "Proxima Nova", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.account-header {
  height: 104px;
  background: var(--yellow);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .1);
}

.account-header-grid {
  width: min(1184px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  grid-template-rows: 62px 42px;
  align-items: center;
  column-gap: 18px;
}

.account-logo { display: block; width: 134px; }
.account-logo img { display: block; width: 134px; height: 34px; object-fit: contain; }

.account-search {
  grid-column: 2;
  grid-row: 1;
  height: 40px;
  display: flex;
  overflow: hidden;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

.account-search input { flex: 1; min-width: 0; padding: 0 16px; border: 0; outline: 0; font-size: 16px; }
.account-search input::placeholder { color: rgba(0, 0, 0, .35); }
.account-search button { width: 46px; display: grid; place-items: center; border: 0; border-left: 1px solid #eee; color: #555; background: #fff; cursor: pointer; }
.account-search button:hover { background: #f7f7f7; }
.account-search button i { position: relative; display: block; width: 15px; height: 15px; border: 1.7px solid currentColor; border-radius: 50%; }
.account-search button i::after { content: ""; position: absolute; right: -5px; bottom: -3px; width: 7px; height: 1.7px; background: currentColor; transform: rotate(45deg); }

.account-user-nav {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-top: 0;
}
.account-user-nav a, .account-main-nav a { color: rgba(0, 0, 0, .76); font-size: 14px; text-decoration: none; white-space: nowrap; }
.account-user-nav a:hover, .account-main-nav a:hover { color: #000; }
.account-user-nav .active { font-weight: 600; }

#header-account {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
}

#header-account:hover,
.account-cart:hover { background: rgba(255, 255, 255, .32); }

.account-main-nav {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  display: flex;
  gap: 22px;
  overflow: hidden;
  padding-top: 3px;
}

.account-shell {
  width: min(1184px, calc(100% - 32px));
  margin: 32px auto 72px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

.account-sidebar {
  overflow: hidden;
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.account-profile { padding: 22px 18px; display: flex; align-items: center; gap: 13px; }

.account-avatar {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #eaf2ff;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 600;
}

.account-profile > div:last-child { min-width: 0; }
.account-profile strong, .account-profile span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-profile strong { font-size: 15px; }
.account-profile span { margin-top: 4px; color: var(--muted); font-size: 12px; }

.account-menu { display: grid; padding: 8px 0 12px; border-top: 1px solid var(--line); }

.account-menu a,
.account-menu button {
  min-height: 46px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  border: 0;
  border-left: 4px solid transparent;
  color: rgba(0, 0, 0, .68);
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu .active { color: var(--blue); background: #f5f8ff; border-left-color: var(--blue); font-weight: 600; }
.account-menu a:hover, .account-menu button:hover { background: #f7f7f7; }

.purchases { min-width: 0; }
.purchases-title { min-height: 55px; margin-bottom: 22px; display: flex; align-items: flex-end; }
.purchases-title h1 { margin: 0; font-size: 27px; font-weight: 600; letter-spacing: -.3px; }
.purchases-title p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }

.order-card,
.empty,
.orders-error {
  margin-bottom: 18px;
  overflow: hidden;
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .13);
}

.order-head {
  min-height: 72px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.order-head span, .order-head small { display: block; }
.order-head span { font-size: 15px; font-weight: 600; }
.order-head small { margin-top: 5px; color: var(--muted); font-size: 12px; }

.order-status { display: flex; align-items: center; gap: 9px; color: var(--green); font-size: 14px; white-space: nowrap; }
.order-status::before { content: ""; width: 9px; height: 9px; flex: 0 0 9px; background: currentColor; border-radius: 50%; }
.order-status.pending { color: var(--amber); }
.order-status.rejected { color: var(--red); }

.order-items { padding: 0 22px; }

.order-item {
  min-height: 142px;
  padding: 18px 0;
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.order-item:last-child { border-bottom: 0; }
.order-item > a { width: 102px; height: 102px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(0, 0, 0, .08); border-radius: 5px; }
.order-item img { width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.order-item-info { min-width: 0; }
.order-item-info > a { display: block; color: var(--text); font-size: 15px; line-height: 1.4; text-decoration: none; }
.order-item-info > a:hover { color: var(--blue); }
.order-item-info small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.order-item-info .delivery { margin-top: 13px; color: var(--green); font-size: 13px; font-weight: 600; }
.order-item-info .delivery.pending { color: var(--amber); }
.order-item-info .delivery.rejected { color: var(--red); }

.order-item-side { display: grid; justify-items: end; gap: 14px; }
.order-item-side > strong { font-size: 17px; font-weight: 500; white-space: nowrap; }
.order-item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.order-item-actions a,
.order-item-actions button {
  min-height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  color: var(--blue);
  background: rgba(52, 131, 250, .1);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.order-item-actions button { color: #fff; background: var(--blue); }
.order-item-actions button:hover { background: var(--blue-hover); }
.order-item-actions button:disabled { background: #b9cbea; cursor: wait; }

.order-footer {
  min-height: 62px;
  padding: 15px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #fafafa;
  border-top: 1px solid var(--line);
}

.order-address { max-width: 70%; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.order-total { font-size: 17px; white-space: nowrap; }
.order-total span { margin-right: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }

.empty,
.orders-error { min-height: 320px; padding: 60px 28px; display: grid; align-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty h2, .orders-error h2 { margin: 0 0 9px; color: var(--text); font-size: 21px; font-weight: 600; }
.empty p, .orders-error p { margin: 0; font-size: 14px; line-height: 1.5; }
.empty a, .orders-error button { margin-top: 22px; padding: 12px 20px; border: 0; border-radius: 6px; color: #fff; background: var(--blue); font-weight: 600; text-decoration: none; cursor: pointer; }

@media (max-width: 920px) {
  .account-header-grid { grid-template-columns: 150px minmax(260px, 1fr) auto; }
  .account-shell { grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
  .account-profile { padding-inline: 15px; }
  .order-item { grid-template-columns: 82px minmax(0, 1fr); }
  .order-item > a { width: 82px; height: 82px; }
  .order-item-side { grid-column: 2; justify-items: start; }
  .order-item-actions { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .account-header { height: 108px; }
  .account-header-grid { width: calc(100% - 24px); grid-template-columns: 130px 1fr; grid-template-rows: 55px 53px; column-gap: 12px; }
  .account-logo, .account-logo img { width: 112px; height: auto; }
  .account-user-nav { grid-column: 2; grid-row: 1; align-self: center; gap: 8px; margin-left: 0; padding-top: 0; }
  .account-search { grid-column: 1 / -1; grid-row: 2; align-self: start; }
  .account-main-nav { display: none; }
  .account-shell { width: 100%; margin: 20px auto 40px; padding: 0 10px; grid-template-columns: 1fr; gap: 18px; }
  .account-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .account-profile { min-width: 0; padding: 14px; }
  .account-avatar { width: 42px; height: 42px; flex-basis: 42px; font-size: 14px; }
  .account-menu { height: 100%; display: flex; align-items: stretch; padding: 0; border: 0; border-left: 1px solid var(--line); }
  .account-menu a, .account-menu button { min-height: 0; padding: 0 13px; border-left: 0; border-bottom: 3px solid transparent; font-size: 13px; }
  .account-menu .active { display: none; }
  .purchases-title { margin: 0 4px 18px; }
  .purchases-title h1 { font-size: 23px; }
  .purchases-title p { display: none; }
  .order-head { align-items: flex-start; padding: 15px 16px; }
  .order-items { padding: 0 16px; }
  .order-footer { padding: 14px 16px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .order-address { max-width: none; }
}

@media (max-width: 480px) {
  .account-user-nav a.active { display: none; }
  .account-user-nav { gap: 0; }
  .account-search button { width: 58px; }
  .account-sidebar { grid-template-columns: 1fr; }
  .account-menu { height: 44px; border-left: 0; border-top: 1px solid var(--line); justify-content: space-between; }
  .account-menu a, .account-menu button { flex: 1; justify-content: center; }
  .account-profile { padding-block: 12px; }
  .order-head { min-height: 0; flex-direction: column; gap: 10px; }
  .order-status { white-space: normal; }
  .order-item { grid-template-columns: 70px minmax(0, 1fr); padding: 15px 0; gap: 12px; }
  .order-item > a { width: 70px; height: 70px; }
  .order-item-info > a { font-size: 14px; }
  .order-item-side { gap: 11px; }
  .order-item-actions { flex-wrap: wrap; }
  .empty, .orders-error { min-height: 280px; padding: 48px 20px; }
}
