/* =========================================================
   Account Order Detail
   ========================================================= */

.account-order-page {
  min-height: 70vh;
  background: #f5f6fb;
}

.account-order-section {
  padding: 42px 0 72px;
}

.account-order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 28px;
  align-items: start;
}

.account-order-main,
.account-order-sidebar {
  display: grid;
  gap: 24px;
}

.account-order-sidebar {
  position: sticky;
  top: 110px;
}

/* =========================================================
   Order hero
   ========================================================= */

.account-order-hero {
  padding: 46px 0 28px;
}

.account-order-hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;

  padding: 42px 46px;
  border: 1px solid rgba(46, 47, 121, 0.12);
  border-radius: 32px;

  background:
    radial-gradient(
      circle at 90% 18%,
      rgba(77, 83, 159, 0.24),
      transparent 34%
    ),
    radial-gradient(
      circle at 8% 10%,
      rgba(46, 47, 121, 0.15),
      transparent 30%
    ),
    linear-gradient(
      135deg,
      #f8f9ff 0%,
      #eef0fb 48%,
      #f7f8fc 100%
    );

  box-shadow:
    0 26px 64px rgba(31, 25, 84, 0.11);
}

.account-order-eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-order-hero h1 {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: clamp(30px, 4.5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.account-order-hero p {
  max-width: 720px;
  margin: 0;
  color: #686d84;
  font-size: 16px;
  line-height: 1.7;
}

.account-order-hero__badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.account-order-hero__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
}

.account-order-back-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.account-order-back-link:hover {
  text-decoration: underline;
}

/* =========================================================
   Shared cards
   ========================================================= */

.account-order-card {
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(31, 25, 84, 0.1);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(31, 25, 84, 0.08);
}

.account-order-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.account-order-card__head span {
  display: block;
  margin-bottom: 4px;
  color: #777b91;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-order-card__head h2 {
  margin: 0;
  color: #1b2144;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}


/* =========================================================
   Order and payment status
   ========================================================= */

.account-order-status,
.account-payment-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.account-order-status--pending,
.account-order-status--awaiting_payment {
  color: #8a5a00;
  background: #fff6df;
  border-color: #f1d89b;
}

.account-order-status--confirmed {
  color: #2e2f79;
  background: #eef0ff;
  border-color: #cfd3f5;
}

.account-order-status--processing {
  color: #7a4d00;
  background: #fff4d6;
  border-color: #efd18a;
}

.account-order-status--shipped {
  color: #1d5f91;
  background: #e9f4fc;
  border-color: #b9dcef;
}

.account-order-status--completed {
  color: #247443;
  background: #e9f8ef;
  border-color: #bfe7cd;
}

.account-order-status--cancelled {
  color: #a22a2a;
  background: #fff0f0;
  border-color: #efc2c2;
}

.account-payment-status--paid {
  color: #247443;
  background: #e9f8ef;
  border-color: #bfe7cd;
}

.account-payment-status--pending,
.account-payment-status--unpaid {
  color: #8a5a00;
  background: #fff6df;
  border-color: #f1d89b;
}

.account-payment-status--failed {
  color: #a22a2a;
  background: #fff0f0;
  border-color: #efc2c2;
}

.account-payment-status--refunded {
  color: #4d539f;
  background: #eef0ff;
  border-color: #cfd3f5;
}

.account-order-payment-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.account-order-payment-actions__primary {
  width: 100%;
  min-height: 52px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  border-radius: 14px;
}

.account-order-payment-actions__cancel {
  width: 100%;
  min-height: 46px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 11px 18px;

  border: 1px solid #d65062;
  border-radius: 14px;

  background: #ffffff;
  color: #b7354a;

  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.account-order-payment-actions__cancel:hover {
  background: #fff3f5;
  border-color: #c43f55;
  color: #9d2b40;

  box-shadow: 0 8px 20px rgba(183, 53, 74, 0.12);
  transform: translateY(-1px);
}

.account-order-payment-actions__cancel:focus-visible {
  outline: 3px solid rgba(183, 53, 74, 0.18);
  outline-offset: 2px;
}

.account-order-payment-actions__cancel:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  box-shadow: none;
}


/* =========================================================
   Order items
   ========================================================= */

.account-order-items {
  display: grid;
  gap: 0;
  border: 1px solid #e5e7f2;
  border-radius: 18px;
  overflow: hidden;
}

.account-order-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 17px 18px;
  background: #fafbfe;
}

.account-order-item + .account-order-item {
  border-top: 1px solid #eceef5;
}

.account-order-item__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border: 1px solid #e5e7f2;
  border-radius: 15px;
  color: #ffffff;
  background: #fff;
}

.account-order-item__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.account-order-item__media span {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.account-order-item__content {
  min-width: 0;
}

.account-order-item__content strong {
  display: block;
  color: #1b2144;
  font-size: 15px;
  line-height: 1.35;
}

.account-order-item__content small,
.account-order-item__content span {
  display: block;
  margin-top: 4px;
  color: #777b91;
  font-size: 12px;
  line-height: 1.4;
}

.account-order-item__total {
  color: #1f1954;
  font-size: 15px;
  white-space: nowrap;
}

/* ==========================================================
   Customer Shipment Tracking
========================================================== */

.account-shipment-summary{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
    margin-bottom:24px;
}

.account-shipment-summary > div{
    display:flex;
    flex-direction:column;
    gap:5px;
    padding:15px 16px;
    border:1px solid #e5e7eb;
    border-radius:14px;
    background:#f8fafc;
    min-width:0;
}

.account-shipment-summary span{
    color:#64748b;
    font-size:12px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.05em;
}

.account-shipment-summary strong{
    color:#172033;
    font-size:14px;
    line-height:1.4;
    overflow-wrap:anywhere;
}

.account-shipment-progress{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:0;
    margin:4px 0 28px;
}

.account-shipment-progress__step{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:9px;
    position:relative;
    color:#94a3b8;
    text-align:center;
    font-size:12px;
    font-weight:700;
}

.account-shipment-progress__step:not(:last-child)::after{
    content:"";
    position:absolute;
    top:11px;
    left:calc(50% + 16px);
    width:calc(100% - 32px);
    height:2px;
    background:#e5e7eb;
}

.account-shipment-progress__icon{
    width:24px;
    height:24px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    position:relative;
    z-index:2;
    background:#e5e7eb;
    color:#64748b;
    font-size:12px;
    font-weight:800;
}

.account-shipment-progress__step.is-completed{
    color:#166534;
}

.account-shipment-progress__step.is-completed
.account-shipment-progress__icon{
    background:#16a34a;
    color:#fff;
}

.account-shipment-progress__step.is-completed:not(:last-child)::after{
    background:#16a34a;
}

.account-shipment-progress__step.is-current{
    color:#1d4ed8;
}

.account-shipment-progress__step.is-current
.account-shipment-progress__icon{
    background:#2563eb;
    color:#fff;
    box-shadow:0 0 0 5px rgba(37,99,235,.12);
}

.account-shipment-alert{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:15px 16px;
    margin-bottom:24px;
    border:1px solid #fecaca;
    border-radius:14px;
    background:#fef2f2;
    color:#991b1b;
}

.account-shipment-alert .material-icons{
    flex-shrink:0;
    font-size:22px;
}

.account-shipment-alert strong{
    display:block;
    margin-bottom:4px;
}

.account-shipment-alert p{
    margin:0;
    color:#b91c1c;
    font-size:13px;
    line-height:1.5;
}

.account-shipment-history{
    padding-top:22px;
    border-top:1px solid #e5e7eb;
}

.account-shipment-history__head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    margin-bottom:20px;
}

.account-shipment-history__head h3{
    margin:0;
    color:#172033;
    font-size:17px;
}

.account-shipment-history__head > span{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:32px;
    padding:5px 10px;
    border-radius:999px;
    background:#eef2ff;
    color:#3730a3;
    font-size:12px;
    font-weight:800;
}

.account-shipment-timeline{
    display:flex;
    flex-direction:column;
}

.account-shipment-timeline__item{
    display:grid;
    grid-template-columns:18px minmax(0,1fr);
    gap:14px;
    position:relative;
    padding-bottom:24px;
}

.account-shipment-timeline__item:not(:last-child)::before{
    content:"";
    position:absolute;
    left:6px;
    top:17px;
    bottom:0;
    width:2px;
    background:#e5e7eb;
}

.account-shipment-timeline__marker{
    width:14px;
    height:14px;
    margin-top:4px;
    border:3px solid #fff;
    border-radius:50%;
    position:relative;
    z-index:2;
    background:#94a3b8;
    box-shadow:0 0 0 2px #cbd5e1;
}

.account-shipment-timeline__marker--pre_transit{
    background:#f59e0b;
    box-shadow:0 0 0 2px #fde68a;
}

.account-shipment-timeline__marker--transit{
    background:#2563eb;
    box-shadow:0 0 0 2px #bfdbfe;
}

.account-shipment-timeline__marker--out_for_delivery{
    background:#8b5cf6;
    box-shadow:0 0 0 2px #ddd6fe;
}

.account-shipment-timeline__marker--delivered{
    background:#16a34a;
    box-shadow:0 0 0 2px #bbf7d0;
}

.account-shipment-timeline__marker--returned,
.account-shipment-timeline__marker--failure,
.account-shipment-timeline__marker--exception{
    background:#dc2626;
    box-shadow:0 0 0 2px #fecaca;
}

.account-shipment-timeline__content{
    min-width:0;
}

.account-shipment-timeline__top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    flex-wrap:wrap;
}

.account-shipment-timeline__top strong{
    color:#172033;
    font-size:15px;
}

.account-shipment-timeline__top time{
    color:#64748b;
    font-size:12px;
    white-space:nowrap;
}

.account-shipment-timeline__content p{
    margin:6px 0;
    color:#475569;
    font-size:14px;
    line-height:1.5;
}

.account-shipment-timeline__content small{
    display:block;
    color:#64748b;
    font-size:12px;
}

.account-shipment-timeline__substatus{
    display:inline-flex;
    margin-top:8px;
    padding:4px 9px;
    border-radius:999px;
    background:#f1f5f9;
    color:#475569;
    font-size:11px;
    font-weight:800;
}

@media (max-width:700px){

    .account-shipment-summary{
        grid-template-columns:1fr;
    }

    .account-shipment-progress{
        grid-template-columns:1fr;
        gap:12px;
    }

    .account-shipment-progress__step{
        flex-direction:row;
        justify-content:flex-start;
        text-align:left;
    }

    .account-shipment-progress__step:not(:last-child)::after{
        top:24px;
        left:11px;
        width:2px;
        height:24px;
    }

    .account-shipment-progress__step.is-completed:not(:last-child)::after{
        background:#16a34a;
    }

    .account-shipment-timeline__top{
        flex-direction:column;
        gap:4px;
    }
}


/* =========================================================
   Timeline
   ========================================================= */

.account-order-timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.account-order-timeline::before {
  content: "";
  position: absolute;
  top: 21px;
  bottom: 21px;
  left: 20px;
  width: 2px;
  background: #e1e4f2;
}

.account-order-timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  padding: 0 0 26px;
}

.account-order-timeline__item:last-child {
  padding-bottom: 0;
}

.account-order-timeline__icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 5px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  background: #1f1954;
  box-shadow: 0 8px 18px rgba(31, 25, 84, 0.18);
}

.account-order-timeline__icon .material-icons {
  font-size: 18px;
}

.account-order-timeline__content {
  padding-top: 2px;
}

.account-order-timeline__content strong {
  display: block;
  color: #1b2144;
  font-size: 15px;
  line-height: 1.35;
}

.account-order-timeline__content p {
  margin: 5px 0 0;
  color: #63677d;
  font-size: 13px;
  line-height: 1.55;
}

.account-order-timeline__content time {
  display: block;
  margin-top: 7px;
  color: #8b8ea4;
  font-size: 11px;
  font-weight: 700;
}


/* =========================================================
   Payment summary
   ========================================================= */

.account-order-summary {
  display: grid;
  gap: 13px;
}

.account-order-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #5f6379;
  font-size: 14px;
}

.account-order-summary > div strong {
  color: #1b2144;
  font-size: 14px;
}

.account-order-summary__total {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid #e1e4f2;
}

.account-order-summary__total span {
  color: #1f1954;
  font-weight: 800;
}

.account-order-summary__total strong {
  color: #1f1954 !important;
  font-size: 21px !important;
}

.account-order-refund {
  display: grid;
  gap: 5px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #d3d7f1;
  border-radius: 15px;
  color: #4d539f;
  background: #eef0ff;
}

.account-order-refund span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.account-order-refund strong {
  font-size: 19px;
}

.account-order-refund small {
  color: #666b91;
  font-size: 12px;
}


/* =========================================================
   Address and notes
   ========================================================= */

.account-order-address {
  display: grid;
  gap: 5px;
  margin: 0;
  color: #5f6379;
  font-size: 14px;
  font-style: normal;
  line-height: 1.55;
}

.account-order-address strong {
  margin-bottom: 3px;
  color: #1b2144;
  font-size: 15px;
}

.account-order-notes {
  margin: 0;
  color: #5f6379;
  font-size: 14px;
  line-height: 1.7;
}


/* =========================================================
   Empty state
   ========================================================= */

.account-order-empty {
  padding: 48px 28px;
  border: 1px solid rgba(31, 25, 84, 0.1);
  border-radius: 22px;
  text-align: center;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(31, 25, 84, 0.08);
}

.account-order-empty .material-icons {
  color: #4d539f;
  font-size: 46px;
}

.account-order-empty h1,
.account-order-empty h3 {
  margin: 14px 0 8px;
  color: #1b2144;
}

.account-order-empty p {
  max-width: 520px;
  margin: 0 auto 22px;
  color: #6b6f89;
  line-height: 1.65;
}

.account-order-empty--compact {
  padding: 24px;
  box-shadow: none;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 980px) {
  .account-order-layout {
    grid-template-columns: 1fr;
  }

  .account-order-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-order-sidebar .account-order-card:first-child {
    grid-column: 1 / -1;
  }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 640px) {
  .account-order-section {
    padding: 26px 0 52px;
  }

  .account-order-hero {
    padding: 30px 0;
  }

  .account-order-hero__inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .account-order-hero__badges {
    justify-content: flex-start;
  }

  .account-order-card {
    padding: 20px;
    border-radius: 18px;
  }

  .account-order-sidebar {
    grid-template-columns: 1fr;
  }

  .account-order-sidebar .account-order-card:first-child {
    grid-column: auto;
  }

  .account-order-item {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 13px;
    padding: 15px;
  }

  .account-order-item__media {
    width: 62px;
    height: 62px;
    border-radius: 13px;
  }

  .account-order-item__total {
    grid-column: 2;
    margin-top: -3px;
  }

  .account-order-timeline::before {
    left: 18px;
  }

  .account-order-timeline__item {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 13px;
  }

  .account-order-timeline__icon {
    width: 38px;
    height: 38px;
  }

  .account-order-card__head h2 {
    font-size: 19px;
  }
}