/* =========================================================
   RESPONSIVE TABLES ON MOBILE
   ========================================================= */

@media (max-width: 767px) {
  /* Make tables horizontally scrollable */
  .et_pb_text table,
  .et_pb_module table,
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
  
  /* Prevent text wrapping in cells */
  table td,
  table th {
    white-space: nowrap;
  }
  
  /* Reduce table font size on mobile */
  table {
    font-size: 0.8rem !important;
  }
  
  /* Reduce cell padding for better fit */
  table td,
  table th {
    padding: 6px 8px !important;
    font-size: 0.8rem !important;
  }
  
  /* Make first column sticky (for product dimension reference) */
  table thead th:first-child,
  table tbody td:first-child {
    position: sticky;
    left: 0;
    background-color: #fff;
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
  }
  
  /* Keep header background for sticky first column */
  table thead th:first-child {
    background-color: var(--color-secondary, #34495e);
    color: #fff;
  }
  
  /* Add subtle scroll indicator */
  .et_pb_text:has(table)::after {
    content: "⟵ Scrolla sidled för att se hela tabellen ⟶";
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-primary, #e67e22);
    padding: 8px 0;
    font-style: italic;
    margin-top: -10px;
  }
}