/* ==========================================================================
   Trim Track — app pages (cart, checkout, dashboard, login, register).
   Loaded alongside css/style.css on interior pages; reuses its design
   tokens (--color-gold, --font-display, .btn, .container, etc.).

   Page rhythm mirrors the homepage: dark banner (photo bg) → light content
   section → dark footer. The banner/nav block below stays dark; everything
   from "PAGE SHELL" down is themed for the light mid-section.
   ========================================================================== */

:root {
  /* Light mid-section palette (everything below the banner). */
  --app-surface: #fbfbfb;    /* page background under the banner */
  --app-card: #ffffff;       /* cards sitting on that surface */
  --app-border: #e6e2d9;     /* warm light border, matches the cream sections */
  --app-text: #1a1a1a;       /* headings / primary text */
  --app-text-soft: #555555;  /* body copy */
  --app-text-muted: #8a8a8a; /* meta / muted */
  --app-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

/* ---------------------------- INTERIOR PAGE NAV --------------------------- */
/* The nav is rendered INSIDE .page-banner (see includes/page-banner.php), so
   it inherits the frosted-glass .navbar styling from style.css and floats on
   the banner's background image exactly like the hero nav — no separate
   solid bar, no seam between header and banner. */

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.navbar__icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--color-white);
  font-size: 17px;
  background: rgba(255, 255, 255, 0.06);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.navbar__icon-link:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--color-gold);
}

.navbar__icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 100px;
  background: var(--color-gold);
  color: #1a1a1a;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar__auth-btn {
  padding: 9px 18px;
  font-size: 13px;
}

/* ---------------------------- INNER PAGE BANNER ---------------------------
   Same background image + headline treatment as the homepage hero, scaled
   down for a secondary page. Typography mirrors .hero__headline /
   .hero__headline--outline in style.css so the two read as one system.
   -------------------------------------------------------------------------- */

.page-banner {
  position: relative;
  overflow: hidden;
  background: #000;
  /* Matches the hero's rhythm: breathing room above the floating nav, then a
     generous gap down to the headline. */
  padding: 40px 0 clamp(56px, 8vw, 96px);
}

.page-banner__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Fades the banner image into the light section below instead of ending on a
   hard edge — the "blend" the hero gets for free by flowing into the stat bar. */
.page-banner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0), rgba(10, 10, 10, 0.85));
  z-index: 1;
  pointer-events: none;
}

.page-banner .navbar {
  /* .navbar already carries the frosted-glass look from style.css; it just
     needs the hero's spacing below it. */
  margin-bottom: clamp(44px, 6vw, 76px);
}

.page-banner__inner {
  position: relative;
  z-index: 2;
}

.page-banner__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-muted);
  font-size: 15px;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.page-banner__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 5.2vw, 68px);
  letter-spacing: -1px;
  line-height: 0.98;
  margin: 0;
  text-transform: uppercase;
  color: var(--color-white);
}

/* Same technique as .hero__headline--outline in style.css: the glyph is
   filled with OPAQUE #000 (matching the dark banner) and the 8-direction
   gold text-shadow sits behind it, so only a 1.5px fringe shows = hollow
   letters. Using `transparent` here instead would let all 8 shadow copies
   show through the glyph and overlap into a solid gold fill. */
.page-banner__title--outline {
  color: #000;
  letter-spacing: clamp(2px, 0.55vw, 7px);
  text-shadow:
    -1.5px -1.5px 0 var(--color-gold),
     1.5px -1.5px 0 var(--color-gold),
    -1.5px  1.5px 0 var(--color-gold),
     1.5px  1.5px 0 var(--color-gold),
     0     -1.5px 0 var(--color-gold),
     0      1.5px 0 var(--color-gold),
    -1.5px  0     0 var(--color-gold),
     1.5px  0     0 var(--color-gold);
}

.page-banner__breadcrumb {
  margin: 20px 0 0;
}

/* Breadcrumb lives inside the dark banner, so it stays light-on-dark. */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 13px;
}

.breadcrumb i {
  font-size: 10px;
}

.breadcrumb a {
  color: var(--color-muted);
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--color-gold);
}

.breadcrumb .is-current {
  color: var(--color-white);
}

/* ---------------------------- PAGE SHELL (light) ---------------------------
   The mid-section between banner and footer.
   -------------------------------------------------------------------------- */

.page-shell {
  background: var(--app-surface);
  color: var(--app-text-soft);
  min-height: 60vh;
  padding: 64px 0 96px;
}

/* Catches headings and inline-styled h3s inside the light section, which
   would otherwise inherit the dark theme's white body colour. */
.page-shell h1,
.page-shell h2,
.page-shell h3,
.page-shell h4,
.page-shell strong {
  color: var(--app-text);
}

.page-shell__head {
  text-align: center;
  margin-bottom: 48px;
}

.page-shell__head .eyebrow {
  justify-content: center;
  display: flex;
}

.page-shell__head .section__title {
  margin-bottom: 8px;
  color: var(--app-text);
}

.page-shell__head p {
  color: var(--app-text-soft);
  font-size: 15px;
}

/* ---------------------------- ALERTS / FORM FEEDBACK ----------------------- */

.alert {
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert--error {
  background: #fdecec;
  border: 1px solid #f3c4c4;
  color: #a32c2c;
}

.alert--success {
  background: #eaf7ee;
  border: 1px solid #bfe3ca;
  color: #24703c;
}

/* ---------------------------- SHARED FORM STYLES --------------------------- */

.form-card {
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--app-shadow);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-field label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--app-text);
}

.form-field input,
.form-field textarea,
.form-field select {
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: var(--app-card);
  color: var(--app-text);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #b0aca4;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(205, 165, 85, 0.18);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Password show/hide toggle — the .password-field wrapper and button are
   injected by initPasswordToggles() in js/main.js. */
.password-field {
  position: relative;
  display: flex;
}

.password-field input {
  width: 100%;
  padding-right: 46px; /* clearance for the toggle button */
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--app-text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle:hover {
  color: var(--color-gold);
  background: rgba(0, 0, 0, 0.05);
}

.password-toggle:focus-visible {
  outline: none;
  color: var(--color-gold);
  box-shadow: 0 0 0 2px rgba(205, 165, 85, 0.35);
}

.form-hint {
  font-size: 13px;
  color: var(--app-text-muted);
  margin-top: -8px;
  margin-bottom: 20px;
}

.form-hint a {
  color: #a8822f; /* gold, darkened for contrast on white */
  font-weight: 700;
}

/* ---------------------------- AUTH (login/register) ------------------------ */

.auth-shell {
  max-width: 440px;
  margin: 0 auto;
}

.auth-shell .form-card .btn {
  width: 100%;
  margin-top: 8px;
}

.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--app-text-muted);
}

.auth-switch a {
  color: #a8822f;
  font-weight: 700;
}

/* ---------------------------- CART ----------------------------------------- */

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 20px;
  align-items: center;
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--app-shadow);
}

.cart-item__photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
}

.cart-item__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 4px;
  color: var(--app-text);
}

.cart-item__price {
  color: #a8822f;
  font-weight: 700;
  font-size: 14px;
}

.cart-item__compare {
  color: var(--app-text-muted);
  text-decoration: line-through;
  font-size: 13px;
  margin-left: 6px;
}

.cart-item__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: 100px;
  overflow: hidden;
}

.qty-stepper button {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  color: var(--app-text);
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.qty-stepper button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.qty-stepper input {
  width: 36px;
  border: none;
  background: transparent;
  color: var(--app-text);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  -moz-appearance: textfield;
}

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-item__remove {
  background: none;
  border: none;
  color: var(--app-text-muted);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.cart-item__remove:hover {
  color: #c0392b;
}

.cart-summary {
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 28px;
  position: sticky;
  top: 24px;
  box-shadow: var(--app-shadow);
}

.cart-summary h3 {
  font-family: var(--font-display);
  margin: 0 0 20px;
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--app-text-soft);
  padding: 10px 0;
  border-bottom: 1px solid var(--app-border);
}

.cart-summary__row--total {
  border-bottom: none;
  padding-top: 16px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  color: var(--app-text);
}

.cart-summary .btn {
  width: 100%;
  margin-top: 20px;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--app-text-muted);
}

.empty-state i {
  font-size: 40px;
  color: #d8d3c8;
  margin-bottom: 16px;
  display: block;
}

.empty-state .btn {
  margin-top: 20px;
}

/* ---------------------------- CHECKOUT -------------------------------------- */

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text-soft);
}

.checkout-summary-item span:first-child {
  color: var(--app-text);
}

.secure-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--app-text-muted);
  margin-top: 16px;
  justify-content: center;
}

.secure-note i {
  color: var(--color-gold);
}

/* ---------------------------- DASHBOARD ------------------------------------- */

.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}

.dashboard-sidebar {
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  box-shadow: var(--app-shadow);
}

.dashboard-sidebar__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-gold);
  color: #1a1a1a;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.dashboard-sidebar h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
}

.dashboard-sidebar p {
  color: var(--app-text-muted);
  font-size: 13px;
  margin: 0 0 20px;
  word-break: break-word;
}

.dashboard-sidebar .btn {
  width: 100%;
}

.dashboard-card {
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--app-shadow);
}

.dashboard-card h3 {
  font-family: var(--font-display);
  margin: 0 0 20px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.orders-table th {
  text-align: left;
  color: var(--app-text-muted);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--app-border);
}

.orders-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text-soft);
}

.orders-table tr:last-child td {
  border-bottom: none;
}

.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

/* Darker text than the dark-theme versions so they stay legible on white. */
.status-pill--pending {
  background: rgba(205, 165, 85, 0.18);
  color: #8a6a1f;
}

.status-pill--paid {
  background: rgba(120, 200, 140, 0.18);
  color: #24703c;
}

.status-pill--cancelled {
  background: rgba(220, 90, 90, 0.15);
  color: #a32c2c;
}

/* ---------------------------- RESPONSIVE ------------------------------------ */

@media (max-width: 900px) {
  .cart-layout,
  .checkout-layout,
  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cart-item {
    grid-template-columns: 72px 1fr;
  }

  .cart-item__actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-card {
    padding: 24px;
  }

  .dashboard-sidebar {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .dashboard-sidebar__avatar {
    margin: 0;
    flex-shrink: 0;
  }

  .orders-table {
    display: block;
    overflow-x: auto;
  }
}

/* ---------------------------- SHIPPING METHODS ----------------------------- */

.ship-methods {
  border: none;
  padding: 0;
  margin: 0 0 20px;
}

.ship-methods legend {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--app-text);
  padding: 0;
  margin-bottom: 10px;
}

.ship-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-card);
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ship-method:last-child {
  margin-bottom: 0;
}

.ship-method:hover:not(.is-disabled) {
  border-color: var(--color-gold);
}

.ship-method:has(input:checked) {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(205, 165, 85, 0.15);
}

.ship-method input {
  accent-color: var(--color-gold);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.ship-method__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.ship-method__name {
  font-weight: 700;
  font-size: 14px;
  color: var(--app-text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ship-method__meta {
  font-size: 12.5px;
  color: var(--app-text-muted);
}

.ship-method__price {
  font-weight: 700;
  font-size: 14px;
  color: var(--app-text);
  flex-shrink: 0;
}

.ship-method__badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  background: rgba(205, 165, 85, 0.18);
  color: #8a6a1f;
}

/* UPS isn't wired up yet — make that unmistakable rather than just inert. */
.ship-method.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background: #f7f5f1;
}

.ship-method.is-disabled .ship-method__price {
  color: var(--app-text-muted);
}
