/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #22c55e;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
}

.nav a {
  margin-left: 1.5rem;
  color: var(--text);
}

/* Main Content */
main {
  padding: 2rem 0;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

h2 {
  font-size: 1.25rem;
  margin: 1.5rem 0 1rem;
  color: var(--text);
}

h3 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 1.5rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  font-size: 0.875rem;
}

.breadcrumb li:not(:last-child)::after {
  content: '>';
  margin: 0 0.5rem;
  color: var(--text-light);
}

.breadcrumb span {
  color: var(--text-light);
}

/* ZIP Display Widget - Minimal White */
.zip-display-widget {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  margin: 1.5rem 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.zip-location-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.zip-barangay {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.zip-separator {
  color: #ddd;
}

.zip-city-country {
  font-size: 0.85rem;
  color: #888;
}

.zip-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.zip-section {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.zip-label {
  font-size: 0.7rem;
  color: #aaa;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.zip-code {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.zip-number {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.zip-number-multi {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.zip-note {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #888;
}

.zip-actions {
  display: flex;
  gap: 6px;
}

.zip-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 100px;
  border: 1px solid #eee;
  background: #fff;
  color: #666;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.zip-btn:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.zip-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.zip-btn.primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.zip-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn-copy {
  background: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.btn-copy:hover {
  background: var(--bg-white);
  border-color: var(--primary);
}

.btn-copy.copied {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-tool {
  background: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.375rem 0.625rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-tool:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: var(--radius);
  max-width: 320px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  text-align: center;
}

#qr-code {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

#qr-code img,
#qr-code canvas {
  max-width: 200px;
  height: auto;
}

.qr-hint {
  color: var(--text-light);
  font-size: 0.875rem;
  margin: 0;
}

/* GPS Coordinates Widget */
.gps-widget {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
}

.gps-widget h2 {
  margin: 0 0 1rem 0;
}

.gps-coords {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.coord-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.coord-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.coord-label {
  font-weight: 500;
  min-width: 80px;
  color: var(--text-light);
}

.coord-value {
  font-family: monospace;
  font-size: 1.1rem;
  flex: 1;
}

.btn-copy-small {
  background: var(--bg-white);
  border: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-light);
}

.btn-copy-small:hover {
  background: var(--border);
}

.gps-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle::after {
  content: ' ▼';
  font-size: 0.7rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 150px;
  display: none;
  z-index: 100;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.dropdown-menu a:last-child {
  border-bottom: none;
}

.dropdown-menu a:hover {
  background: var(--bg);
}

/* Search Widget */
.search-widget {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
}

.search-widget h2 {
  margin: 0 0 1rem 0;
}

.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.search-results.show {
  display: block;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg);
}

.search-result-name {
  font-weight: 500;
}

.search-result-location {
  font-size: 0.875rem;
  color: var(--text-light);
}

.search-result-zip {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-light);
}

/* Tables */
.details-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.details-table th,
.details-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.details-table th {
  width: 150px;
  background: var(--bg);
  font-weight: 600;
}

.location-desc {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

.location-desc strong {
  color: var(--primary);
}

/* Notice */
.notice {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
}

.notice-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.barangays-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.barangays-table th,
.barangays-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.barangays-table th {
  background: var(--bg);
}

/* Lists */
.regions-list,
.provinces-list,
.cities-list,
.barangay-links,
.zip-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.regions-list li a,
.provinces-list li a,
.cities-list li a {
  display: block;
  padding: 1rem;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.regions-list li a:hover,
.provinces-list li a:hover,
.cities-list li a:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.regions-list strong,
.provinces-list strong,
.cities-list strong {
  display: block;
  color: var(--text);
}

.designation,
.count,
.type {
  font-size: 0.875rem;
  color: var(--text-light);
}

.barangay-links li {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-white);
  border-radius: var(--radius);
}

.barangay-links .zip {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Nearby Section */
.nearby-list {
  list-style: none;
}

.nearby-list li {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-white);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.nearby-list .distance {
  color: var(--text-light);
  font-size: 0.875rem;
}

.nearby-list .zip {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-left: auto;
}

/* Address Form Widget */
.address-form-widget {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group.readonly .readonly-value {
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius);
  color: var(--text-light);
}

.formatted-address {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
}

.formatted-address pre {
  white-space: pre-wrap;
  font-family: inherit;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

/* FAQ Section */
.faq-section {
  margin-top: 2rem;
}

.faq-item {
  background: var(--bg-white);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.faq-item h3 {
  margin: 0 0 0.5rem 0;
}

.faq-item p {
  color: var(--text-light);
  margin: 0;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 2rem;
  background: var(--bg-white);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2rem;
}

.hero p {
  margin-top: 0.5rem;
}

/* Footer */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
}

.footer-links a {
  color: var(--text-light);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

.footer-copyright {
  margin: 0;
}

/* Print Styles */
@media print {
  @page {
    margin: 10mm;
  }

  /* Hide page elements */
  .header,
  .footer,
  .breadcrumb,
  .zip-display-widget,
  .location-details,
  .gps-widget,
  .search-widget,
  .address-form-widget,
  .download-widget,
  .nearby-section,
  .other-barangays,
  .faq-section,
  .modal,
  main > h1 {
    display: none !important;
  }

  body, main.container {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Show only print label */
  .print-label-container {
    display: block !important;
  }

  .print-label {
    border: 2px dashed #000;
    padding: 2rem;
    margin: 0 auto;
    max-width: 400px;
  }

  .label-recipient {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.5rem;
  }

  .label-address {
    font-size: 1.1rem;
    line-height: 2;
    text-align: center;
  }
}

/* Download Widget */
.download-widget {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
}

.download-widget h2 {
  margin: 0 0 1rem 0;
}

.download-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.download-actions .btn {
  flex: 1;
  min-width: 140px;
  text-align: center;
}

/* OG Image Widget */
.og-image-widget {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
}

.og-image-widget h2 {
  margin: 0 0 0.25rem 0;
}

.og-image-desc {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  color: var(--text-light);
}

.og-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.og-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.og-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.og-card-preview {
  border-radius: 6px;
  overflow: hidden;
  background: #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.og-card-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.og-card-actions {
  display: flex;
  gap: 0.375rem;
}

.og-btn {
  flex: 1;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-white);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.og-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.og-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

@media (max-width: 500px) {
  .og-cards {
    grid-template-columns: 1fr;
  }
}

.og-image-hint {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin: 0;
}

@media (max-width: 600px) {
  .og-image-content {
    flex-direction: column;
  }

  .og-image-left {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .og-image-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .og-image-actions .btn {
    flex: 1;
    min-width: 100px;
  }
}

/* Business Card Widget */
.business-card-widget {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
}

.business-card-widget h2 {
  margin: 0 0 0.25rem 0;
}

.business-card-widget .widget-desc {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  color: var(--text-light);
}

.business-card-content {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.business-card-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.business-card-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.business-card-form .form-row-2col {
  flex-direction: row;
  gap: 0.75rem;
}

.business-card-form .form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.business-card-form label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.business-card-form label .optional {
  font-weight: 400;
  text-transform: none;
  opacity: 0.7;
}

.business-card-form input,
.business-card-form textarea {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: inherit;
}

.business-card-form textarea {
  resize: vertical;
  min-height: 60px;
}

.business-card-form input:focus,
.business-card-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.theme-options {
  display: flex;
  gap: 0.375rem;
}

.theme-btn {
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--border);
  background: var(--bg-light);
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-btn:hover {
  border-color: var(--primary);
}

.theme-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.business-card-preview {
  flex: 0 0 auto;
}

.business-card-preview canvas {
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  max-width: 100%;
  height: auto;
}

.business-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 600px) {
  .business-card-content {
    flex-direction: column;
  }

  .business-card-form .form-row-2col {
    flex-direction: column;
    gap: 0.75rem;
  }

  .business-card-preview canvas {
    width: 100%;
    height: auto;
  }

  .business-card-actions {
    flex-direction: column;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .zip-display-widget {
    padding: 16px 18px;
  }

  .zip-location-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .zip-separator {
    display: none;
  }

  .zip-barangay {
    font-size: 0.95rem;
    flex: 1 1 100%;
  }

  .zip-city-country {
    font-size: 0.8rem;
  }

  .zip-main-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .zip-code {
    font-size: 1.75rem;
  }

  .zip-actions {
    width: 100%;
  }

  .zip-btn {
    flex: 1;
    padding: 0 12px;
    font-size: 0.7rem;
  }

  .details-table th {
    width: 100px;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* Tools Navigation */
.tools-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  margin: 1rem -1rem 1.5rem;
  padding: 0 1rem;
}

.tools-nav-inner {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tools-nav-inner::-webkit-scrollbar {
  display: none;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  white-space: nowrap;
  transition: all 0.2s ease;
  text-decoration: none;
}

.tool-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  text-decoration: none;
}

.tool-link.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

/* Tools nav shadow when scrolled */
.tools-nav.scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (max-width: 600px) {
  .tools-nav {
    margin: 1rem -1rem 1rem;
  }

  .tool-link {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* Parcel Label Widget */
.parcel-label-widget {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.parcel-label-content {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.parcel-label-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-section {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
}

.form-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.btn-save-sender,
.btn-swap {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-white);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-save-sender:hover,
.btn-swap:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-save-sender.saved {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.parcel-label-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.parcel-label-form .form-row:last-child {
  margin-bottom: 0;
}

.parcel-label-form .form-row-2col {
  flex-direction: row;
  gap: 0.75rem;
}

.parcel-label-form .form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.parcel-label-form label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-light);
}

.parcel-label-form input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
}

.parcel-label-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.parcel-label-form .zip-input {
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.1em;
}

/* Tag Options */
.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag-checkbox {
  cursor: pointer;
}

.tag-checkbox input {
  display: none;
}

.tag-label {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  transition: all 0.2s;
}

.tag-checkbox input:checked + .tag-label.tag-cod {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.tag-checkbox input:checked + .tag-label.tag-fragile {
  background: #fce7f3;
  border-color: #ec4899;
  color: #be185d;
}

.tag-checkbox input:checked + .tag-label.tag-urgent {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

.tag-checkbox input:checked + .tag-label.tag-perishable {
  background: #d1fae5;
  border-color: #10b981;
  color: #047857;
}

.cod-amount-row {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cod-amount-row label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-light);
}

.cod-amount-row input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  background: #fffbeb;
}

/* Option Row */
.option-row {
  margin-bottom: 0.75rem;
}

.option-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.option-checkbox input {
  width: 16px;
  height: 16px;
}

/* Preview */
.parcel-label-preview {
  flex: 0 0 auto;
}

.parcel-label-preview canvas {
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 100%;
  height: auto;
}

/* Actions */
.parcel-label-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 800px) {
  .parcel-label-content {
    flex-direction: column;
  }

  .parcel-label-preview {
    display: flex;
    justify-content: center;
  }

  .parcel-label-preview canvas {
    max-width: 300px;
  }

  .parcel-label-form .form-row-2col {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 500px) {
  .parcel-label-actions {
    flex-direction: column;
  }

  .parcel-label-actions .btn {
    width: 100%;
  }
}

/* ZIP Code Page Styles */
.zip-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.zip-map-section {
  margin-bottom: 2rem;
}

.zip-map-wrapper {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.zip-map-iframe {
  width: 100%;
  height: 350px;
  border: none;
  display: block;
}

/* Region Page Styles */
.region-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Province Page Styles */
.province-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Province Map Section */
.province-map-section {
  margin-bottom: 2rem;
}

.province-map-wrapper {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 450px;
}

/* Map Sidebar */
.map-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.map-sidebar-header {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-search {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--bg-secondary);
}

.sidebar-search:focus {
  outline: none;
  border-color: var(--primary);
}

.map-cities-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.map-city-item {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.map-city-item:hover {
  background: var(--bg-secondary);
}

.map-city-item.active {
  background: var(--primary);
  color: white;
}

.map-city-item.active .city-item-meta {
  color: rgba(255,255,255,0.8);
}

.city-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.city-item-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.city-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Map Main Area */
.map-main {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

.province-map-iframe {
  width: 100%;
  height: 100%;
  border: none;
  flex: 1;
}

.map-selected-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  gap: 1rem;
}

.selected-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.selected-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.selected-zip {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.selected-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 4px;
  text-decoration: none;
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.nav-btn:hover {
  background: var(--border);
}

.nav-btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.nav-btn-primary:hover {
  background: var(--primary-dark);
}

/* Section Header with Actions */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin-bottom: 0;
}

.download-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-download:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-download svg {
  flex-shrink: 0;
}

/* Cities Table */
.cities-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cities-table th,
.cities-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cities-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cities-table tbody tr:hover {
  background: var(--bg-secondary);
}

.cities-table a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.cities-table a:hover {
  text-decoration: underline;
}

/* Province Map Responsive */
@media (max-width: 768px) {
  .province-map-wrapper {
    flex-direction: column;
    height: auto;
  }

  .map-sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .map-main {
    height: 300px;
  }

  .map-selected-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .selected-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .cities-table th:nth-child(2),
  .cities-table td:nth-child(2) {
    display: none;
  }
}

/* ==================== */
/* Home Page Styles     */
/* ==================== */

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: white;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: white;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
}

/* Hero Search */
.hero-search {
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-search-form {
  display: flex;
  gap: 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-search-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  font-size: 1rem;
  outline: none;
}

.hero-search-btn {
  padding: 1rem 2rem;
  background: var(--primary);
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search-btn:hover {
  background: #1e40af;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Quick Tools Section */
.quick-tools {
  margin-bottom: 2rem;
}

.quick-tools-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

.quick-lookup-card,
.featured-cities-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.quick-lookup-card h2,
.featured-cities-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.quick-lookup-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.zip-lookup-form {
  display: flex;
  gap: 0.5rem;
}

.zip-input-wrapper {
  flex: 1;
  position: relative;
}

.zip-input-wrapper input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.1em;
}

.zip-autocomplete {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
}

.zip-ac-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.zip-ac-item:last-child {
  border-bottom: none;
}

.zip-ac-item:hover,
.zip-ac-item.selected {
  background: var(--bg);
}

.zip-ac-code {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 50px;
}

.zip-ac-location {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-lookup {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-lookup:hover {
  background: #1e40af;
}

/* Featured Cities */
.featured-cities-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.featured-city-link {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.featured-city-link:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.featured-city-link .city-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
}

.featured-city-link .city-zip {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 500;
}

/* Regions Grid */
.regions-section {
  margin-bottom: 2rem;
}

.regions-section h2 {
  margin-bottom: 1rem;
}

.regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.region-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}

.region-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.region-designation {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
}

.region-name {
  font-weight: 600;
  color: var(--text);
  margin: 0.25rem 0;
}

.region-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Map Section */
.map-section {
  margin-bottom: 2rem;
}

.map-section h2 {
  margin-bottom: 1rem;
}

.home-map-wrapper {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.home-map-iframe {
  width: 100%;
  height: 400px;
  border: none;
  display: block;
}

.map-overlay-text {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
}

/* Popular ZIP Codes */
.popular-section {
  margin-bottom: 2rem;
}

.popular-section h2 {
  margin-bottom: 1rem;
}

.zip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.zip-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s;
}

.zip-card:hover {
  border-color: var(--primary);
}

.zip-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.zip-location {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* How It Works */
.how-it-works {
  margin-bottom: 2rem;
}

.how-it-works h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.step-card {
  text-align: center;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.step-number {
  width: 48px;
  height: 48px;
  line-height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.step-card h3 {
  margin-bottom: 0.5rem;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Download Section */
.download-section {
  margin-bottom: 2rem;
}

.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
}

.download-info h2 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.download-info p {
  color: var(--text-muted);
  margin: 0;
}

.btn-download-all {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-download-all:hover {
  background: #1e40af;
}

.btn-download-all svg {
  flex-shrink: 0;
}

/* Home Page Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-stats {
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .quick-tools-grid {
    grid-template-columns: 1fr;
  }

  .featured-cities-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .regions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .download-card {
    flex-direction: column;
    text-align: center;
  }

  .home-map-iframe {
    height: 300px;
  }
}

/* ==================== */
/* Static Pages Styles  */
/* ==================== */

.static-page {
  max-width: 800px;
  margin: 0 auto;
}

.static-page h1 {
  margin-bottom: 0.5rem;
}

.static-page .last-updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.static-content {
  line-height: 1.8;
}

.static-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.static-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.static-content p {
  margin-bottom: 1rem;
}

.static-content ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.static-content li {
  margin-bottom: 0.5rem;
}

.static-content a {
  color: var(--primary);
  text-decoration: underline;
}

.static-content a:hover {
  text-decoration: none;
}

/* Contact Page */
.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.contact-item {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.contact-item h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.contact-item p {
  margin-bottom: 0.25rem;
}

.contact-item .text-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* FAQ Section */
.faq-section {
  margin-top: 1.5rem;
}

.faq-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.faq-item p {
  margin-bottom: 0;
  color: var(--text-muted);
}

/**/