html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ── #16: Responsive mobile improvements ── */

/* Make the restaurant card images fill on small screens */
.card-img-top {
  width: 100%;
  object-fit: cover;
}

/* Responsive tables: horizontal scroll on small screens */
.table-responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
  /* Tighter container padding */
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Stack cards full-width */
  .card {
    margin-bottom: 1rem;
  }

  /* Smaller headings on mobile */
  h1, .display-4 {
    font-size: 1.6rem;
  }
  h2 {
    font-size: 1.3rem;
  }
  h4, h5 {
    font-size: 1.1rem;
  }

  /* Button groups: stack vertically on small screens */
  .d-flex.gap-2.flex-wrap {
    flex-direction: column;
  }
  .d-flex.gap-2.flex-wrap .btn {
    width: 100%;
    text-align: center;
  }

  /* Full-width action buttons for restaurant cards */
  .card-body .mt-auto .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }

  /* Footer spacing */
  .footer {
    text-align: center;
    padding: 1rem 0;
  }

  /* KPI card numbers smaller on mobile */
  .card-body h2 {
    font-size: 1.4rem;
  }
  .card-body h3 {
    font-size: 1.2rem;
  }
  .card-body .display-6 {
    font-size: 2rem;
  }

  /* Detail page: stack image above info */
  .row > .col-md-5,
  .row > .col-md-7 {
    margin-bottom: 1rem;
  }

  /* Touch-friendly form controls */
  .form-control, .form-select {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
  }

  /* Better spacing for nav */
  .navbar-brand {
    font-size: 1.1rem;
  }

  /* Restaurant grid: 1 column on phone */
  .col-md-6.col-lg-4,
  .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Tables: make cells more compact */
  .table th, .table td {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
  }

  /* Search bar full width */
  .input-group {
    max-width: 100% !important;
  }

  /* Cuisine filter pills: scrollable row */
  .mb-4 > .btn-sm {
    margin-bottom: 0.25rem;
  }

  /* Breadcrumb smaller */
  .breadcrumb {
    font-size: 0.85rem;
  }

  /* Image thumbnails in edit forms */
  .img-thumbnail {
    max-height: 80px !important;
  }
}

/* Tablet: 2-column layout adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
  .col-md-6.col-lg-4 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Smooth transitions for interactive elements */
.btn, .card, .nav-link {
  transition: all 0.2s ease-in-out;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Better touch targets */
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  .btn-sm {
    min-height: 36px;
    padding: 0.35rem 0.75rem;
  }
  .nav-link {
    padding: 0.75rem 1rem;
  }
}