/* ========================================
   SINGLE TRACTOR PAGE
======================================== */

.single-tractor-page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}

/* ========================================
   HERO
======================================== */

.tractor-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 50px;
  align-items: center;
  margin-bottom: 45px;
}

.tractor-hero-image {
  border: 1px solid #eeeeee;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.tractor-hero-image img {
  display: block;
  width: 100%;
  height: 450px;
  object-fit: contain;
}

.tractor-hero-content h1 {
  margin: 0 0 20px;
  font-size: 40px;
  line-height: 1.2;
}

.single-tractor-price {
  margin-bottom: 30px;
  color: #d71920;
  font-size: 25px;
  font-weight: 700;
}

/* ========================================
   BRAND LINK
======================================== */

.single-tractor-brand {
  display: inline-block;
  margin-bottom: 12px;
  color: #d71920 !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.single-tractor-brand:hover {
  text-decoration: underline;
}

/* ========================================
   QUICK SPECS
======================================== */

.tractor-quick-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.quick-spec {
  padding: 18px;
  border: 1px solid #eeeeee;
  border-radius: 8px;
}

.quick-spec strong,
.quick-spec span {
  display: block;
}

.quick-spec strong {
  margin-bottom: 5px;
  font-size: 19px;
}

.quick-spec span {
  color: #666666;
  font-size: 14px;
}

/* ========================================
   SINGLE TRACTOR COMPARE BUTTON
======================================== */

.single-tractor-compare-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 5px 0 25px;
  padding: 13px 24px;
  border: 1px solid #1d2b45;
  border-radius: 5px;
  color: #1d2b45 !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  transition: 0.2s ease;
}

.single-tractor-compare-button:hover {
  background: #1d2b45;
  color: #ffffff !important;
}

/* ========================================
   CONTENT SECTIONS
======================================== */

.tractor-section {
  margin-top: 35px;
  margin-bottom: 24px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  scroll-margin-top: 140px;
}

.tractor-section h2 {
  margin: 0 0 22px;
  font-size: 24px;
  line-height: 1.3;
}

.tractor-overview {
  line-height: 1.8;
}

/* ========================================
   SPECIFICATION TABLE
======================================== */

.tractor-spec-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
}

.tractor-spec-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #e5e7eb;
}

.spec-label {
  color: #666666;
}

.spec-value {
  font-weight: 600;
  text-align: right;
}

/* ========================================
   STICKY SPECIFICATION NAVIGATION
======================================== */

.tractor-sticky-nav {
  position: sticky;
  top: 0;
  z-index: 99;
  margin: 30px 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.admin-bar .tractor-sticky-nav {
  top: 32px;
}

.tractor-sticky-nav-inner {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.tractor-sticky-nav-inner::-webkit-scrollbar {
  display: none;
}

.tractor-sticky-nav a {
  flex-shrink: 0;
  display: block;
  padding: 17px 20px;
  color: #14213d;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: 0.2s ease;
}

.tractor-sticky-nav a:hover {
  color: #d71920;
  border-bottom-color: #d71920;
}

html {
  scroll-behavior: smooth;
}

/* ========================================
   RELATED TRACTORS
======================================== */

.related-tractors-section {
  margin-top: 50px;
}

.related-tractors-section > h2 {
  margin-bottom: 25px;
  font-size: 28px;
}

.related-tractors-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.related-tractor-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.related-tractor-image {
  display: block;
  height: 230px;
  background: #ffffff;
}

.related-tractor-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.related-tractor-content {
  padding: 20px;
}

.related-tractor-content h3 {
  margin: 0 0 15px;
  font-size: 20px;
  line-height: 1.35;
}

.related-tractor-content h3 a {
  color: #14213d;
  text-decoration: none;
}

.related-tractor-specs {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
  font-size: 15px;
}

.related-tractor-price {
  margin-bottom: 18px;
  font-size: 17px;
  font-weight: 700;
}

.related-tractor-button {
  display: inline-block;
  padding: 10px 20px;
  color: #d71920 !important;
  border: 1px solid #d71920;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.related-tractor-button:hover {
  color: #ffffff !important;
  background: #d71920;
}

/* ========================================
   SINGLE TRACTOR IMAGE VIEWER
======================================== */

.tractor-image-viewer {
  width: 100%;
}

.tractor-main-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.tractor-main-image-button img {
  display: block;
  width: 100%;
  height: 420px;
  object-fit: contain;
  background: #ffffff;
}

.tractor-image-thumbnails {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.tractor-image-thumbnails::-webkit-scrollbar {
  display: none;
}

.tractor-image-thumb {
  flex: 0 0 86px;
  width: 86px;
  height: 68px;
  padding: 4px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  box-sizing: border-box;
}

.tractor-image-thumb.is-active {
  border-color: #d71920;
}

.tractor-image-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ========================================
   IMAGE LIGHTBOX
======================================== */

.tractor-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(0, 0, 0, 0.88);
}

.tractor-image-lightbox.is-open {
  display: flex;
}

.tractor-lightbox-image {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
}

.tractor-lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
}

body.tractor-lightbox-open {
  overflow: hidden;
}

/* ========================================
   PRICE LOCK BUTTON & MODAL
======================================== */

.single-tractor-price-lock-button {
  background-color: #ff9800;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  padding: 12px 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition:
    background 0.3s ease,
    transform 0.2s ease;
  display: inline-block;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.single-tractor-price-lock-button:hover {
  background-color: #e68a00;
  transform: translateY(-1px);
}

.tractor-form-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tractor-form-modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  position: relative;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.close-form-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  color: #333;
}

/* ========================================
   MEDIA QUERIES (TABLET & MOBILE)
======================================== */

@media (max-width: 921px) {
  .related-tractors-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 782px) {
  .admin-bar .tractor-sticky-nav {
    top: 46px;
  }

  .tractor-sticky-nav a {
    padding: 14px 16px;
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .single-tractor-page {
    padding: 30px 16px;
  }

  .tractor-hero {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .tractor-hero-content h1 {
    font-size: 30px;
  }

  .tractor-spec-table {
    grid-template-columns: 1fr;
  }

  .tractor-section {
    padding: 20px;
  }

  .tractor-spec-row {
    gap: 15px;
  }

  .tractor-main-image-button img {
    height: 300px;
  }

  .tractor-image-thumb {
    flex: 0 0 74px;
    width: 74px;
    height: 60px;
  }
}

@media (max-width: 600px) {
  .related-tractors-grid {
    grid-template-columns: 1fr;
  }
}
