.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  /* overlay will handle scrolling */
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.8);
  transition: opacity 0.5s;
}
/* ТОЛЬКО для растяжения границ, без изменения отображения контента */
#modal-data-container .grid {
    display: grid !important;
    align-items: stretch !important;
}

#modal-data-container .grid > div {
    position: relative !important;
    min-height: 100% !important;
}

/* Растягиваем вертикальные границы */
#modal-data-container .grid > div.border-r::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 1px;
    background-color: #e5e7eb; /* border-gray-200 */
}



html.modal-open, body.modal-open {
  zoom: 0.85;
}
/* Apply transform scaling to page wrapper only when modal is open to avoid scaling the modal overlay itself */

/* Default: no scaling */
.page-wrapper {
  transform: none;
  transform-origin: top center;
}

/* Non-animated scaling to avoid bounce/jump during transitions */
html.modal-open .page-wrapper, body.modal-open .page-wrapper {
  transform: scale(0.67) !important;
  -webkit-transform: scale(0.67) !important;
}

/* Ensure modals are free from transforms and displayed over everything */
.modal-overlay, #vin-modal, #privacy-modal, #terms-modal, #risk-modal {
  position: fixed !important;
  transform: none !important;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10001; /* Keep consistent with existing high z-index */
}
/* Avoid painting issues by preventing pointer events inside page wrapper when scaled */
body.modal-open .page-wrapper { pointer-events: auto !important; }

/* Keep modal inner content center aligned */
.modal-overlay > .modal-content, .fixed.items-center.justify-center > .modal-content {
  position: relative !important;
  margin: auto !important;
}

/* Zoom the whole document when a modal is open (non-animated) */
/* Zoom is defined in modal-open-zoom.css (applied via adding 'modal-open' to <html>) */

.modal-content {
  background-color: #fefefe;
  margin: 1% auto;
  padding: 0;
  border: 1px solid #888;
  width: 90%;
  max-width: 1400px;
  /* allow the modal box to grow with content */
  max-height: none !important;
  height: auto !important;
  overflow-y: visible !important;
  overflow-x: hidden;
  border-radius: 10px;
  position: relative;
  animation: zoomIn 0.5s;
  box-sizing: border-box;
}

/* Make overlay scrollable and anchor modal to top so content can expand */
.modal, .modal-overlay {
  display: flex;
  align-items: flex-start; /* anchor to top */
  justify-content: center;
  overflow-y: auto; /* overlay scrolls if content exceeds viewport */
  -webkit-overflow-scrolling: touch;
  padding-top: 1.5rem; /* small gap from top */
}

/* Convert modal-70vh to dynamic auto-size to avoid forcing height */
.modal-70vh {
  height: auto !important;
  max-height: none !important;
  overflow-y: visible !important;
}

/* Constrain map to modal */
#modal-map {
  min-height: 350px;
  width: 100%;
  position: relative;
}

.route-info, .leaflet-control.route-info {
  position: absolute !important;
  bottom: 12px !important;
  left: 12px !important;
  z-index: 1001 !important;
}

/* Ensure modal overlay default centers; JS will adjust alignment when needed */
.modal, .modal-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes zoomIn {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

.close {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 15px;
  margin-right: 7px;
  margin-top: -10px;
  font-size: 35px;

  cursor: pointer;
  z-index: 10000;
}

.close:hover {
  color: #000;
}

.loading {
  text-align: center;
  padding: 40px 16px;
  display: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #dc2626;
  padding: 12px 16px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  margin: 16px;
  display: none;
}

.vehicle-info {
  display: none;
  padding: 0;
  background: #ffffff;
  min-height: 100%;
}

.timeline-container {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin: 10px 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timeline-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-right: 32px;
}

.timeline-title {
  font-size: 18px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: "Poppins", sans-serif;
}

.timeline-meta {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-family: "Poppins", sans-serif;
}

.timeline-vin {
  color: #1d4ed8;

  font-size: 16px;
  font-family: "Poppins", sans-serif;
  text-transform: uppercase;
}

.timeline-specs {
  color: inherit;

  font-size: 16px;
  font-family: "Poppins", sans-serif;
  text-transform: uppercase;
}

.timeline-bar {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border-radius: 25px;
  padding: 3px;
  position: relative;
}

.timeline-segment {
  flex: 1;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  padding: 10px 8px;
  text-align: center;
  border-radius: 8px;
  position: relative;
  margin: 0 2px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #93c5fd;
}

.timeline-segment.current {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border: 1px solid #93c5fd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-segment.in-transit {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: white;
  border: 1px solid #1d4ed8;
  box-shadow: 0 4px 8px rgba(30, 58, 138, 0.3);
}

.timeline-segment.active-blue {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: white;
  border: 1px solid #1d4ed8;
  box-shadow: 0 4px 8px rgba(30, 58, 138, 0.3);
}

.segment-text {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: "Poppins", sans-serif;
}

.date-info {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.date-label {
  display: block;
  font-size: 12px;
  color: #111827;
  opacity: 0.8;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-value {
  display: block;
  font-size: 14px;
  font-weight: 400;
  font-family: "Poppins", sans-serif;
  color: #111827;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 260px;
  gap: 12px;
  padding: 16px;
}

.sale-origin-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.middle-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photos-section {
  display: flex;
  flex-direction: column;
}

.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;

  color: #1f2937;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: "Poppins", sans-serif;
}

.card-body {
  padding: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s;
}

.info-row:hover {
  background-color: #f9fafb;
  margin: 0 -16px;
  padding: 4px 16px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row strong {
  color: #374151;

  min-width: 140px;
  font-size: 14px;
  font-family: "Poppins", sans-serif;
}

.info-row span {
  color: #1f2937;

  text-align: right;
  flex: 1;
  font-family: "Poppins", sans-serif;
}

/* Container tracking styles */
.company-info {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 0;
}

/* Slightly lower the text block (company name, container, port) while keeping icon at top */
.company-info>div:nth-child(2) {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.company-icon {
  background: #2563eb;
  padding: 6px;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}

.company-title {
  font-size: 14px;
  color: #1f2937;
  margin: 0;
  line-height: 1.1;
  font-family: sans-serif;
  text-align: left;
}

.container-number {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.1;
  font-family: sans-serif;
  margin-top: 2px;
  text-align: left;
}

.status-section {
  margin-top: 2px;
  margin-bottom: 6px;
}

.status-title {
  font-size: 16px;

  color: #1f2937;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-icon {
  color: #3b82f6;
}

.status-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.status-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 4px;
  padding: 1px 0;
}

.status-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
}

.status-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-circle.completed {
  background: #10b981;
  color: white;
}

.status-circle.pending {
  background: #6b7280;
  border: 2px solid #6b7280;
}

.status-content {
  flex: 1;
  padding-bottom: 0;
}

/* Reduce spacing between city and time */
.status-content p {
  margin: 0;
  line-height: 1.15;
}

.status-city {
  margin-bottom: 2px;
}

.status-time {
  margin-top: 0;
  font-size: 12px;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.current-badge {
  color: #10b981;
}

@keyframes currentBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.status-action {
  font-size: 13px;
}

.status-action.current {
  color: #10b981;
  animation: currentBlink 1.2s ease-in-out infinite;
}

.status-action.completed {
  color: #10b981;
}

.status-action.pending {
  color: #6b7280;
}

.top-cards {
  position: absolute;
  top: 10px;
  right: 48px;
  display: flex;
  gap: 4px;
  z-index: 1000;
}

.top-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 4px;
  padding: 2px 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  line-height: 1.1;
}

.top-card p {
  margin: 0;
}

.top-card .card-label {
  display: block;
  line-height: 1;
  font-size: 11px;
}

.top-card .card-value {
  display: block;
  line-height: 1;
  margin-top: 2px;
}

.card-icon {
  color: #3b82f6;
  font-size: 10px;
  line-height: 1;
  margin-top: 1px;
}

.card-label {
  font-size: 10px;
  color: #6b7280;
}

.card-value {
  color: #1f2937;
  font-size: 12px;
}

.bottom-eta-card {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: linear-gradient(to right, #2563eb, #10b981);
  border-radius: 10px;
  padding: 10px;
  color: white;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
}

.eta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.eta-label {
  font-size: 12px;
}

.eta-time {
  font-weight: bold;
  font-size: 15px;
  margin-left: auto;
}

.eta-date {
  font-size: 10px;
  color: #dbeafe;
  margin-bottom: 5px;
}

.progress-bar {
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  background: white;
  height: 100%;
  border-radius: 9999px;
  transition: width 1s ease;
}

.progress-text {
  font-size: 12px;
  color: #dbeafe;
  margin-top: 2px;
}

/* Photo styles */
.photo-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

.photo-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  transition: all 0.2s;
  cursor: pointer;
  width: 100%;
  height: 80px;
  position: relative;
}

.photo-category:hover {
  transform: scale(1.02);
}

.photo-category.active {
  border-color: #93c5fd;
}

.photo-category-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  padding: 12px;
}

.photo-category-info {
  display: flex;
  align-items: center;
}

.photo-category-text {
  display: flex;
  flex-direction: column;
}

.photo-category-name {
  font-weight: 600;
  color: white;
  font-size: 16px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.photo-category-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-family: sans-serif;
}


@media (max-width: 768px) {
  .modal-content {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .timeline-container {
    margin: 10px 12px;
    padding: 12px;
  }

  .timeline-bar {
    flex-direction: column;
    gap: 8px;
  }

  .timeline-segment {
    width: 100%;
    margin: 0;
  }

  /* На мобильных устройствах фото показываются вертикально */
  .photos-wrapper {
    flex-direction: column !important;
    gap: 16px;
  }

  .photo-card {
    flex-direction: column !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .photo-card-actions {
    flex-direction: row !important;
    gap: 8px;
  }
  
  .photo-btn {
    flex: auto;
  }
}

/* Photos wrapper - horizontal layout */
.photos-wrapper {
  display: flex;
  flex-direction: column; /* default vertical layout for modal photo stacks */
  gap: 12px;
  width: 100%;
}

/* Photo card - simple clean design, total height 280px with buttons */
.photo-card {
  flex: 1;
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: 280px;
  max-height: 280px;
}

/* Single photo card takes full width */
.photos-wrapper:has(.photo-card:only-child) .photo-card {
  max-width: 100%;
}

/* Photo image - fills remaining space after buttons */
.photo-card-image,
.photo-card-compact,
div.photo-card-image,
div.photo-card-compact {
  width: 100% !important;
  flex: 1 !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  display: flex !important;
  align-items: flex-end !important;
  padding-bottom: 10px !important;
  position: relative !important;
}

/* Disabled photo effect - grayscale with overlay */
.photo-card-disabled {
  filter: grayscale(100%) brightness(0.7);
  opacity: 0.6;
}

.photo-card-disabled::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* Photo overlay - white text at bottom */
.photo-overlay {
  width: 100%;
  padding: 0 10px;
}

.photo-label {
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.photo-status {
  color: #fbbf24;
  font-size: 9px;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Photo buttons */
.photo-card-actions {
  padding: 8px;
  display: flex;
  gap: 6px;
  border-top: 1px solid #e5e7eb;
  background: white;
  flex-shrink: 0;
  height: 40px;
}


.photo-btn i {
  font-size: 12px;
}



/* Text-style button: black icon + text (for Copy/Open links) */
.photo-btn.photo-btn-text {
  background: transparent;
  color: #111827;
  box-shadow: none;
}

.photo-btn.photo-btn-text:hover:not(:disabled) {
  background: #f3f4f6;
  color: #111827;
}

.photo-btn.photo-btn-text i {
  color: #111827;
}

.photo-btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: white !important;
  color: #9ca3af !important;
  border-color: #e5e7eb !important;
}

.photo-btn-disabled:hover {
  background: white !important;
  color: #9ca3af !important;
}

/* Alignment for 3-column grid */
.grid.xl\\:grid-cols-3 > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Обеспечиваем одинаковое выравнивание заголовков */
.grid.xl\\:grid-cols-3 > div > h3 {
  margin-bottom: 1rem !important; /* 16px - одинаковый отступ для всех заголовков */
  flex-shrink: 0;
  align-self: stretch;
  height: auto;
}

/* Основной контент начинается на одной линии после заголовка */
.grid.xl\\:grid-cols-3 > div > div.bg-gray-50,
.grid.xl\\:grid-cols-3 > div > #photosContainer {
  margin-top: 0;
  align-self: flex-start;
  width: 100%;
}

/* Убираем лишние отступы внизу блоков в колонках */
.grid.xl\\:grid-cols-3 .mb-6:last-child,
.grid.xl\\:grid-cols-3 .mb-4:last-child {
  margin-bottom: 0 !important;
}

/* Точное выравнивание верхней части контента после заголовков */
.grid.xl\\:grid-cols-3 > div:first-child > div:first-of-type,
.grid.xl\\:grid-cols-3 > div:nth-child(2) > div:first-of-type,
.grid.xl\\:grid-cols-3 > div:last-child > #photosContainer {
  margin-top: 0 !important;
}

/* Специальное выравнивание для фото контейнера - убираем все отступы */
#photosContainer {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Убираем отступы у фото карточек для точного выравнивания */
.grid.xl\\:grid-cols-3 > div:last-child #photosContainer .photo-card:first-child {
  margin-top: 0 !important;
}

/* Дополнительное выравнивание - поднимаем фото секцию на уровень с другими блоками */
.grid.xl\\:grid-cols-3 > div:last-child #photosContainer .photos-wrapper {
  margin-top: 0 !important;
}

/* Если всё ещё не выровнено, используем отрицательный отступ */
.grid.xl\\:grid-cols-3 > div:last-child #photosContainer {
  transform: translateY(-1px);
}

/* Дополнительные стили для красивого отображения фото в горизонтальном ряду */
#photosContainer {
  background: transparent !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 1rem !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  height: 280px !important;
  min-height: 280px !important;
  max-height: 280px !important;
  overflow: hidden !important;
}
/* Улучшаем внешний вид фото карточек в горизонтальном режиме */
.photo-card-image::before {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 60%);
}

/* Адаптивные размеры для разных разрешений экрана */
@media (max-width: 1280px) {
  .photo-card {
    max-width: 100%;
  }
}

/* =========================
   USER PHOTO DESIGN SNIPPET
   ========================= */

/* Photo styles */
.photo-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

.photo-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  transition: all 0.2s;
  cursor: pointer;
  width: 100%;
  height: 80px;
  position: relative;
}

.photo-category:hover {
  transform: scale(1.02);
}

.photo-category.active {
  border-color: #93c5fd;
}

.photo-category-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  padding: 12px;
}

.photo-category-info {
  display: flex;
  align-items: center;
}

.photo-category-text {
  display: flex;
  flex-direction: column;
}

.photo-category-name {
  font-weight: 600;
  color: white;
  font-size: 16px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.photo-category-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-family: sans-serif;
}
.photo-card-compact {
  height: 120px;
}

.photo-card {
  width: 320px;
  margin: 8px;
}

@media (max-width: 768px) {
  .modal-content {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .timeline-container {
    margin: 10px 12px;
    padding: 12px;
  }

  .timeline-bar {
    flex-direction: column;
    gap: 8px;
  }

  .timeline-segment {
    width: 100%;
    margin: 0;
  }

  /* На мобильных устройствах фото показываются вертикально */
  .photos-wrapper {
    flex-direction: column;
    gap: 16px;
  }

  .photo-card {
    max-width: 100%;
  }

  .photo-card-image {
    height: 180px;
  }
}

/* Photos wrapper - horizontal layout (row) */
.photos-wrapper {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
  margin-top: 0;
  justify-content: space-between;
}

/* Photo card container - horizontal layout */
.photo-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  flex: 1;
  min-width: 0;
  max-width: 50%;
}

.photo-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Photo card image - увеличенная высота для горизонтального отображения */
.photo-card-image {
  height: 220px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  align-items: flex-end;
  transition: all 0.3s ease;
}

.photo-card-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  z-index: 1;
}

.photo-card-disabled {
  opacity: 0.5;
  filter: grayscale(60%);
}

/* Photo overlay */
.photo-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.photo-label {
  color: white;
  font-size: 15px;
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 6px;
}

.photo-label i {
  font-size: 14px;
}

.photo-status {
  color: #fbbf24;
  font-size: 11px;
  font-weight: 500;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

/* Photo card actions */
.photo-card-actions {
  padding: 10px;
  background: #f9fafb;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

/* Photo buttons - improved design for horizontal layout */
.photo-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.photo-btn i {
  font-size: 12px;
}

.photo-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.photo-btn:hover::before {
  width: 300px;
  height: 300px;
}

.photo-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.photo-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-2px);
}

.photo-btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.photo-btn-secondary {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: #475569;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.photo-btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-color: #94a3b8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  color: #334155;
}

.photo-btn-secondary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.photo-btn-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.photo-btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
}

.photo-btn-warning:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.photo-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #e5e7eb !important;
  color: #9ca3af !important;
  border-color: #e5e7eb !important;
  box-shadow: none !important;
  transform: none !important;
}

.photo-btn i {
  font-size: 16px;
  position: relative;
  z-index: 1;
}

.photo-btn span {
  position: relative;
  z-index: 1;
}

/* Old styles for backward compatibility */
.image-link-car {
  text-align: center;
  padding: 12px;
  height: 200px !important;
  min-height: 200px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 180px;
  color: white;
  font-size: 22px;
  font-weight: bold;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.image-link-car:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-link-car button:hover,
.image-link-car a:hover {
  background: rgba(37, 99, 235, 0.9) !important;
  transform: scale(1.05);
}



/* ============================================================================
   VEHICLE INFORMATION - ADAPTIVE LAYOUT
   ============================================================================ */

/* 🔄 ВЕРТИКАЛЬНЫЙ LAYOUT (когда Auction Details скрыты) */
#vehicle-info-container.vehicle-info-vertical {
  margin-bottom: 1.7rem !important;
  display: block !important;
}

#vehicle-info-container.vehicle-info-vertical h3 {
  margin-bottom: 1.7rem !important;
}

#vehicle-info-container.vehicle-info-vertical #vehicle-info-fields {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 0.75rem !important;
  background: #f9fafb !important;
  padding: 1rem !important;
  border-radius: 0.5rem !important;
  border: 1px solid #e5e7eb !important;
  font-size: 0.95rem !important;
  line-height: 1rem !important;
  flex-direction: unset !important;
  flex-wrap: unset !important;
}

#vehicle-info-container.vehicle-info-vertical .vehicle-info-field {
  display: contents !important;
  flex-direction: unset !important;
  gap: unset !important;
  white-space: unset !important;
}

#vehicle-info-container.vehicle-info-vertical .field-label {
  font-size: 0.95rem !important;
  line-height: 1rem !important;
  color: #4b5563 !important;
  font-weight: 500 !important;
  display: block !important;
}

#vehicle-info-container.vehicle-info-vertical .field-value {
  font-size: 0.95rem !important;
  line-height: 1rem !important;
  color: #1f2937 !important;
  display: block !important;
}

/* 🔄 ГОРИЗОНТАЛЬНЫЙ LAYOUT (когда Auction Details показаны) */
#vehicle-info-container.vehicle-info-horizontal {
  margin-bottom: 1.5rem !important;
  display: block !important;
}

#vehicle-info-container.vehicle-info-horizontal h3 {
  margin-bottom: 0.5rem !important;
  font-size: 1.2rem !important;
}

/* 🎯 КЛЮЧЕВОЕ ИСПРАВЛЕНИЕ: Увеличена специфичность и добавлены стили для дочерних элементов */
#vehicle-info-container.vehicle-info-horizontal #vehicle-info-fields {
  /* КРИТИЧЕСКИ ВАЖНО: Отключаем grid и включаем flex */
  display: flex !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  grid-auto-flow: unset !important;
  
  /* Flex настройки */
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
  align-items: center !important;
  justify-content: flex-start !important;
  
  /* Остальные стили - уменьшенный размер */
  font-size: 0.95rem !important;
  line-height: 1.3 !important;
  padding: 0.75rem !important;
  margin-bottom: 0.5rem !important;
  background: #f9fafb !important;
  border-radius: 0.5rem !important;
  border: 1px solid #e5e7eb !important;
  /* Allow vehicle-info to grow naturally so engine text won't be clipped */
  max-height: none !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* Стили для expand/collapse кнопок */
.expand-btn {
  color: #2563eb;
  cursor: pointer;
  font-size: 0.95rem;
  margin-left: 0.25rem;
  text-decoration: underline;
  white-space: nowrap;
}

.expand-btn:hover {
  color: #1d4ed8;
}

.field-value-truncated {
  display: inline;
}

.field-value-full {
  display: none;
}

#vehicle-info-container.vehicle-info-horizontal .vehicle-info-field {
  /* КРИТИЧЕСКИ ВАЖНО: НЕ display: contents! */
  display: flex !important;
  flex-direction: row !important;
  gap: 0.3rem !important;
  align-items: center !important;
  white-space: normal !important;
  flex-shrink: 1 !important;
  font-size: 0.95rem !important;
  line-height: 1.3 !important;
  
  /* Убеждаемся что НЕ grid */
  grid-column: unset !important;
  grid-row: unset !important;
}

#vehicle-info-container.vehicle-info-horizontal .field-label,
#vehicle-info-container.vehicle-info-horizontal .field-value {
  display: inline !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

#vehicle-info-container.vehicle-info-horizontal .field-label {
  color: #4b5563 !important;
  font-weight: 500 !important;
  font-size: 1rem !important;
}

#vehicle-info-container.vehicle-info-horizontal .field-label b {
  font-weight: 500 !important;
}

#vehicle-info-container.vehicle-info-horizontal .field-value {
  color: #1f2937 !important;
  font-size: 1rem !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* REMOVED DUPLICATE - See main .photo-card definition above */


/* Выравнивание высоты Photos секции с Shipping Details */
.grid.xl\:grid-cols-3 > div:last-child {
  display: flex;
  flex-direction: column;
}

.grid.xl\:grid-cols-3 > div:last-child > div {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.grid.xl\:grid-cols-3 > div:last-child #photosContainer {
  flex: 1 !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  min-height: 380px !important;
  max-height: none !important;
  gap: 1rem !important;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  /* На мобильных ТОЛЬКО вертикальный layout становится одноколоночным */
  #vehicle-info-container.vehicle-info-vertical #vehicle-info-fields {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  
  /* Horizontal layout на мобильных тоже переключается в вертикальный режим */
  #vehicle-info-container.vehicle-info-horizontal #vehicle-info-fields {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  #vehicle-info-container.vehicle-info-horizontal .vehicle-info-field,
  #vehicle-info-container.vehicle-info-vertical .vehicle-info-field {
    display: contents !important;
    white-space: normal !important;
  }
  
  #vehicle-info-container.vehicle-info-horizontal .field-label,
  #vehicle-info-container.vehicle-info-horizontal .field-value {
    display: block !important;
  }
  
  .photo-card {
    height: auto !important;
  }
  
  .photo-card-image {
    width: 100% !important;
    height: 280px !important;
  }
}

/* Исправление высоты грид-контейнера */
.grid.xl\:grid-cols-3 {
  align-items: start !important;
  grid-auto-rows: min-content !important;
}

/* Убираем лишние высоты у колонок */
.grid.xl\:grid-cols-3 > div {
  height: auto !important;
  min-height: unset !important;
  display: flex;
  flex-direction: column;
}

/* Фиксируем высоту фото контейнера */
.grid.xl\:grid-cols-3 > div:last-child #photosContainer {
  min-height: 280px !important;
  max-height: 280px !important;
  height: 280px !important;
  flex: none !important;
}

/* Убираем лишние отступы между секциями */
.p-4.border-r.border-gray-200,
.px-4.pt-4.pb-0.border-r.border-gray-200,
.p-4 {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Исправляем Vehicle Information section */
#vehicle-info-container {
  margin-bottom: 0.5rem !important;
}

#vehicle-info-container #vehicle-info-fields {
  margin-bottom: 0 !important;
}

/* Убираем трансформацию, которая создавала лишнее пространство */
.grid.xl\:grid-cols-3 > div:last-child #photosContainer {
  transform: none !important;
}