/* ==========================================================================
   Shared Mobile-Responsive Styles
   Used by: quote-list, image-list, and other views with responsive tables/cards
   ========================================================================== */

/* --- Responsive Table --- */
table.shared-table,
table.shared-table th,
table.shared-table td {
  border: 1px solid black;
  border-collapse: collapse;
  padding: 5px;
}

.table-responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  table.shared-table thead {
    display: none;
  }

  table.shared-table,
  table.shared-table tbody,
  table.shared-table tr,
  table.shared-table td {
    display: block;
    width: 100%;
  }

  table.shared-table {
    border: none;
  }

  table.shared-table tr {
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px;
    background: #fafafa;
  }

  table.shared-table td {
    border: none;
    padding: 4px 6px;
    text-align: left;
    position: relative;
    padding-left: 35%;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  table.shared-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 6px;
    width: 30%;
    font-weight: bold;
    white-space: nowrap;
    font-size: 0.85em;
  }

  table.shared-table td:empty {
    display: none;
  }
}

/* --- Image List: Desktop Table --- */
.image-list-table {
  width: 100%;
  border-collapse: collapse;
}

.image-list-table th,
.image-list-table td {
  border: 1px solid #dee2e6;
  padding: 8px;
  vertical-align: middle;
}

.image-list-table th {
  background-color: #f2f2f2;
}

/* --- Image List: Mobile Card Layout --- */
.image-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.image-card {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.image-card-img {
  text-align: center;
  padding: 12px;
  background: #f8f9fa;
}

.image-card-img img {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  border-radius: 4px;
}

.image-card-details {
  padding: 12px;
  font-size: 14px;
  line-height: 1.8;
}

.image-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #eee;
  background: #f8f9fa;
}

.image-card-toggle {
  display: flex;
  gap: 12px;
  align-items: center;
}

.toggle-label {
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.toggle-label input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* --- Price Calculator: Fixed Price Box & Shared Styles --- */
.price-fixed-box {
  position: fixed;
  top: 3cm;
  background-color: white;
  padding: 8px;
  text-align: center;
  z-index: 999;
  border: 1px solid black;
}

@media (min-width: 768px) {
  .border-md-end {
    border-right: 2px solid #dee2e6 !important;
  }
  .price-fixed-box {
    left: 50% !important;
    transform: translateX(-50%);
    right: auto !important;
    top: 80px !important;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 160px;
  }
}

/* --- Edit User Page: Mobile Responsive --- */
@media (max-width: 768px) {
  .edit-user-container {
    padding: 0 8px;
    overflow-x: hidden;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .edit-user-container .offset-1 {
    margin-left: 0;
  }

  .edit-user-container .col-md-3,
  .edit-user-container .col-md-6,
  .edit-user-container .col-md-9,
  .edit-user-container .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .edit-user-container select,
  .edit-user-container textarea,
  .edit-user-container input[type="text"],
  .edit-user-container input[type="date"] {
    width: 100%;
  }

  .edit-user-container .col-xl-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .edit-user-container img {
    max-width: 100% !important;
  }
}
