/* Auction Detail Page Styles - Tailwind-inspired utility classes */
/* Based on Next.js prototype design */

:root {
  --primary-50: #ecfeff;
  --primary-100: #cffafe;
  --primary-200: #a5f3fc;
  --primary-600: #0C7490;
  --primary-700: #0e7490;
  --primary-900: #164e63;
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-400: #a3a3a3;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --blue-50: #eff6ff;
  --blue-200: #bfdbfe;
  --blue-600: #2563eb;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;
  --green-100: #dcfce7;
  --green-600: #16a34a;
  --green-800: #166534;
}

/* Page Background */
.auction-page-bg {
  background-color: #fafafa;
  min-height: 100vh;
}

/* Page Title */
.auction-page-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #171717;
  margin-bottom: 0.25rem;
  line-height: 1.2;
  padding-top:15px;
}

.auction-page-subtitle {
  font-size: 1.1rem;
  color: #525252;
}

/* Map Section */
.map-container {
  margin-top: 1rem;
}

.map-image {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #e5e5e5;
}

.osm-tile-map {
  position: relative;
  display: block;
}

.osm-tile-map .map-image {
  display: block;
}

.osm-tile-marker {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background-color: #e11d48;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}

.map-address {
  margin-top: 0.75rem;
}

/* Layout utilities - FIXED TO PX */
.auction-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

.auction-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 1024px) {
  .auction-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* Spacing utilities - FIXED TO PX */
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-8 > * + * { margin-top: 32px; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
/* main content padding was слишком жирный, уменьшаем с 32 до 16 */
.py-8 { padding-top: 16px; padding-bottom: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-6 { margin-top: 24px; }
.pt-6 { padding-top: 24px; }

/* Border utilities - FIXED TO PX */
.rounded-lg { border-radius: 8px; }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--neutral-200); }
.border-t { border-top: 1px solid var(--neutral-200); }
.border-2 { border-width: 2px; }

/* Shadow utilities */
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

/* Background utilities */
.bg-white { background-color: #ffffff; }
.bg-neutral-50 { background-color: var(--neutral-50); }
.bg-neutral-100 { background-color: var(--neutral-100); }
.bg-blue-50 { background-color: var(--blue-50); }
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--blue-50) 100%);
}

/* Text utilities - FIXED TO PX (Bootstrap sets html to 10px!) */
.text-sm { font-size: 15px; line-height: 24px; }
.text-base { font-size: 16px; line-height: 26px; }
.text-lg { font-size: 18px; line-height: 28px; }
.text-xl { font-size: 22px; line-height: 32px; }
.text-2xl { font-size: 26px; line-height: 36px; }
.text-3xl { font-size: 36px; line-height: 44px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-neutral-600 { color: var(--neutral-600); }
.text-neutral-700 { color: var(--neutral-700); }
.text-neutral-800 { color: var(--neutral-800); }
.text-neutral-900 { color: var(--neutral-900); }
.text-primary-600 { color: var(--primary-600); }
.text-primary-700 { color: var(--primary-700); }
.text-primary-900 { color: var(--primary-900); }
.text-blue-800 { color: var(--blue-800); }
.text-blue-900 { color: var(--blue-900); }
.text-green-600 { color: var(--green-600); }

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Breadcrumbs - FIXED TO PX (делаем полоску ниже) */
.auction-breadcrumbs {
  background-color: #ffffff;
  border-bottom: 1px solid var(--neutral-200);
  padding: 6px 0;
}

.auction-breadcrumbs nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--neutral-600);
  margin: 0; /* убираем дефолтный margin у nav, чтобы полоска была уже */
}

.auction-breadcrumbs a {
  color: var(--neutral-600);
  text-decoration: none;
  transition: color 0.2s;
}

.auction-breadcrumbs a:hover {
  color: var(--primary-600);
}

.auction-breadcrumbs .current {
  color: var(--neutral-900);
  font-weight: 500;
}

/* Card components - FIXED TO PX */
.auction-card {
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--neutral-200);
  padding: 24px;
}

.auction-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.auction-card-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--neutral-900);
  margin: 0;
}

.auction-card h2,
.auction-card h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: 16px;
}

.auction-card h3 {
  font-size: 18px;
}

/* Rating block in description header */
.description-rating {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #fbbf24;
}

.description-rating-value {
  font-size: 20px;
  color: var(--neutral-700);
  font-weight: 800;
}

/* Shared layered star rendering for detail header */
.rating-stars {
  position: relative;
  display: inline-block;
  line-height: 1;
}

.rating-stars-base,
.rating-stars-fill {
  letter-spacing: 2px;
}

.rating-stars-base {
  color: rgba(148, 163, 184, 0.45);
}

.rating-stars-fill {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  overflow: hidden;
  color: #fbbf24;
}

.description-rating .rating-stars {
  font-size: 18px;
}

/* Price card - FIXED TO PX */
.price-card {
	background: linear-gradient(135deg, var(--primary-50) 0%, var(--blue-50) 100%);
	border-radius: 8px;
	border: 2px solid var(--primary-200);
	padding: 24px;
}

.price-label {
	font-size: 16px;
	font-weight: 500;
	color: var(--primary-700);
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.price-value {
	font-size: 36px;
	font-weight: 700;
	color: var(--primary-900);
	margin-bottom: 16px;
}

/* Column banner for detail sidebars (copied from homepage-banner) */
.column-banner {
	padding: 12px;
	background-color: transparent;
}

.column-banner-placeholder {
	width: 300px;
	margin-left: 7px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	position: relative;
	overflow: hidden;
	background-color: #e9f5fb;
	border-radius: 0px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
	height: auto;
	min-height: 250px;
	background-image: url('/themes/aukcionai/images/300x200_placeholder.gif');
	background-repeat: no-repeat;
	background-position: center;
	background-size: auto;
}

.column-banner-text {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0px;
	pointer-events: none;
	border: 1px dashed darkcyan;
}

.column-banner-text h3 {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	color: #0C7490;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.column-banner-text p {
	margin: 0;
	font-size: 14px;
	color: #26586a;
}

.column-banner-text p.sizes {
	margin-top: 4px;
	opacity: 0.85;
}

.column-banner-text p.cta {
	margin-top: 8px;
	font-weight: 600;
}

.column-banner-ad {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* CTA Button - FIXED TO PX */
.cta-button {
	width: 100%;
  background-color: var(--primary-600);
  color: #ffffff !important; /* перебиваем все старые стили ссылок */
  font-weight: 600;
  font-size: 17px;
  padding: 16px 20px;
  border-radius: 8px;
  transition: all 0.2s;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

/* гарантируем, что текст и стрелка внутри тоже белые */
.cta-button span {
  color: #ffffff !important;
}

.cta-button:hover {
  background-color: var(--primary-700);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Keyword tags block under price card */
.keyword-tags-card {
  margin-top: 16px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--neutral-200);
  padding: 16px 18px;
}

.keyword-tags-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-800);
  margin-bottom: 8px;
}

.keyword-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 9999px;
  background-color: var(--primary-50);
  border: 1px solid var(--primary-100);
  color: var(--primary-700);
  white-space: nowrap;
}

/* Info blocks - FIXED TO PX */
.info-block {
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--neutral-200);
  padding: 24px;
}

.info-alert {
  background-color: var(--blue-50);
  border: 1px solid var(--blue-200);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
}

.info-alert h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-900);
  margin-bottom: 4px;
}

.info-alert p {
  font-size: 14px;
  color: var(--blue-800);
}

/* Definition lists - FIXED TO PX */
.details-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .details-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* В правой колонке (sticky-sidebar) всегда показываем детали одной колонкой */
.sticky-sidebar .details-list {
  grid-template-columns: 1fr;
}

.details-item dt {
  font-size: 14px;
  color: var(--neutral-600);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.details-item dd {
  font-size: 17px;
  font-weight: 500;
  color: var(--neutral-900);
}

.fees-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fee-item {
  display: flex;
  justify-content: space-between;
}

.fee-item dt {
  font-size: 14px;
  color: var(--neutral-600);
}

.fee-item dd {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-900);
}

/* Timeline - FIXED TO PX */
.timeline-container {
  position: relative;
}

.timeline-item {
  position: relative;
  padding-left: 32px;
  padding-bottom: 24px;
  border-left: 2px solid var(--primary-200);
}

.timeline-item:last-child {
  padding-bottom: 0;
  border-left: none;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  border: 2px solid #ffffff;
}

.timeline-dot-primary {
  background-color: #3b82f6;
}

.timeline-dot-green {
  background-color: #22c55e;
}

.timeline-dot-gray {
  background-color: var(--neutral-400);
}

.timeline-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.timeline-status-row {
  display: flex;
  justify-content: flex-end;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid;
}

/* Timeline typography tweaks - smaller fonts just inside the card */
.timeline-container .text-sm {
  font-size: 13px;
  line-height: 20px;
}

.timeline-title {
  margin: 0 0 2px 0;
}

.timeline-countdown {
  font-size: 13px;
  line-height: 20px;
  margin-top: 2px;
}

.timeline-countdown--registration {
  color: var(--primary-600);
}

.timeline-countdown--auction {
  color: var(--green-600);
}

.status-active {
  background-color: var(--green-100);
  color: var(--green-800);
  border-color: var(--green-600);
}

.status-ended {
  background-color: var(--neutral-100);
  color: var(--neutral-800);
  border-color: var(--neutral-400);
}

/* FAQ - FIXED TO PX */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background-color: var(--neutral-50);
  border-radius: 8px;
  padding: 16px;
}

.faq-question {
  font-weight: 600;
  font-size: 16px;
  color: var(--neutral-900);
  margin-bottom: 8px;
}

.faq-answer {
  font-size: 15px;
  color: var(--neutral-700);
  line-height: 24px;
}

/* Sticky sidebar - FIXED TO PX */
@media (min-width: 1024px) {
  .sticky-sidebar {
    position: sticky;
    top: 24px;
  }
}

@media (min-width: 1024px) {
  .sticky-sidebar > * + * {
    margin-top: 16px;
  }
}

/* Contact info - FIXED TO PX */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.contact-list dt {
  color: var(--neutral-600);
}

.contact-list dd {
  color: var(--neutral-900);
  margin-bottom: 8px;
}

/* Object ID footer - FIXED TO PX */
.object-id {
  font-size: 12px;
  color: var(--neutral-500);
  text-align: center;
  margin-top: 16px;
}

/* Description section - FIXED TO PX */
.description-text {
  font-size: 17px;
  color: var(--neutral-700);
  line-height: 28px;
  margin-bottom: 0;
}

/* Map action buttons under static map */
.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.map-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid var(--neutral-200);
  font-size: 14px;
  color: var(--primary-700);
  background-color: #ffffff;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.map-button:hover {
  background-color: var(--primary-50);
  border-color: var(--primary-200);
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Typography responsive */
@media (max-width: 768px) {
  .auction-page-title {
    font-size: 1.75rem; /* 28px */
  }
  
  h2 {
    font-size: 1.25rem; /* 20px */
  }
  
  .description-text {
    font-size: 15px;
  }
  
  .auction-container {
    padding: 0 12px;
  }
  
  .auction-breadcrumbs {
    font-size: 13px;
    padding: 8px 0;
  }
  
  /* Mobile spacing and padding */
  .auction-card {
    padding: 24px 10px !important;
    margin-bottom: 16px; /* Add spacing between blocks */
  }
  
  .space-y-8 > * + * {
    margin-top: 16px; /* Reduce spacing between sections */
  }
  
  .faq-item {
    padding: 10px !important;
  }
  
  .faq-container {
    gap: 10px !important;
  }
}

@media (max-width: 400px) {
  .auction-page-title {
    font-size: 1.5rem; /* 24px */
  }
  
  h2 {
    font-size: 1.1rem; /* 17.6px */
  }
  
  .description-text {
    font-size: 14px;
  }
  
  .auction-container {
    padding: 0 8px;
  }
  
  .auction-breadcrumbs {
    display: none; /* Hide on very small screens */
  }
  
  .py-8 {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  
  .text-3xl {
    font-size: 24px;
    line-height: 32px;
  }
  
  /* Extra small mobile */
  .auction-card {
    padding: 20px 8px !important;
    margin-bottom: 12px;
  }
}

/* Icons (using inline SVG or Font Awesome) - FIXED TO PX */
.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-md {
  width: 20px;
  height: 20px;
}

/* Utility: truncate - FIXED TO PX */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.max-w-md {
  max-width: 448px;
}

/* ============================================
   MOBILE/TABLET BLOCK REORDERING
   Order: FOTO → LAIKAS → APRASYMAS → LOKACIJA → INFO → KAINA → KEYWORDS
   ============================================ */

/* Column containers */
.auction-main-column,
.auction-sidebar-column {
  display: contents;
}

/* Mobile/Tablet: reorder blocks */
@media (max-width: 1023px) {
  .auction-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Block order for mobile:
     FOTO → LAIKAS → BANNER → APRASYMAS → LOKACIJA → INFO → KAINA → FAQ → KEYWORDS */
  .block-gallery   { order: 1; }
  .block-laikas    { order: 2; }
  .block-ad        { order: 3; display: block; } /* Show banner between laikas and aprasymas */
  .block-aprasymas { order: 4; }
  .block-lokacija  { order: 5; }
  .block-info      { order: 6; }
  .block-kaina     { order: 7; }
  .block-faq       { order: 8; }
  .block-keywords  { order: 9; }
  
  /* Center banner on mobile */
  .block-ad .column-banner-placeholder {
    margin: 0 auto;
    max-width: 100%;
  }
}

/* Desktop: restore normal column layout */
@media (min-width: 1024px) {
  .auction-main-column,
  .auction-sidebar-column {
    display: block;
  }

  .auction-sidebar-column {
    position: sticky;
    top: 20px;
    align-self: start;
  }
  
  .auction-sidebar-column > * + * {
    margin-top: 16px;
  }
  
  .auction-main-column > * + * {
    margin-top: 24px;
  }
}
