/* ==========================================================================
   Account → Sifarişlər / Sifariş məlumatı (oi_*)
   Loaded from catalog/controller/account/order.php via $this->document->addStyle()
   ========================================================================== */

/* ---------- Status nişanları (siyahı və sifariş səhifəsi) ---------- */
.orders_status_badge.is-success {
  background: #e8f7ee;
  color: #0a7a35;
}

.orders_status_badge.is-progress {
  background: #fff4e0;
  color: #9a5b00;
}

.orders_status_badge.is-muted {
  background: #f1f2f4;
  color: #5b6167;
}

/* ---------- Layout ---------- */
.oi {
  display: grid;
  gap: 16px;
  min-width: 0;
  color: #1c2126;
}

.oi_card {
  padding: 28px;
}

.oi_grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: 16px;
}

.oi_side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.oi_section_title {
  margin: 0 0 16px;
  color: #1c2126;
  font-size: 17px;
  font-weight: 700;
}

/* ---------- Başlıq ---------- */
.oi_head {
  display: grid;
  gap: 22px;
}

.oi_back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  color: #73777b;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.oi_back svg {
  width: 16px;
  height: 16px;
}

.oi_back:hover {
  color: #e00000;
}

.oi_title_row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.oi_title {
  margin: 0;
}

.oi_facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 0;
}

.oi_facts > div {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f7f8f9;
}

.oi_facts dt {
  margin: 0 0 4px;
  color: #73777b;
  font-size: 12px;
  font-weight: 500;
}

.oi_facts dd {
  margin: 0;
  color: #1c2126;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

/* ---------- Məhsullar ---------- */
.oi_items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.oi_item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #eceef0;
}

.oi_item:first-child {
  padding-top: 0;
}

.oi_item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.oi_item_img {
  display: block;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid #eceef0;
  border-radius: 12px;
  background: #fff;
}

.oi_item_img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.oi_item_body {
  min-width: 0;
}

.oi_item_name {
  color: #1c2126;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  word-break: break-word;
}

.oi_item_name:hover {
  color: #e00000;
}

.oi_item_meta {
  margin: 4px 0 0;
  padding: 0;
  color: #8b929a;
  font-size: 12px;
  line-height: 1.5;
  list-style: none;
}

.oi_item_meta a {
  color: #e00000;
}

.oi_item_actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.oi_reorder_form {
  margin: 0;
}

.oi_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 16px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.oi_btn svg {
  width: 16px;
  height: 16px;
}

.oi_btn--primary {
  background: #e00000;
  color: #fff;
}

.oi_btn--primary:hover {
  background: #c00000;
  color: #fff;
}

.oi_btn--ghost {
  border-color: #eceef0;
  background: #fff;
  color: #1c2126;
}

.oi_btn--ghost:hover {
  border-color: #d5d9de;
  color: #e00000;
}

.oi_btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.oi_error {
  display: none;
  margin-top: 6px;
  color: #c00000;
  font-size: 12px;
}

.oi_error.is-visible {
  display: block;
}

.oi_item_price {
  display: grid;
  gap: 4px;
  text-align: right;
  white-space: nowrap;
}

.oi_item_qty {
  color: #8b929a;
  font-size: 12px;
}

.oi_item_price strong {
  color: #1c2126;
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Xülasə ---------- */
.oi_totals {
  display: grid;
  gap: 10px;
  margin: 0;
}

.oi_total_row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #4a5057;
  font-size: 14px;
}

.oi_total_row dt,
.oi_total_row dd {
  margin: 0;
  font-weight: 400;
}

.oi_total_row dd {
  white-space: nowrap;
}

.oi_total_row.is-grand {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid #eceef0;
  color: #1c2126;
  font-size: 18px;
}

.oi_total_row.is-grand dt,
.oi_total_row.is-grand dd {
  font-weight: 700;
}

/* ---------- Ünvanlar və qeyd ---------- */
.oi_address + .oi_address {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eceef0;
}

.oi_address h3 {
  margin: 0 0 6px;
  color: #73777b;
  font-size: 12px;
  font-weight: 600;
}

.oi_address p,
.oi_comment {
  margin: 0;
  color: #1c2126;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

/* ---------- Tarixçə ---------- */
.oi_timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 22px;
  list-style: none;
}

.oi_timeline::before {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 5px;
  width: 2px;
  border-radius: 1px;
  background: #eceef0;
  content: "";
}

.oi_timeline_item {
  position: relative;
  padding-bottom: 18px;
}

.oi_timeline_item:last-child {
  padding-bottom: 0;
}

.oi_timeline_item::before {
  position: absolute;
  top: 4px;
  left: -22px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #c9ced4;
  box-shadow: 0 0 0 1px #c9ced4;
  content: "";
}

.oi_timeline_item.is-current::before {
  background: #e00000;
  box-shadow: 0 0 0 1px #e00000;
}

.oi_timeline_head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.oi_timeline_status {
  color: #1c2126;
  font-size: 14px;
  font-weight: 600;
}

.oi_timeline_date {
  color: #8b929a;
  font-size: 12px;
}

.oi_timeline_comment {
  margin: 6px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f8f9;
  color: #4a5057;
  font-size: 13px;
  line-height: 1.55;
}

.oi_empty {
  margin: 0;
  color: #73777b;
  font-size: 14px;
}

/* ---------- Pagination (sifarişlər siyahısı) ---------- */
.orders_pagination_row .pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.orders_pagination_row .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #eceef0;
  border-radius: 10px;
  background: #fff;
  color: #1c2126;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s, color .2s;
}

.orders_pagination_row a.page-link:hover {
  border-color: #e00000;
  color: #e00000;
}

.orders_pagination_row .page-item.active .page-link {
  border-color: #e00000;
  background: #e00000;
  color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .oi_grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .oi_card {
    padding: 20px;
  }

  .oi_item {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .oi_item_img {
    width: 60px;
    height: 60px;
  }

  .oi_item_price {
    grid-column: 2;
    text-align: left;
  }
}
