:root {
  --primary: #c7c0b9; /* R:199,G:192,B:185 */
  --secondary: #ffffff; /* R:255,G:255,B:255 */
  --tertiary: #ece7e4; /* R:236,G:231,B:228 */
  --text: #333333;
  --muted: #666666;
  --border: #e0e0e0;
  --error: #e74c3c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face { 
  font-family: 'Choco'; 
  src: url('font/Choco-Zp7X3.ttf') format('truetype');
  font-weight: normal; 
  font-style: normal;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--secondary);
  color: var(--text);
  line-height: 1.6;
  scroll-behavior: smooth;
  font-weight: 400;
}

/* ---------- HEADER ---------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s ease;
}

.back:hover {
  color: var(--text);
}

.site-header h1 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.5px;
}

/* ---------- CONTAINER ---------- */
.container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

.invoice-box {
  background: var(--secondary);
  border-radius: 4px;
  padding: 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
}

/* ---------- HEADER SECTION ---------- */
.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: 'Choco', sans-serif;
  font-size: 2rem;
  font-weight: bold;
  gap: 15px;
  align-items: center;
}

.brand img {
  height: 50px;
}

.brand h2 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 4px;
}

.brand small {
  color: var(--muted);
  font-size: 13px;
}

.invoice-meta {
  color: var(--muted);
  text-align: right;
  font-size: 14px;
}

/* ---------- TABLE STYLING ---------- */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.invoice-table th,
.invoice-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 15px;
  vertical-align: middle;
}

.invoice-table thead th {
  background: var(--tertiary);
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.right {
  text-align: right;
}

.grand-total td {
  font-size: 16px;
  font-weight: 500;
  padding-top: 20px;
}

/* ---------- ACTION BUTTONS ---------- */
.invoice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 12px 24px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--tertiary);
}

.btn.primary {
  background: var(--primary);
  color: var(--text);
  border: none;
}

.btn.primary:hover {
  background: #b8b1aa;
}

#free-shipping-message {
  margin-top: 15px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* ---------- REMOVE BUTTON ---------- */
.remove-btn {
  background-color: transparent;
  color: var(--muted);
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: underline;
}

.remove-btn:hover {
  color: var(--error);
}

/* ---------- MOBILE VIEW FIX ---------- */
@media (max-width: 720px) {

.container {
    padding: 0 10px; /* prevent table from touching edges */
    overflow-x: hidden;
  }

   .invoice-box {
    padding: 20px 10px; /* tighter padding for small screens */
  }

  /* Stack header details */
  .invoice-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .invoice-meta {
    text-align: left;
  }

  /* Keep table headers visible and aligned with data */
  .invoice-table {
    border: 1px solid var(--border);
    
  }

  .invoice-table thead {
    display: table-header-group; /* Ensure headers stay visible */
  }

  .invoice-table tr {
    display: table-row;
    border-bottom: 1px solid var(--border);
  }

  .invoice-table th,
  .invoice-table td {
    display: table-cell;
    text-align: left;
    padding: 12px 8px;
    vertical-align: middle;
    box-sizing: border-box;
  }

  /* Fix alignment for product image + text */
  .invoice-table td[data-label="Product"] {
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    gap: 10px;
  }

  .invoice-table td[data-label="Product"] img {
    width: 70px;
    height: auto;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .invoice-table td[data-label="Product"] span,
  .invoice-table td[data-label="Product"] div,
  .invoice-table td[data-label="Product"] p {
    text-align: left;
  }

  /* Ensure other columns don’t misalign */
  .invoice-table td {
    justify-content: flex-start !important;
  }

  /* Buttons in mobile stacked neatly */
  .invoice-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
