/* === responsive_fix.css ===
   LMS Celebrity Autographs v1.4.1
   Milestone 3 – Section 4: Responsive Design & Mobile Optimisation
   Overlay styles for tablet/mobile portrait modes.
*/

/* --- Global defaults --- */
body {
  overflow-x: hidden !important;
  font-size: 1rem;
  line-height: 1.4;
  padding: 0 8px;
  max-width: 100vw;
}

/* --- Tablet & below --- */
@media (max-width: 1200px) {
  /* Ensure header and footer fit within viewport */
  header, footer {
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Adjust table/grid for responsive display */


  /* apply responsive table behaviour everywhere EXCEPT catalogue */
  table:not(.catalogue-table) {
    width: 100% !important;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  th, td {
    padding: 8px 6px !important;
    font-size: 0.9em;
  }

  th {
    background-color: #2C146C;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  /* Make action buttons finger-friendly */
  button {
    font-size: 1em;
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
  }

  /* Pagination bar adjustments */
  .pagination-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .pagination-bar select {
    font-size: 1em;
    padding: 6px;
  }

  /* Ensure modals scale neatly */
  .modal {
    max-width: 95vw !important;
    max-height: 90vh !important;
  }

  /* Grid container (if exists) */
  .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Text readability on smaller screens */
  h1, h2, h3 {
    font-size: 1.2em;
  }
}

/* --- Mobile portrait (<768px) --- */
@media (max-width: 768px) {
  body {
    font-size: 0.95rem;
  }

  th, td {
    padding: 6px 4px !important;
  }

  button {
    padding: 6px 10px;
    font-size: 0.9em;
  }

  .pagination-bar {
    flex-direction: column;
    gap: 4px;
  }
}

/* --- Tap target accessibility fixes (v3) --- */

/* Modal close buttons only */
.details-close,
.close {
  position: relative !important;
  display: inline-flex !important;
  justify-content: center;
  align-items: center;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  line-height: 1 !important;
  text-align: center;
  font-size: 1.4em !important;
  border-radius: 50%;
  touch-action: manipulation;
  background-color: transparent;
  cursor: pointer;
  z-index: 999;
}

/* Keep the header Cart button styled normally */
header button[onclick="toggleCart()"] {
  width: auto !important;
  height: auto !important;
  min-width: unset !important;
  min-height: unset !important;
  border-radius: 6px;
  font-size: 1em !important;
  line-height: normal !important;
  padding: 8px 16px !important;
}


.details-close:hover,
.close:hover {
  background-color: rgba(44, 20, 108, 0.1);
}