/* ─── My Account Page ─── */

.page-account {
  --account-screen-bg: #f5f5f5;
  --account-panel-bg: #ffffff;
  --account-panel-radius: calc(8 * var(--u));
  --account-panel-border: 1px solid rgba(58, 36, 24, 0.08);
  --account-panel-shadow: 0 calc(2 * var(--u)) calc(12 * var(--u)) rgba(58, 36, 24, 0.04);
  --account-page-padding-x: clamp(calc(24 * var(--u)), 10vw, calc(192 * var(--u)));

  background: var(--account-screen-bg);
}

.page-account .header {
  background: #ffffff;
  border-bottom: 1px solid rgba(58, 36, 24, 0.06);
}

.account-main {
  width: 100%;
  background: var(--account-screen-bg);
}

.account-wrap {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: calc(40 * var(--u)) var(--account-page-padding-x) calc(56 * var(--u));
}

.account-head {
  margin-bottom: calc(28 * var(--u));
}

.account-title {
  font-family: var(--font-playfair);
  font-weight: 600;
  font-size: calc(32 * var(--u));
  line-height: calc(38 * var(--u));
  color: #3a2418;
  margin: 0 0 calc(6 * var(--u));
}

.account-subtitle {
  font-family: var(--font-manrope);
  font-size: calc(14 * var(--u));
  color: rgba(58, 36, 24, 0.65);
  margin: 0;
}

.account-layout {
  display: grid;
  grid-template-columns: calc(240 * var(--u)) minmax(0, 1fr);
  gap: calc(28 * var(--u));
  align-items: start;
}

/* Sidebar */
.account-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--account-panel-bg);
  border: var(--account-panel-border);
  border-radius: var(--account-panel-radius);
  box-shadow: var(--account-panel-shadow);
  overflow: hidden;
}

.account-sidebar__link {
  display: block;
  width: 100%;
  text-align: left;
  padding: calc(16 * var(--u)) calc(20 * var(--u));
  border: none;
  border-bottom: 1px solid #f0ece4;
  background: transparent;
  font-family: var(--font-manrope);
  font-weight: 500;
  font-size: calc(14 * var(--u));
  color: rgba(58, 36, 24, 0.75);
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.account-sidebar__link:last-child {
  border-bottom: none;
}

.account-sidebar__link:hover {
  background: #f8f6f3;
  color: #3a2418;
}

.account-sidebar__link.is-active {
  color: #3a2418;
  font-weight: 700;
  background: #f5f0e1;
  box-shadow: inset calc(3 * var(--u)) 0 0 #8b5e3c;
}

.account-sidebar__link--logout {
  color: #b5453a;
}

.account-sidebar__link--logout:hover {
  background: #fbeceb;
  color: #b5453a;
}

/* Panel */
.account-panel {
  background: var(--account-panel-bg);
  border: var(--account-panel-border);
  border-radius: var(--account-panel-radius);
  box-shadow: var(--account-panel-shadow);
  padding: calc(28 * var(--u)) calc(32 * var(--u));
  min-width: 0;
}

.account-section {
  display: none;
}

.account-section.is-active {
  display: block;
}

.account-section__title {
  font-family: var(--font-manrope);
  font-weight: 700;
  font-size: calc(19 * var(--u));
  color: #000000;
  margin: 0 0 calc(20 * var(--u));
}

/* Forms — shared with checkout.html's shipping form */
.account-form {
  display: flex;
  flex-direction: column;
  gap: calc(18 * var(--u));
  max-width: calc(520 * var(--u));
}

.account-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(16 * var(--u));
}

.account-form__row--three {
  grid-template-columns: 1fr 1fr 1fr;
}

.account-field {
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--u));
  font-family: var(--font-manrope);
  font-size: calc(13 * var(--u));
  color: #3a2418;
  min-width: 0;
}

.account-field input {
  height: calc(46 * var(--u));
  padding: 0 calc(14 * var(--u));
  border: 1px solid rgba(58, 36, 24, 0.18);
  border-radius: calc(6 * var(--u));
  font-family: var(--font-dm-sans);
  font-size: calc(14 * var(--u));
  color: #3a2418;
  background: #ffffff;
  box-sizing: border-box;
}

.account-field input:focus {
  outline: none;
  border-color: #8b5e3c;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: calc(46 * var(--u));
  padding: 0 calc(28 * var(--u));
  border-radius: calc(6 * var(--u));
  font-family: var(--font-manrope);
  font-weight: 700;
  font-size: calc(14 * var(--u));
  text-decoration: none;
  cursor: pointer;
  border: 1px solid #3a2418;
  background: #ffffff;
  color: #3a2418;
}

.account-btn:hover {
  background: #f8f6f3;
}

.account-btn--primary {
  background: #3b2416;
  border-color: #3b2416;
  color: #ffffff;
}

.account-btn--primary:hover {
  background: #2d1a10;
}

.account-form__note {
  margin: 0;
  font-family: var(--font-manrope);
  font-size: calc(13 * var(--u));
  color: #10b981;
}

/* Order history */
.account-orders {
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--u));
}

.account-orders__empty {
  font-family: var(--font-dm-sans);
  color: rgba(58, 36, 24, 0.6);
}

.account-order {
  border: 1px solid rgba(58, 36, 24, 0.1);
  border-radius: calc(8 * var(--u));
  overflow: hidden;
}

.account-order__summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: calc(16 * var(--u));
  width: 100%;
  padding: calc(16 * var(--u)) calc(18 * var(--u));
  border: none;
  background: #fbfaf7;
  cursor: pointer;
  text-align: left;
}

.account-order__thumbs {
  display: flex;
}

.account-order__thumb {
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  border-radius: calc(6 * var(--u));
  object-fit: contain;
  background: #f5f0e1;
  border: 2px solid #fbfaf7;
  margin-left: calc(-12 * var(--u));
}

.account-order__thumb:first-child {
  margin-left: 0;
}

.account-order__meta {
  display: flex;
  flex-direction: column;
  gap: calc(2 * var(--u));
  min-width: 0;
}

.account-order__id {
  font-family: var(--font-manrope);
  font-weight: 700;
  font-size: calc(14 * var(--u));
  color: #000000;
}

.account-order__date {
  font-family: var(--font-manrope);
  font-size: calc(12 * var(--u));
  color: rgba(58, 36, 24, 0.6);
}

.account-order__status {
  flex-shrink: 0;
  padding: calc(6 * var(--u)) calc(12 * var(--u));
  border-radius: 999px;
  font-family: var(--font-manrope);
  font-weight: 600;
  font-size: calc(11 * var(--u));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: #9e9e9e;
  white-space: nowrap;
}

.account-order__status--order-placed { background: #9e9e9e; }
.account-order__status--order-confirmed { background: #426b99; }
.account-order__status--processing { background: #c48a2b; }
.account-order__status--dispatched { background: #6b5294; }
.account-order__status--shipped { background: #5a9a9c; }
.account-order__status--delivered { background: #10b981; }

.account-order__total {
  flex-shrink: 0;
  font-family: var(--font-manrope);
  font-weight: 700;
  font-size: calc(14 * var(--u));
  color: #000000;
}

.account-order__chevron {
  flex-shrink: 0;
  color: #8b5e3c;
  transition: transform 0.2s ease;
}

.account-order__summary.is-open .account-order__chevron {
  transform: rotate(180deg);
}

.account-order__details {
  padding: calc(18 * var(--u));
  border-top: 1px solid rgba(58, 36, 24, 0.08);
  background: #ffffff;
}

.account-order__details[hidden] {
  display: none;
}

/* Status stepper */
.account-order__stepper {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: calc(6 * var(--u)) 0 calc(24 * var(--u));
  margin-bottom: calc(12 * var(--u));
}

.account-order__stepper::before {
  content: '';
  position: absolute;
  top: calc(12 * var(--u));
  left: 0;
  right: 0;
  height: 2px;
  background: #ececec;
  z-index: 0;
}

.account-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8 * var(--u));
  flex: 1;
  text-align: center;
}

.account-step__dot {
  width: calc(12 * var(--u));
  height: calc(12 * var(--u));
  border-radius: 50%;
  background: #ececec;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #ececec;
}

.account-step--done .account-step__dot {
  background: #10b981;
  box-shadow: 0 0 0 1px #10b981;
}

.account-step--current .account-step__dot {
  background: #ffffff;
  box-shadow: 0 0 0 2px #10b981;
}

.account-step__label {
  font-family: var(--font-manrope);
  font-size: calc(10.5 * var(--u));
  color: rgba(58, 36, 24, 0.45);
  max-width: calc(80 * var(--u));
}

.account-step--done .account-step__label,
.account-step--current .account-step__label {
  color: #3a2418;
  font-weight: 700;
}

.account-order__cancelled {
  font-family: var(--font-manrope);
  font-size: calc(13 * var(--u));
  color: #b5453a;
  margin: 0 0 calc(12 * var(--u));
}

.account-order__status--cancelled {
  background: #b5453a;
}

.account-order__tracking {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: calc(8 * var(--u));
  font-family: var(--font-manrope);
  font-size: calc(13 * var(--u));
  color: #3a2418;
  background: #f7f3e9;
  border-radius: 4px;
  padding: calc(10 * var(--u)) calc(14 * var(--u));
  margin: 0 0 calc(14 * var(--u));
}

.account-order__tracking-label {
  color: #6f675b;
  font-size: calc(11 * var(--u));
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: block;
  margin-bottom: 2px;
}

.account-order__tracking-btn {
  font-family: var(--font-manrope);
  font-weight: 600;
  font-size: calc(12 * var(--u));
  color: #fff;
  background: #3a2418;
  border-radius: 4px;
  padding: calc(8 * var(--u)) calc(14 * var(--u));
  text-decoration: none;
  white-space: nowrap;
}

.account-order__tracking-btn:hover {
  background: #55341f;
}

.account-order__lines {
  display: flex;
  flex-direction: column;
  gap: calc(8 * var(--u));
}

.account-order__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-manrope);
  font-size: calc(13 * var(--u));
  color: #3a2418;
  padding: calc(6 * var(--u)) 0;
  border-bottom: 1px solid #f3f0ea;
}

.account-order__line:last-child {
  border-bottom: none;
}

@media (max-width: 991px) {
  .account-wrap {
    padding: 20px var(--section-padding-x) 36px;
  }

  .account-title {
    font-size: 24px;
  }

  .account-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .account-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    border-radius: 8px;
  }

  .account-sidebar__link {
    flex: 1 1 auto;
    width: auto;
    text-align: center;
    padding: 12px 14px;
    font-size: 12px;
    border-bottom: none;
    border-right: 1px solid #f0ece4;
  }

  .account-sidebar__link.is-active {
    box-shadow: inset 0 -3px 0 #8b5e3c;
  }

  .account-panel {
    padding: 18px;
    border-radius: 8px;
  }

  .account-form {
    max-width: none;
  }

  .account-form__row,
  .account-form__row--three {
    grid-template-columns: 1fr;
  }

  .account-order__summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "thumbs meta chevron"
      "status status total";
    row-gap: 8px;
    padding: 14px;
  }

  .account-order__thumbs { grid-area: thumbs; }
  .account-order__meta { grid-area: meta; }
  .account-order__chevron { grid-area: chevron; }
  .account-order__status { grid-area: status; justify-self: start; }
  .account-order__total { grid-area: total; justify-self: end; }

  .account-order__stepper {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 4px 0 8px;
  }

  .account-order__stepper::before {
    top: 0;
    bottom: 0;
    left: 5px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .account-step {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
  }

  .account-step__label {
    max-width: none;
  }
}
