/* ===== FONT FACE ===== */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ===== CSS VARIABLES ===== */
:root {
  --line-thickness: 2px;  /* Standard thickness for all borders, underlines, dividers */
  --margin-outer: 18px;   /* Matches shop and website repos */
  --gutter: 14px;         /* Column gutter width */
  --action-color: #06c;     /* Action/button text color */
  --action-hover: #004099;  /* Action/button hover color */
}

/* ===== RESET ===== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #fff;
}

body {
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  color: #000;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-feature-settings: 'liga' 1, 'calt' 1;
  font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%; /* Prevent auto text sizing on orientation change */
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: 1.3;
}

/* ===== TYPOGRAPHY ===== */
/* Ensure all text elements have consistent line-height */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
}

p, div, span, label, a, li, td, th {
  line-height: 1.3;
}

/* Removed: Now using border-bottom system for all underlines (pixel-perfect consistency) */

/* ===== BUTTONS ===== */
/* Text-only style — colored text, no border/background */
button, .btn {
  background: transparent;
  color: var(--action-color, #06c);
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: normal;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.2s ease;
}

button:disabled, .btn:disabled {
  color: #bdbdbd;
  cursor: not-allowed;
}

button:focus, .btn:focus {
  outline: none;
}

button:active, .btn:active {
  color: var(--action-hover, #004099);
}

@media (hover: hover) {
  button:hover, .btn:hover {
    color: var(--action-hover, #004099);
  }

  button:disabled:hover, .btn:disabled:hover {
    color: #bdbdbd;
  }
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.pagination span {
  color: #000;
  font-size: inherit;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  body {
    font-size: 1.125rem; /* slightly smaller on mobile */
  }
}

/* ===== UNDERLINE SYSTEM ===== */
/* Centralized underline patterns - see design-standards.md for documentation */

/* Base underlined class - apply to any element that needs text-width underline */
.underlined {
  display: inline-block;
  width: fit-content;
  position: relative;
}

.underlined::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.05em;
  height: var(--line-thickness);
  background: currentColor;
}

/* No underline utility - removes ::after underline from inherited styles */
.no-underline::after {
  display: none;
}

/* Page-specific underlined elements (centralized here instead of inline styles) */

/* Verify page - link styling */
.verify-container a {
  display: inline-block;
  width: fit-content;
  position: relative;
}

.verify-container a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.05em;
  height: var(--line-thickness);
  background: currentColor;
}

/* Dashboard - navigation tabs with show-on-hover underline */
nav button {
  position: relative;
  display: inline-block;
  width: fit-content;
}

nav button::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.05em;
  height: var(--line-thickness);
  background: transparent;  /* Hidden by default */
}

nav button.active::after {
  background: #000;  /* Show underline when active */
}

nav button:active::after {
  background: #000;  /* Show underline when clicked */
}

@media (hover: hover) {
  nav button:hover::after {
    background: #000;  /* Show underline on hover */
  }
}


/* ===== UTILITY CLASSES ===== */
/* Visibility utilities for systematic show/hide control */
.show {
  display: block;
}

.hide {
  display: none;
}

/* ===== DASHBOARD TABLE STYLES ===== */
/* Clickable order rows */
.order-row {
  cursor: pointer;
}

.order-row:hover {
  background: #f5f5f5;
}

.order-row.expanded {
  background: #f5f5f5;
}

/* Exclude detail rows from table hover effects */
tr:active:not(.order-detail-row) {
  background: #f9f9f9;
}

@media (hover: hover) {
  tr:hover:not(.order-detail-row) {
    background: #f9f9f9;
  }
}

/* Detail row visibility */
.order-detail-row {
  display: none;
}

.order-detail-row.show {
  display: table-row;
}

/* Order detail panel */
.order-detail {
  background: #fff;
  padding: 1.5rem 0;
  display: none;
  font-size: inherit;
  border-top: var(--line-thickness) solid #808080;
}

.order-detail.show {
  display: block;
}

/* Remove padding from the table cell containing detail panel */
.order-detail-row td {
  padding: 0;
}

/* Detail label styling */
.detail-label {
  color: #000;
  font-size: inherit;
  min-width: 5rem;
}

/* Section dividers within columns */
.detail-section {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: var(--line-thickness) solid #808080;
}

.detail-section:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

/* Arrow indicator for expand/collapse */
.expand-arrow {
  transition: transform 0.2s ease;
  display: inline-block;
}

.order-row.expanded .expand-arrow {
  transform: rotate(180deg);
}

/* ===== GRID SYSTEM ===== */
/* 6-column grid with 14px gutters - underlying structure */
.grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gutter);
}

/* 2-column grid (3+3 of underlying 6-column) for content sections */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
}

/* Span classes for grid children */
.col-span-3 { grid-column: span 3; }
.col-span-6 { grid-column: span 6; }

/* ===== ORDER DETAIL TWO-COLUMN LAYOUT ===== */
/* Wrapper for 2-column order detail sections */
.detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
}

/* Each column in the detail view */
.detail-column {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Key-value pair layout within columns */
.detail-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.detail-row:last-child {
  margin-bottom: 0;
}

/* Mobile: stack columns vertically */
@media (max-width: 768px) {
  .detail-columns {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Actions area (no border - visually part of data above) */
.detail-actions {
  padding-top: 1rem;
  margin-top: 1rem;
}

/* ===== EMAIL RESEND STYLES ===== */
/* Timestamp display for email sent info */
.email-sent-info {
  color: #666;
  margin-left: 1rem;
}

/* Stack timestamp below button in actions area (scoped to avoid breaking refund dropdown) */
.detail-actions .email-sent-info {
  display: block;
  margin-left: 0;
  margin-top: 0.25rem;
}

/* Dropdown affordance triangle on refund resend button */
.resend-refund-btn::after {
  content: ' \25BE';
}

.resend-refund-btn:disabled::after {
  display: none;
}

/* Refund resend dropdown */
.refund-dropdown {
  margin-top: 0.5rem;
}

.refund-option {
  padding: 0.25rem 0;
  cursor: pointer;
  color: var(--action-color, #06c);
  transition: color 0.2s ease;
}

.refund-option:active {
  color: var(--action-hover, #004099);
}

@media (hover: hover) {
  .refund-option:hover {
    color: var(--action-hover, #004099);
  }
}
