/* ========================================
   Order Detail Page Styles
   Adapted to Furni1.lt design system
   All rules scoped under .page-order-detail
   ======================================== */

/* ----------------------------------------
   1. General / Container
   ---------------------------------------- */

.page-order-detail #content {
  font-family: var(--ffPrimary);
  color: var(--cText);
  font-size: var(--fz-13);
}

/* content links only: the account nav and buttons own their colors */
.page-order-detail .account-content a:not(.btn) {
  color: var(--cBlack);
  text-decoration: none;
}

/* ----------------------------------------
   2. Box blocks
   ---------------------------------------- */

.page-order-detail .box {
  background: var(--cWhite);
  border-radius: var(--bdrsPrimary);
  border: 1px solid var(--bdcPrimaryLight);
  padding: var(--spaceM);
  margin-bottom: var(--spaceTopL);
}

/* ----------------------------------------
   3. Headings
   ---------------------------------------- */

.page-order-detail h3 {
  font-family: var(--ffHeading);
  font-weight: var(--fwHeading);
  font-size: var(--fz-18);
  color: var(--cText);
  text-transform: none;
  margin-bottom: var(--spaceM);
}

.page-order-detail h4 {
  font-family: var(--ffHeading);
  font-weight: 500;
  font-size: var(--fz-16);
  color: var(--cText);
}

/* ----------------------------------------
   4. Order info block
   ---------------------------------------- */

.page-order-detail #order-infos .box strong {
  color: var(--cText);
  font-family: var(--ffHeading);
  font-weight: 500;
}

.page-order-detail #order-infos .box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-order-detail #order-infos .box ul li {
  padding: var(--spaceXs) 0;
  border-bottom: 1px solid var(--bdcPrimaryLight);
}

.page-order-detail #order-infos .box ul li:last-child {
  border-bottom: 0;
}

.page-order-detail #order-infos .box ul li strong {
  font-family: var(--ffHeading);
  font-weight: 500;
}

/* Reorder button */
.page-order-detail .button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 var(--spaceRightM);
  background: var(--cBlack);
  color: var(--cWhite);
  font-family: var(--ffHeading);
  font-size: var(--fz-13);
  font-weight: 500;
  border: 0;
  border-radius: 24px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.page-order-detail .button-primary:hover {
  color: var(--cWhite);
  opacity: 0.85;
}

/* ----------------------------------------
   5. Tables (shared styles for all tables)
   ---------------------------------------- */

.page-order-detail .table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin-bottom: 0;
  border: 1px solid var(--bdcPrimaryLight);
  border-radius: var(--bdrsPrimary);
  overflow: hidden;
}

.page-order-detail .table thead.thead-default {
  background: var(--bgcLight);
}

.page-order-detail .table thead.thead-default th {
  color: var(--cText);
  font-family: var(--ffHeading);
  font-weight: 500;
  font-size: var(--fz-13);
  padding: var(--spaceS);
  border-bottom: 1px solid var(--bdcPrimaryLight);
  border-top: 0;
}

.page-order-detail .table td {
  padding: var(--spaceS);
  border-top: 1px solid var(--bdcPrimaryLight);
  color: var(--cText);
  vertical-align: middle;
}

.page-order-detail .table.table-bordered,
.page-order-detail .table.table-bordered th,
.page-order-detail .table.table-bordered td {
  border-color: var(--bdcPrimaryLight);
}

.page-order-detail .table.table-striped tbody tr:nth-of-type(odd) {
  background-color: transparent;
}

/* Table footer (totals) */
.page-order-detail .table tfoot tr td {
  padding: var(--spaceS);
  border-top: 1px solid var(--bdcPrimaryLight);
}

.page-order-detail .table tfoot tr:last-child td {
  font-family: var(--ffHeading);
  font-weight: 500;
  font-size: var(--fz-16);
  background: var(--bgcLight);
}

/* ----------------------------------------
   6. Order history (#order-history)
   ---------------------------------------- */

.page-order-detail #order-history {
  overflow: hidden;
}

/* Status labels */
.page-order-detail .label.label-pill {
  border-radius: 13px;
  padding: 4px 12px;
  font-size: var(--fz-13);
  font-family: var(--ffPrimary);
  font-weight: 500;
}

/* Mobile history lines */
.page-order-detail #order-history .history-lines .history-line {
  padding: var(--spaceS) 0;
  border-bottom: 1px solid var(--bdcPrimaryLight);
}

.page-order-detail #order-history .history-lines .history-line:last-child {
  border-bottom: 0;
}

.page-order-detail #order-history .history-lines .history-line .date {
  color: var(--cTextLight);
  font-size: var(--fz-13);
  margin-bottom: var(--spaceXxs);
}

/* ----------------------------------------
   7. Order products (desktop table)
   ---------------------------------------- */

.page-order-detail #order-products td a {
  font-weight: 500;
  color: var(--cText);
}

.page-order-detail #order-products td a:hover {
  color: var(--cDanger);
}

/* ----------------------------------------
   8. Order items (mobile view)
   ---------------------------------------- */

.page-order-detail .order-items {
  padding: 0 !important;
}

.page-order-detail .order-items .order-item {
  padding: var(--spaceM);
  border-bottom: 1px solid var(--bdcPrimaryLight);
}

.page-order-detail .order-items .order-item:last-child {
  border-bottom: 0;
}

.page-order-detail .order-items .order-item .name {
  font-weight: 500;
  color: var(--cText);
  margin-bottom: var(--spaceXxs);
}

.page-order-detail .order-items .order-item .ref {
  color: var(--cTextLight);
  font-size: var(--fz-13);
}

/* ----------------------------------------
   9. Order totals (mobile)
   ---------------------------------------- */

.page-order-detail .order-totals {
  padding: var(--spaceM) !important;
}

.page-order-detail .order-totals .order-total {
  padding: var(--spaceXs) 0;
  border-bottom: 1px solid var(--bdcPrimaryLight);
}

.page-order-detail .order-totals .order-total:last-child {
  border-bottom: 0;
  font-family: var(--ffHeading);
  font-weight: 500;
  font-size: var(--fz-16);
  padding-top: var(--spaceS);
}

/* ----------------------------------------
   10. Addresses
   ---------------------------------------- */

.page-order-detail .addresses article.box {
  border: 1px solid var(--bdcPrimaryLight);
  border-radius: var(--bdrsPrimary);
}

.page-order-detail .addresses address {
  color: var(--cText);
  font-style: normal;
  line-height: 1.6;
}

/* ----------------------------------------
   11. Shipping table
   ---------------------------------------- */

.page-order-detail .shipping-lines .shipping-line {
  padding: var(--spaceS) 0;
  border-bottom: 1px solid var(--bdcPrimaryLight);
}

.page-order-detail .shipping-lines .shipping-line:last-child {
  border-bottom: 0;
}

.page-order-detail .shipping-lines .shipping-line ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-order-detail .shipping-lines .shipping-line li {
  padding: var(--spaceXxs) 0;
}

.page-order-detail .shipping-lines .shipping-line li strong {
  font-family: var(--ffHeading);
  font-weight: 500;
}

/* ----------------------------------------
   12. Messages
   ---------------------------------------- */

.page-order-detail .messages .message {
  padding: var(--spaceM) 0;
  border-bottom: 1px solid var(--bdcPrimaryLight);
}

.page-order-detail .messages .message:last-child {
  border-bottom: 0;
}

/* ----------------------------------------
   13. Forms (message form, return form)
   ---------------------------------------- */

.page-order-detail .form-control {
  border: 1px solid var(--bdcPrimary);
  border-radius: var(--bdrsPrimarySm);
  font-family: var(--ffPrimary);
  font-size: var(--fz-13);
  color: var(--cText);
  padding: var(--spaceS);
}

.page-order-detail .form-control:focus {
  border-color: var(--bdcPrimaryDark);
  outline: none;
  box-shadow: none;
}

.page-order-detail .form-control-select {
  height: var(--hFormControl);
  padding: 0 var(--spaceS);
}

.page-order-detail .form-control-label {
  color: var(--cText);
  font-size: var(--fz-13);
  font-family: var(--ffHeading);
  font-weight: 500;
}

.page-order-detail textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Submit buttons (Send, Request a return) */
.page-order-detail .btn-primary,
.page-order-detail .form-control-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 200px;
  height: 48px;
  padding: 0 var(--spaceRightXl);
  background: var(--cBlack);
  color: var(--cWhite);
  font-family: var(--ffHeading);
  font-size: var(--fz-16);
  font-weight: 500;
  border: 0;
  border-radius: 24px;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
}

.page-order-detail .btn-primary:hover,
.page-order-detail .form-control-submit:hover {
  background: var(--cBlack);
  color: var(--cWhite);
  opacity: 0.85;
}

.page-order-detail .form-footer {
  margin-top: var(--spaceM);
}

/* ----------------------------------------
   14. Return form specifics
   ---------------------------------------- */

.page-order-detail #order-return-form header {
  margin-bottom: var(--spaceM);
}

.page-order-detail #order-return-form header p {
  color: var(--cTextLight2);
  font-size: var(--fz-13);
  line-height: 1.5;
}

/* Checkboxes */
.page-order-detail input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cBlack);
  cursor: pointer;
}

/* ----------------------------------------
   15. Order message form specifics
   ---------------------------------------- */

.page-order-detail .order-message-form header {
  margin-bottom: var(--spaceM);
}

.page-order-detail .order-message-form header p {
  color: var(--cTextLight2);
  font-size: var(--fz-13);
  line-height: 1.5;
}

.page-order-detail .order-message-form .form-footer {
  text-align: right;
}

/* ----------------------------------------
   16. Follow-up link
   ---------------------------------------- */

.page-order-detail .box > p + a {
  word-break: break-all;
  color: var(--cBlack);
  text-decoration: underline;
}

.page-order-detail .box > p + a:hover {
  color: var(--cDanger);
}

/* ----------------------------------------
   17. Footer
   ---------------------------------------- */

.page-order-detail .page-footer {
  display: flex;
}
/* --- Custom order details styles from Furni_des --- */
/* order head: title + current-state pill */
.order-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.order-head__title { font-size: var(--fz-h2); font-weight: 500; margin: 0; color: var(--c-ink); }
.order-head__badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--c-ink);
  color: #fff;
  font-size: var(--fz-14);
  font-weight: 500;
}

/* label: value pairs */
.order-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
  row-gap: 12px;
  margin-bottom: 32px;
  font-size: var(--fz-14);
  color: var(--c-ink);
}
.order-meta p { margin: 0; }
.order-meta strong { font-weight: 600; color: var(--c-ink); }
/* Each column keeps the row rhythm the grid used to provide directly. */
.order-meta__details,
.order-meta__address { display: grid; align-content: start; row-gap: 12px; }
.order-meta--single { grid-template-columns: 1fr; }
@media (max-width: 767px) {
  .order-meta { grid-template-columns: 1fr; }
}

.order-section { margin-bottom: 40px; }
.order-section--prominent { margin-bottom: 48px; padding: 32px; background: var(--c-bg-soft); border-radius: 12px; }
.order-section__title {
  font-size: 20px; font-weight: 500;
  color: var(--c-ink); margin: 0 0 16px 0;
  padding-bottom: 12px; border-bottom: 1px solid var(--c-line);
}
.order-section--prominent .order-section__title {
  border-bottom: none;
}

/* fixed-step progress timeline: one row from 1200px, a four-column grid that
   wraps to a second row between 768px and 1199px (7-8 steps cannot fit one
   row while the account sidebar is present), vertical below 768px.
   A step's ::before is the connector INTO it from the previous dot, so
   completed segments follow completed steps exactly; the segment into the
   first unfinished step is half filled to read as in progress. */
.order-progress {
  list-style: none;
  margin: 0;
  padding: 0;
}
.order-progress__step { position: relative; }
.order-progress__step::before {
  content: "";
  position: absolute;
  background: var(--c-line);
}
.order-progress__step.is-done::before { background: var(--c-accent); }
.order-progress__dot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--c-line);
  background: #fff;
  color: var(--c-ink);
}
.order-progress__step.is-done .order-progress__dot { border-color: var(--c-accent); color: var(--c-accent); }
.order-progress__label { display: block; font-weight: 600; font-size: var(--fz-14); color: var(--c-ink); }
/* the step columns are narrow enough that a date would otherwise break at its own hyphen */
.order-progress__date {
  display: block;
  font-size: var(--fz-account-secondary);
  color: var(--c-mute);
  margin-top: 2px;
  white-space: nowrap;
}
.order-progress__date-note { display: block; }
@media (min-width: 768px) {
  .order-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
  }
  .order-progress__step::before {
    top: 13px;
    left: -50%;
    width: 100%;
    height: 2px;
  }
  .order-progress__step:first-child::before { display: none; }
  .order-progress__step.is-done + .order-progress__step:not(.is-done)::before {
    background: linear-gradient(to right, var(--c-accent) 50%, var(--c-line) 50%);
  }
  .order-progress__info {
    margin-top: 10px;
    padding: 0 4px;
  }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .order-progress {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    row-gap: 28px;
  }
  /* the rail keeps running across the wrap: it leaves the last dot of the row
     (::after on the row's last step), crosses back along the middle of the row
     gap (::before below) and drops into the top of the next row's first dot
     (::after below). The crossing is a background, not a border, so a
     handover in progress can fade out halfway under the first row. */
  .order-progress__step:nth-child(4n+1)::before {
    top: -15px;
    left: 50%;
    /* stops where the corner's curve starts; the corner itself is drawn by
       the previous row's ::after, so a straight end here would poke out of it */
    right: calc(-300% + 16px);
    width: auto;
    height: 2px;
    margin-left: 11px;
  }
  .order-progress__step.is-done + .order-progress__step:not(.is-done):nth-child(4n+1)::before {
    background: linear-gradient(to left, var(--c-accent) 50%, var(--c-line) 50%);
  }
  .order-progress__step:nth-child(4n+1):not(:first-child)::after {
    content: "";
    position: absolute;
    top: -15px;
    left: 50%;
    width: 14px;
    height: 15px;
    margin-left: -1px;
    border-top: 2px solid var(--c-line);
    border-left: 2px solid var(--c-line);
    border-top-left-radius: 14px;
  }
  .order-progress__step.is-done:nth-child(4n+1)::after { border-color: var(--c-accent); }
  .order-progress__step:nth-child(4n):not(:last-child)::after {
    content: "";
    position: absolute;
    top: 13px;
    left: 50%;
    right: 0;
    bottom: -15px;
    border-top: 2px solid var(--c-line);
    border-right: 2px solid var(--c-line);
    border-bottom: 2px solid var(--c-line);
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
  }
  .order-progress__step.is-done:nth-child(4n):not(:last-child)::after { border-color: var(--c-accent); }
}
@media (min-width: 1200px) {
  .order-progress { display: flex; }
  .order-progress__step { flex: 1 1 0; }
}
@media (max-width: 767px) {
  .order-progress__step {
    display: flex;
    gap: 16px;
    padding-bottom: 24px;
  }
  .order-progress__step:last-child { padding-bottom: 0; }
  .order-progress__step::before {
    left: 13px;
    top: 28px;
    bottom: 0;
    width: 2px;
  }
  .order-progress__step:last-child::before { display: none; }
  .order-progress__step.is-done + .order-progress__step:not(.is-done)::before {
    background: linear-gradient(to bottom, var(--c-accent) 50%, var(--c-line) 50%);
  }
  .order-progress__dot { flex-shrink: 0; }
  .order-progress__info { padding-top: 3px; }
}

address {
  font-style: normal; font-size: 15px; color: var(--c-ink); line-height: 1.6; margin: 0;
}

/* order table with images */
.order-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
}
/* product cards, same pattern as the order-history cards: name is the header
   band; the other cells stack label-left/value-right, and from 1025px flow
   inline as label-over-value columns */
.order-table-wrapper .order-table { margin-bottom: 0; }
.order-table { width: 100%; font-size: var(--fz-14); margin-bottom: 24px; }
.order-table thead { display: none; }
.order-table,
.order-table tbody,
.order-table th,
.order-table td { display: block; width: auto; }
.order-table tr {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  margin-bottom: 16px;
  background: #fff;
  overflow: hidden;
}
.order-table tr:last-child { margin-bottom: 0; }
.order-table td {
  flex: 1 1 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 0;
  border-bottom: 1px solid var(--c-line-3);
  margin: 0 16px;
  padding: 12px 0;
  text-align: right;
  font-size: var(--fz-14);
}
.order-table td::before {
  content: attr(data-label);
  font-weight: 600;
  color: var(--c-ink);
  font-size: var(--fz-14);
  text-align: left;
  flex: 0 0 auto;
  margin-right: 12px;
}
.order-table td:first-child {
  display: block;
  padding: 14px 16px;
  margin: 0;
  background: var(--c-bg-soft);
  border-bottom: 1px solid var(--c-line);
  text-align: left;
}
.order-table td:first-child::before { content: none; }
.order-table td.col-image::before { content: none; }
.order-table td:last-child { border-bottom: 0; }
@media (min-width: 1025px) {
  .order-table td:not(:first-child) {
    flex: 1 1 140px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    border-bottom: 0;
    margin: 0;
    padding: 14px 16px 16px 16px;
    text-align: center;
  }
  .order-table td:not(:first-child)::before { margin-right: 0; }
  .order-table td.col-image { flex: 0 0 140px; justify-content: center; }
}
.order-table__product { color: var(--c-ink); text-decoration: none; font-weight: 600; }
.order-table__product:hover { color: var(--c-accent); }
.order-table__attrs { font-size: 13px; color: var(--c-mute-2); font-weight: 300; }
.order-table__return { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.order-table__return-pick { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; cursor: pointer; }
.order-table__return .form-control-select { width: auto; min-width: 64px; }
@media (min-width: 1025px) {
  .order-table__return { align-items: center; }
}
.order-table__image-placeholder {
  width: 90px; height: 60px; border-radius: 6px;
}
.delivery-days {
  font-size: 13px; font-weight: 500; color: var(--c-mute);
  background: var(--c-bg-soft); padding: 4px 8px; border-radius: 4px;
  display: inline-block;
}
.delivery-days--ready {
  color: #1f8a5b; background: rgba(31, 138, 91, 0.1);
}
.text-right { text-align: right; }

/* price summary box */
.order-summary {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 24px;
  max-width: 380px;
  margin-left: auto;
}
.order-summary__row {
  display: flex; justify-content: space-between;
  padding: 8px 0; font-size: 15px; color: var(--c-ink);
}
.order-summary__row:not(:last-child) { border-bottom: 1px solid var(--c-line); }
.order-summary__total {
  font-weight: 500; font-size: 18px; padding: 16px 0 0 0;
}

/* collapsible notes */
.order-notes { cursor: pointer; }
.order-notes__toggle {
  display: block; padding: 16px; background: var(--c-bg-soft);
  border: 1px solid var(--c-line); border-radius: 8px;
  font-size: var(--fz-14); font-weight: 500; color: var(--c-ink);
  list-style: none; user-select: none;
}
.order-notes__toggle::marker,
.order-notes__toggle::-webkit-details-marker { display: none; }
.order-notes__toggle::before {
  content: "▸"; display: inline-block; transform: rotate(0deg); margin-right: 8px;
  transition: transform .2s;
  font-size: var(--fz-14);
}
.order-notes[open] .order-notes__toggle::before { transform: rotate(90deg); }
.order-notes__content {
  padding: 16px 16px 0; font-size: var(--fz-14); color: var(--c-ink); line-height: 1.6;
}

/* order actions */
.order-actions { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--c-line); }
.order-actions .btn { display: inline-block; }

/* --- Inline style replacements --- */
.customization-margin { margin-top: 4px; }
.order-table__image-container {
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: inline-block;
}
.order-table__image-container img { max-width: 100%; height: auto; }
.delivery-days--danger { color: #ff4c4c; /* fallback */ }
.messages-box { margin-bottom: 24px; }
.message-row { border-bottom: 1px solid var(--c-line); padding: 12px 0; }
.message-date { font-size: 0.9em; color: var(--c-mute-2); }
.form-footer-margin { margin-top: 16px; }
