/* ==========================================================
   CUSTOMER AREA
========================================================== */

.customer-area {
  min-height: 70vh;

  padding: 50px 0;

  background: #f8f8fa;
}

.customer-page-header {
  margin-bottom: 25px;
}

.customer-page-header h1 {
  margin-bottom: 6px;

  font-size: 30px;

  font-weight: 700;
}

.customer-page-header p {
  margin: 0;

  color: var(--muted);
}

/* ==========================================================
   SIDEBAR
========================================================== */

.customer-sidebar {
  position: sticky;

  top: 95px;

  overflow: hidden;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: var(--radius);
}

.customer-sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 20px;

  border-bottom: 1px solid var(--border);
}

/* Khối chứa TÊN + vai trò khách hàng */
.customer-sidebar-user > .customer-avatar + div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;

  flex: 1;
  min-width: 0;
}

/* Tên khách hàng */
.customer-sidebar-user > .customer-avatar + div strong {
  display: block;

  width: 100%;

  margin: 0;

  overflow: hidden;

  color: var(--text);

  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;

  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Dòng "Khách hàng Spa" */
.customer-sidebar-user > .customer-avatar + div small,
.customer-sidebar-user > .customer-avatar + div span {
  display: block;

  width: 100%;

  margin-top: 3px;

  color: var(--muted);

  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;

  white-space: nowrap;
}

.customer-avatar img {
  width: 100%;

  height: 100%;

  object-fit: cover;
}

.customer-menu {
  padding: 10px;
}

.customer-menu a {
  display: flex;

  align-items: center;

  gap: 12px;

  padding: 12px 14px;

  border-radius: 11px;

  color: var(--text);

  text-decoration: none;
}

.customer-menu a:hover {
  color: var(--primary);

  background: #fff6f7;
}

.customer-menu a.active {
  color: var(--primary-dark);

  background: #fff1f3;

  font-weight: 600;
}

/* Keep the sidebar and content side-by-side even in the older booking views. */
.customer-area > .container-fluid > .row {
  flex-wrap: nowrap;
}
.customer-area > .container-fluid > .row > .customer-sidebar {
  width: 240px;
  flex: 0 0 240px;
  margin-left: 12px;
}
.customer-area > .container-fluid > .row > section.col-lg-9,
.customer-area > .container-fluid > .row > section.col-xl-10 {
  min-width: 0;
  flex: 1 1 0;
}

.customer-menu-logout {
  margin-top: 8px;
  color: #a02b37 !important;
  border-top: 1px solid var(--border);
  border-radius: 0 !important;
}

/* ==========================================================
   CARD
========================================================== */

.customer-card {
  padding: 24px;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: var(--radius);
}

.customer-card h2 {
  margin-bottom: 18px;

  font-size: 20px;

  font-weight: 700;
}

.customer-card-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 20px;

  margin-bottom: 18px;
}

.customer-card-header h2 {
  margin: 0;
}

.customer-card-header a {
  color: var(--primary-dark);

  text-decoration: none;

  font-weight: 600;
}

/* ==========================================================
   STATS
========================================================== */

.customer-stat-card {
  height: 100%;

  display: flex;

  flex-direction: column;

  padding: 20px;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: var(--radius);
}

.customer-stat-card i {
  margin-bottom: 12px;

  color: var(--primary);

  font-size: 23px;
}

.customer-stat-card strong {
  font-size: 26px;
}

.customer-stat-card span {
  color: var(--muted);

  font-size: 14px;
}

/* ==========================================================
   EMPTY
========================================================== */

.customer-empty {
  padding: 45px 20px;

  text-align: center;

  background: #ffffff;

  border-radius: var(--radius);
}

.customer-empty i {
  display: block;

  margin-bottom: 15px;

  color: var(--muted);

  font-size: 46px;
}

/* ==========================================================
   ADDRESS
========================================================== */

.address-card {
  height: 100%;

  padding: 20px;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: var(--radius);
}

.address-card h3 {
  font-size: 18px;
}

.address-card p {
  display: flex;

  align-items: flex-start;

  gap: 9px;

  margin-bottom: 8px;

  color: #555;
}

/* ==========================================================
   ORDER STATUS
========================================================== */

.order-status {
  display: inline-block;

  padding: 6px 10px;

  border-radius: 999px;

  font-size: 13px;

  font-weight: 600;
}

.status-pending {
  color: #8a6500;

  background: #fff4c7;
}

.status-confirmed {
  color: #3156a3;

  background: #e7efff;
}

.status-packing {
  color: #7048a8;

  background: #f1e8ff;
}

.status-shipping {
  color: #166d82;

  background: #ddf7fc;
}

.status-completed {
  color: #137333;

  background: #e3f5e8;
}

.status-cancelled {
  color: #a02b37;

  background: #fde6e8;
}

/* ==========================================================
   ORDER FILTER
========================================================== */

.order-filter {
  display: flex;

  gap: 8px;

  margin-bottom: 20px;

  overflow-x: auto;

  padding-bottom: 5px;
}

.order-filter a {
  flex: 0 0 auto;

  padding: 8px 14px;

  border: 1px solid var(--border);

  border-radius: 999px;

  background: #ffffff;

  color: var(--text);

  text-decoration: none;

  font-size: 14px;
}

.order-filter a.active {
  border-color: var(--primary);

  background: var(--primary);

  color: #ffffff;
}

/* ==========================================================
   ORDER CARD
========================================================== */

.customer-order-list {
  display: grid;

  gap: 15px;
}

.customer-order-card {
  overflow: hidden;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: var(--radius);
}

.customer-order-header,
.customer-order-body,
.customer-order-footer {
  padding: 17px 20px;
}

.customer-order-header {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  border-bottom: 1px solid var(--border);
}

.customer-order-header > div {
  display: flex;

  flex-direction: column;
}

.customer-order-header small {
  color: var(--muted);
}

.customer-order-body {
  display: flex;

  justify-content: space-between;

  gap: 20px;
}

.customer-order-footer {
  display: flex;

  justify-content: flex-end;

  padding-top: 0;
}

/* ==========================================================
   ORDER DETAIL
========================================================== */

.order-detail-item {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  padding: 13px 0;

  border-bottom: 1px solid var(--border);
}

.order-detail-item > div {
  display: flex;

  flex-direction: column;
}

.order-detail-item small {
  color: var(--muted);
}

.order-money-row,
.order-grand-total {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  padding: 8px 0;
}

.order-grand-total {
  margin-top: 8px;

  font-size: 20px;
}

.order-grand-total strong {
  color: var(--primary-dark);

  font-size: 24px;
}

/* ==========================================================
   TIMELINE
========================================================== */

.order-timeline {
  position: relative;

  padding-left: 12px;
}

.timeline-item {
  position: relative;

  display: grid;

  grid-template-columns: 20px 1fr;

  gap: 12px;

  padding-bottom: 22px;
}

.timeline-item::before {
  content: "";

  position: absolute;

  top: 15px;

  left: 6px;

  width: 2px;

  height: 100%;

  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: relative;

  z-index: 1;

  width: 14px;

  height: 14px;

  margin-top: 4px;

  border: 3px solid #ffffff;

  border-radius: 50%;

  background: var(--primary);

  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item > div {
  display: flex;

  flex-direction: column;
}

.timeline-item small {
  color: var(--muted);
}

.timeline-item p {
  margin: 6px 0 0;

  color: #555;
}

/* ==========================================================
   DANGER
========================================================== */

.customer-danger-zone {
  border-color: #f0b9bd;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 991.98px) {
  .customer-area > .container-fluid > .row {
    flex-wrap: wrap;
  }
  .customer-area > .container-fluid > .row > .customer-sidebar {
    width: 100%;
    flex-basis: 100%;
    margin-left: 0;
  }
  .customer-sidebar {
    position: static;
  }

  .customer-sidebar .sidebar-toggle {
    display: inline-flex;
  }
  .customer-menu {
    display: none;
  }
  .customer-sidebar.is-open .customer-menu {
    display: flex;
    flex-direction: column;
  }

  .customer-menu a {
    flex: 0 0 auto;
  }
}

@media (max-width: 575.98px) {
  .customer-area {
    padding: 30px 0;
  }

  .customer-page-header h1 {
    font-size: 25px;
  }

  .customer-card {
    padding: 18px;
  }

  .customer-order-header,
  .customer-order-body {
    flex-direction: column;
  }

  .order-detail-item {
    flex-direction: column;
  }
}
/* ==========================================================
   CUSTOMER REVIEW
========================================================== */

.customer-review-item {
  padding: 20px 0;

  border-bottom: 1px solid var(--border);
}

.customer-review-item:last-child {
  border-bottom: 0;
}

.customer-review-product {
  display: flex;

  align-items: center;

  gap: 12px;

  margin-bottom: 15px;
}

.customer-review-product > div:last-child {
  display: flex;

  flex-direction: column;
}

.customer-review-product small {
  color: var(--muted);
}

.customer-review-image {
  width: 60px;

  height: 60px;

  flex: 0 0 60px;

  display: flex;

  align-items: center;

  justify-content: center;

  overflow: hidden;

  border-radius: 10px;

  background: #f7f7f7;
}

.customer-review-image img {
  width: 100%;

  height: 100%;

  object-fit: cover;
}

.customer-review-history {
  padding: 18px 0;

  border-bottom: 1px solid var(--border);
}

.customer-review-history:last-child {
  border-bottom: 0;
}

.customer-review-history p {
  margin: 10px 0;
}

.owner-review-reply {
  margin-top: 15px;

  padding: 15px;

  border-radius: 12px;

  background: #fff5f6;
}
.customer-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.customer-user-info strong {
  display: block;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: #24252d;
}

.customer-user-info span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
  color: #8a8790;
}
/* ==========================================================
   FIX CUSTOMER AVATAR
========================================================== */

/* Avatar ở sidebar */
.customer-sidebar .customer-sidebar-user .customer-avatar {
  width: 48px !important;
  height: 48px !important;

  min-width: 48px !important;
  max-width: 48px !important;

  min-height: 48px !important;
  max-height: 48px !important;

  flex: 0 0 48px !important;

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

  overflow: hidden;

  border-radius: 50%;

  background: #fff1f3;
}

/* Ảnh bên trong avatar sidebar */
.customer-sidebar .customer-sidebar-user .customer-avatar img {
  width: 100% !important;
  height: 100% !important;

  max-width: 100% !important;
  max-height: 100% !important;

  display: block;

  object-fit: cover !important;
  object-position: center;

  border-radius: 50%;
}

/* ==========================================================
   AVATAR TRONG TRANG HỒ SƠ
========================================================== */

.customer-card .customer-avatar {
  width: 110px !important;
  height: 110px !important;

  min-width: 110px !important;
  max-width: 110px !important;

  min-height: 110px !important;
  max-height: 110px !important;

  flex: 0 0 110px !important;

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

  overflow: hidden;

  border: 1px solid #ece7eb;
  border-radius: 50%;

  background: #fff1f3;
}

/* Ảnh đại diện trang hồ sơ */
.customer-card .customer-avatar img {
  width: 100% !important;
  height: 100% !important;

  max-width: 100% !important;
  max-height: 100% !important;

  display: block;

  object-fit: cover !important;
  object-position: center;

  border-radius: 50%;
}

/* Icon fallback */
.customer-card .customer-avatar i,
.customer-sidebar .customer-avatar i {
  font-size: 28px;
}
/* ==========================================================
   FIX AVATAR BỊ CẮT HÌNH
   Dùng cho logo / ảnh không muốn bị crop
========================================================== */

/* Avatar sidebar khách hàng */
.customer-sidebar .customer-sidebar-user .customer-avatar {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;

  flex: 0 0 48px !important;

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

  overflow: hidden;
  border-radius: 50%;
  background: #ffffff;
  padding: 4px;
  border: 1px solid #ece7eb;
}

.customer-sidebar .customer-sidebar-user .customer-avatar img {
  width: 100% !important;
  height: 100% !important;
  display: block;

  object-fit: contain !important;
  object-position: center !important;

  border-radius: 50%;
}

/* Avatar trong trang hồ sơ */
.customer-card .customer-avatar {
  width: 96px !important;
  height: 96px !important;
  min-width: 96px !important;
  min-height: 96px !important;
  max-width: 96px !important;
  max-height: 96px !important;

  flex: 0 0 96px !important;

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

  overflow: hidden;
  border-radius: 50%;
  background: #ffffff;
  padding: 6px;
  border: 1px solid #ece7eb;
}

.customer-card .customer-avatar img {
  width: 100% !important;
  height: 100% !important;
  display: block;

  object-fit: contain !important;
  object-position: center !important;

  border-radius: 50%;
}

/* Avatar trên navbar khách hàng */
.customer-account-avatar,
.customer-navbar-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;

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

  overflow: hidden;
  border-radius: 50%;
  background: #ffffff;
  padding: 3px;
  border: 1px solid #ece7eb;
}

.customer-account-avatar img,
.customer-navbar-avatar img {
  width: 100%;
  height: 100%;
  display: block;

  object-fit: contain !important;
  object-position: center !important;

  border-radius: 50%;
}
/* ==========================================================
   CUSTOMER - LOGOUT BUTTON
========================================================== */

.customer-logout-form {
  width: 100%;
  margin: 8px 0 0;
  padding: 0;
}

.customer-menu-logout {
  width: 100%;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 11px 14px;

  border: 0;
  border-radius: 10px;

  background: #fff1f3;
  color: #dc3545;

  font-size: 15px;
  font-weight: 600;

  text-align: left;

  cursor: pointer;

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

.customer-menu-logout i {
  width: 20px;

  font-size: 18px;
  text-align: center;
}

.customer-menu-logout:hover {
  background: #dc3545;
  color: #fff;
}

.customer-menu-logout:active {
  transform: scale(0.98);
}

.customer-menu-logout:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}
