:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --accent: #111111;
  --text: #1a1a1a;
  --muted: #666666;
  --border: #e6e6e6;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: "Poppins", sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }

.mobile-container { padding: 16px; padding-bottom: 100px; max-width: 480px; margin: 0 auto; }

header { text-align: center; margin-bottom: 20px; padding-top: 12px; }
header h1 { font-size: 21px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
header p  { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* USER BAR */
.user-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; margin-bottom: 8px; border-bottom: 1px solid var(--border); gap: 8px;
}
.user-bar span { font-size: 12px; color: var(--muted); flex: 1; }
.user-bar-actions { display: flex; gap: 8px; align-items: center; }

/* CARD */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 8px; }

/* FORM */
.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-size: 11px; margin-bottom: 5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
input, textarea { width: 100%; padding: 12px 13px; font-size: 15px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; transition: border .2s, background .2s; font-family: "Poppins", sans-serif; }
input:focus, textarea:focus { outline: none; border-color: #111; background: #fff; }
.row { display: flex; gap: 10px; }
.row .form-group { flex: 1; }

/* BUTTONS */
button { width: 100%; padding: 14px; font-size: 14px; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; transition: all .2s; font-family: "Poppins", sans-serif; display: flex; align-items: center; justify-content: center; gap: 7px; }
.btn-outline { background: transparent; border: 1.5px solid #111; color: #111; margin-bottom: 10px; }
.btn-outline:active { background: #f0f0f0; }
.btn-solid   { background: #111; color: #fff; margin-bottom: 10px; }
.btn-solid:active { background: #333; }
.btn-danger  { background: #e53e3e; color: #fff; }
.btn-danger:active { background: #c53030; }
.btn-small   { padding: 7px 11px; font-size: 11px; width: auto; border-radius: 6px; margin-bottom: 0; }
.btn-whatsapp { background: #25D366; color: #fff; margin-bottom: 10px; }
.btn-whatsapp:active { background: #1ebe5a; }
.btn-contact  { background: #007AFF; color: #fff; margin-bottom: 10px; }
.btn-contact:active  { background: #0062cc; }

/* PHOTO UPLOAD */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photo-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .del-photo { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.photo-add-btn { aspect-ratio: 1; border-radius: 8px; border: 1.5px dashed #ccc; background: #fafafa; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; color: #999; font-size: 11px; font-weight: 500; }
.photo-add-btn i { font-size: 22px; }

/* CART */
.item-list { list-style: none; }
.item-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.item-details h4 { font-size: 13px; font-weight: 500; }
.item-details p  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.item-price { font-weight: 600; font-size: 13px; white-space: nowrap; margin-left: 8px; }
#empty-state { text-align: center; color: var(--muted); font-size: 13px; padding: 22px 0; }

/* STICKY FOOTER */
.sticky-bottom { position: fixed; bottom: 0; left: 0; width: 100%; padding: 11px 16px; background: #fff; border-top: 1px solid var(--border); z-index: 100; }

/* PREVIEW */
.preview-summary { text-align: center; padding: 16px 0; }
.preview-summary h2 { font-size: 19px; margin-bottom: 5px; color: #27ae60; }
.preview-summary > p { color: var(--muted); font-size: 12px; margin-bottom: 18px; }
.receipt-card { background: #fff; border: 1px dashed #ccc; padding: 16px; border-radius: 8px; text-align: left; margin-bottom: 20px; }
.receipt-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.receipt-row:last-child { border-bottom: none; }
.receipt-row.total { font-size: 16px; font-weight: 700; border-top: 2px solid #111; border-bottom: none; margin-top: 6px; padding-top: 10px; }

/* LOGIN */
.login-wrapper { display: flex; flex-direction: column; justify-content: center; min-height: 90vh; }

/* HISTORY */
.history-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.history-item:last-child { border-bottom: none; }
.history-item-info h4 { font-size: 13px; font-weight: 600; }
.history-item-info p  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.history-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.history-item-amount { font-size: 13px; font-weight: 700; white-space: nowrap; }
.history-actions { display: flex; gap: 5px; align-items: center; }
.btn-wa-small { background: #25D366; color: #fff; border: none; border-radius: 6px; padding: 6px 9px; font-size: 11px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap; font-family: "Poppins",sans-serif; width: auto; margin-bottom: 0; }
.btn-wa-small:active { background: #1ebe5a; }

/* History photos */
.history-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.history-photo-thumb { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); cursor: pointer; }

/* Photo lightbox */
.lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 9999; align-items: center; justify-content: center; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 95vw; max-height: 90vh; border-radius: 8px; object-fit: contain; }
.lightbox-close { position: absolute; top: 16px; right: 16px; color: #fff; font-size: 28px; cursor: pointer; background: none; border: none; width: auto; padding: 0; }

#history-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0; }

/* PDF (offscreen) */
#pdf-hide-container { position: fixed; left: 200vw; top: 0; z-index: -1000; }
#pdf-template { width: 800px; min-height: 1122px; background: #fff; font-family: "Poppins",sans-serif; color: #1a1a1a; position: relative; padding: 70px 60px; box-sizing: border-box; }
.pdf-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 50px; }
.pdf-logo { width: 160px; height: auto; }
.pdf-title-area { text-align: right; }
.pdf-title { font-size: 42px; font-weight: 700; letter-spacing: 2px; line-height: 1; margin-bottom: 8px; color: #111; }
.pdf-no { font-size: 14px; font-weight: 500; color: #666; margin-top: 4px; }
.pdf-no strong { color: #111; }
.pdf-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 50px; border-top: 1px solid #eaeaea; border-bottom: 1px solid #eaeaea; padding: 24px 0; }
.pdf-block h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #888; margin-bottom: 10px; font-weight: 600; }
.pdf-block p { font-size: 14px; line-height: 1.6; margin: 0; color: #222; }
.pdf-block strong { font-weight: 600; font-size: 15px; color: #111; display: block; margin-bottom: 4px; }
.pdf-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; }
.pdf-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; color: #666; padding: 14px 12px; border-bottom: 2px solid #111; text-align: left; }
.pdf-table td { font-size: 14px; padding: 16px 12px; border-bottom: 1px solid #eaeaea; color: #333; font-weight: 500; }
.pdf-table th.center, .pdf-table td.center { text-align: center; }
.pdf-table th.right,  .pdf-table td.right  { text-align: right; }
.pdf-summary-wrapper { display: flex; justify-content: flex-end; margin-bottom: 50px; }
.pdf-summary { width: 320px; }
.pdf-summary-row { display: flex; justify-content: space-between; padding: 10px 12px; font-size: 14px; color: #555; border-bottom: 1px solid #f5f5f5; }
.pdf-summary-row.total { background: #f9f9f9; border-radius: 8px; padding: 14px 16px; margin-top: 10px; font-size: 17px; font-weight: 700; color: #111; border-bottom: none; }
.pdf-footer-content { position: absolute; bottom: 60px; left: 60px; right: 60px; border-top: 1px solid #eaeaea; padding-top: 24px; display: flex; justify-content: space-between; align-items: flex-end; }
.pdf-notes { font-size: 12px; color: #666; line-height: 1.6; max-width: 60%; }
.pdf-notes strong { color: #111; font-weight: 600; }
.pdf-love { font-size: 18px; font-weight: 500; color: #aaa; letter-spacing: 2px; text-transform: uppercase; }
.pdf-love span { color: #ff4d4d; }
.currency { font-family: sans-serif; }

/* DESKTOP BLOCKER */
.desktop-blocker { display: none; }
@media screen and (min-width: 768px) {
  .mobile-container { display: none; }
  .desktop-blocker { display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #111; color: #fff; z-index: 9999; justify-content: center; align-items: center; flex-direction: column; text-align: center; padding: 20px; }
  .desktop-blocker h1 { font-size: 24px; margin-bottom: 10px; letter-spacing: 2px; text-transform: uppercase; }
  .desktop-blocker p { font-size: 14px; color: #888; }
}
