/* Google Sans - local font */
@font-face {
  font-family: 'Google Sans';
  src: url('../fonts/GoogleSans_17pt-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  justify-content: center;
  align-items: center;
  width: 35px;
  height: 35px;
  position: relative;
}

.hamburger span {
  width: 22px;
  height: 2.5px;
  background-color: #333;
  transition: 0.3s;
  border-radius: 3px;
  position: absolute;
}

.hamburger span:nth-child(1) {
  top: 8px;
}

.hamburger span:nth-child(2) {
  top: 16px;
}

.hamburger span:nth-child(3) {
  top: 24px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 16px;
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 16px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .nav-bar {
    padding: 1rem;
    flex-wrap: wrap;
  }

  .logo {
    font-size: 1.2rem;
    flex: 0 0 auto;
  }

  .hamburger {
    display: flex;
    flex: 0 0 auto;
  }

  .search-form {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: 0.5rem 0 0 0;
    flex: 1 1 100%;
  }

  .search-input {
    font-size: 0.85rem;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background-color: #ffffff;
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    transition: right 0.3s;
    z-index: 1000;
    overflow-y: auto;
    gap: 0;
    align-items: stretch;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    width: 100%;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
    display: block;
  }

  .profile-icon {
    padding: 1rem !important;
    text-align: left;
    justify-content: flex-start;
  }

  .user-icon {
    display: none;
  }

  .profile-text {
    display: block;
  }

  .logout-form {
    width: 100%;
    margin: 0;
  }

  .logout-form button,
  .login-btn {
    width: 100%;
    text-align: left;
    padding: 1rem;
    border-radius: 4px;
  }

  /* Single column cards */
  .card-grid {
    grid-template-columns: 1fr !important;
    padding: 1rem;
    gap: 1rem;
  }

  .card {
    max-width: 100%;
  }

  .card img {
    height: 180px;
  }

  .no-image {
    height: 180px;
  }

}

@media (max-width: 480px) {
  .card-grid {
    padding: 0.5rem;
  }

  .card img {
    height: 150px;
  }

  .no-image {
    height: 150px;
  }

  .card-body {
    padding: 0.5rem;
  }

  .card-body h3 {
    font-size: 0.85rem;
  }

  .card-body p {
    font-size: 0.9rem;
  }

}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global Link Styling */
a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #ff4444;
}

a:visited {
  color: #1a1a1a;
}

a:active {
  color: #1a1a1a;
}

/* Override for specific link types that need different colors */
.login-link,
.signup-link,
.forgot-password {
  color: #ff4444;
}

.login-link:visited,
.signup-link:visited,
.forgot-password:visited {
  color: #ff4444;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  width: 100%;
  overflow-x: hidden;
  font-family: 'Google Sans', sans-serif;
  color: #1a1a1a;
}

body {
  width: 100%;
  position: relative;
}

/* Content wrapper to ensure proper fitting */
body > * {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Ensure content blocks fit properly */
[class*="content"], .content-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Responsive content padding */
body > div[style*="padding"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  body > div[style*="padding"] {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

/* Homepage vehicle grid - clean marketplace tile layout */
.vehicle-listings-page {
  padding: 1.5rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.vehicle-listings-title {
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.vehicle-listings-empty {
  color: #666;
  padding: 2rem;
  text-align: center;
  font-size: 1rem;
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.vehicle-tile {
  background-color: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  transition: transform 0.3s, box-shadow 0.3s;
}

.vehicle-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.vehicle-tile-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.vehicle-tile-image {
  width: 100%;
  height: 180px;
  min-height: 180px;
  overflow: hidden;
  background: #f0f0f0;
  flex-shrink: 0;
}

.vehicle-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vehicle-tile-no-image {
  width: 100%;
  height: 180px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.9rem;
}

.vehicle-tile-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.vehicle-tile-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.3;
}

.vehicle-tile-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ff4444;
  margin: 0;
}

.vehicle-tile-specs {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

.vehicle-tile-location {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}

.vehicle-tile-seller {
  padding: 0.5rem 1rem;
  margin: 0;
  font-size: 0.85rem;
  color: #666;
  border-top: 1px solid #e8e8e8;
}

.vehicle-tile-seller .seller-link {
  color: #ff4444;
  text-decoration: none;
}

.vehicle-tile-seller .seller-link:hover {
  color: #ff6666;
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .vehicle-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .vehicle-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .vehicle-listings-page {
    padding: 1rem 0.75rem;
  }

  .vehicle-tile-image,
  .vehicle-tile-no-image {
    height: 160px;
    min-height: 160px;
  }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.card {
  text-decoration: none;
  color: inherit;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  max-width: 280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: auto;
}

/* Card as link (legacy) or wrapper div */
.card,
.card:hover,
.card:visited,
.card:active {
  color: inherit;
}

a.card {
  text-decoration: none;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* Inner card link when card is a div (home page with seller link) */
.card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-seller {
  padding: 0.25rem 0.75rem 0.5rem;
  margin: 0;
  font-size: 0.85rem;
  color: #666;
  border-top: 1px solid #e0e0e0;
}

.card-seller .seller-link {
  color: #ff4444;
  text-decoration: none;
}

.card-seller .seller-link:hover {
  color: #ff6666;
  text-decoration: underline;
}

.seller-link {
  color: #ff4444;
  text-decoration: none;
  transition: color 0.3s;
}

.seller-link:hover {
  color: #ff6666;
  text-decoration: underline;
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  flex-shrink: 0;
}

.no-image {
  width: 100%;
  height: 160px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 1rem;
  flex-shrink: 0;
}

.card-body {
  padding: 0.5rem 0.75rem 0.4rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.2rem;
  flex-shrink: 0;
}

.card-body h3 {
  font-size: 0.95rem;
  margin: 0;
  color: #1a1a1a;
  font-weight: 600;
  line-height: 1.2;
}

.card-body p {
  font-weight: bold;
  color: #ff4444; /* Red price */
  font-size: 1rem;
  margin: 0;
  line-height: 1.2;
}

.card-body p:last-child {
  color: #666;
  font-size: 0.85rem;
  font-weight: normal;
  margin-top: 0.1rem;
}

/* Navigation Bar */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffffff;
  padding: 1rem 2rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  position: relative;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ff4444;
  text-decoration: none;
  transition: color 0.3s;
}

.logo:hover {
  color: #ff6666;
}

/* Search Form */
.search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 400px;
  margin: 0 1rem;
}

.search-input {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
  color: #1a1a1a;
  font-size: 0.9rem;
  min-width: 150px;
}

.search-input::placeholder {
  color: #999;
}

.search-input:focus {
  outline: none;
  border-color: #ff4444;
}

.search-btn {
  background-color: #ff4444;
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
  width: 40px;
  height: 40px;
}

.search-icon {
  width: 20px;
  height: 20px;
  color: white;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

.search-btn:hover {
  background-color: #ff6666;
}

.search-btn:hover .search-icon {
  color: white;
  stroke: white;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: #1a1a1a;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.nav-links a:hover {
  background-color: #f0f0f0;
}

.profile-icon {
  padding: 0.5rem 0.75rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  background-color: transparent;
  border-radius: 4px;
  transition: background-color 0.3s, transform 0.2s;
}

.profile-icon:hover {
  background-color: #f0f0f0;
  transform: scale(1.1);
}

.user-icon {
  width: 24px;
  height: 24px;
  color: #1a1a1a;
  stroke: #1a1a1a;
  fill: none;
  stroke-width: 2;
  transition: color 0.3s;
  display: block;
}

.profile-text {
  display: none;
  color: #1a1a1a;
  font-size: 1rem;
}

.profile-icon:hover .user-icon {
  color: #ff4444;
  stroke: #ff4444;
}

.logout-form {
  display: inline;
  margin: 0;
}

.logout-form button {
  background-color: #ff4444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.logout-form button:hover {
  background-color: #ff6666;
}

.login-btn {
  background-color: #ff4444 !important;
  color: white !important;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  text-decoration: none;
}

.login-btn:hover {
  background-color: #ff6666 !important;
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  background-color: #f5f5f5;
  padding: 2rem 1rem;
}

.login-box {
  background-color: #ffffff;
  padding: 2.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 400px;
  border: 1px solid #e0e0e0;
}

.login-box h2 {
  text-align: center;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  font-weight: 600;
}

.login-required-title {
  text-align: center;
  color: #ff4444;
  margin-bottom: 0.5rem;
  font-size: 2rem;
  font-weight: 700;
}

.login-required-message {
  text-align: center;
  color: #555;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.login-box form p {
  margin-bottom: 1rem;
}

.login-box label {
  display: block;
  color: #555;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.login-box input[type="text"],
.login-box input[type="password"],
.login-box input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #1a1a1a;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

.login-box input[type="text"]:focus,
.login-box input[type="password"]:focus,
.login-box input[type="email"]:focus {
  outline: none;
  border-color: #ff4444;
}

.login-box input[type="hidden"] {
  display: none;
}

.login-submit {
  width: 100%;
  background-color: #ff4444;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  margin-top: 1rem;
}

.login-submit:hover {
  background-color: #ff6666;
  transform: translateY(-2px);
}

.login-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  text-align: center;
}

.signup-link, .forgot-password {
  color: #ff4444;
  text-decoration: none;
  transition: color 0.3s;
}

.signup-link:hover, .forgot-password:hover {
  color: #ff6666;
}

.login-box .errorlist {
  color: #ff4444;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.login-box .errorlist li {
  margin-bottom: 0.25rem;
}

.login-box .helptext {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Profile Page Layout */
.profile-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
  box-sizing: border-box;
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 1.5rem;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a1a;
  border: 2px solid #ff4444;
  flex-shrink: 0;
}

.profile-header-info {
  flex: 1;
}

.profile-username {
  font-size: 1.8rem;
  color: #1a1a1a;
  margin: 0 0 0.25rem 0;
  font-weight: 600;
}

.profile-join-date {
  margin: 0;
  color: #666;
  font-size: 0.95rem;
}

.profile-badges {
  margin-top: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-type,
.badge-seller {
  background-color: #f0f0f0;
  color: #1a1a1a;
  border: 1px solid #ff4444;
}

.profile-header-actions .btn-outline {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.3s, border-color 0.3s;
}

.profile-header-actions .btn-outline:hover {
  background-color: #f0f0f0;
  border-color: #ff4444;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: #ffffff;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 1px solid #e0e0e0;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.4rem;
  color: #1a1a1a;
  font-weight: 600;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.profile-tab {
  background-color: #ffffff;
  color: #1a1a1a;
  border: 1px solid #ddd;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
}

.profile-tab.active {
  background-color: #ff4444;
  border-color: #ff4444;
}

.profile-tab-panel {
  display: none;
}

.profile-tab-panel.active {
  display: block;
}

.profile-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-tab-header h2 {
  color: #1a1a1a;
  margin: 0;
  font-size: 1.4rem;
}

.btn-primary {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background-color: #ff4444;
  color: #ffffff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.2s;
}

.btn-primary:hover {
  background-color: #ff6666;
  transform: translateY(-2px);
}

.profile-section-title {
  color: #1a1a1a;
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1.2rem;
}

.profile-empty-text {
  color: #666;
  font-size: 0.95rem;
  padding: 1rem 0;
}

.settings-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.settings-list li {
  margin-bottom: 0.75rem;
  color: #555;
}

.settings-list a {
  color: #ff4444;
  text-decoration: none;
}

.settings-list a:hover {
  color: #ff6666;
}

@media (max-width: 768px) {
  .profile-page-container {
    padding: 1.5rem 0.75rem;
  }

  .profile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-header-actions {
    align-self: stretch;
  }

  .profile-tab-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.signup-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  background-color: #f5f5f5;
  padding: 2rem 1rem;
}

.signup-box {
  background-color: #ffffff;
  padding: 2.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 400px;
  border: 1px solid #e0e0e0;
}

.signup-box h2 {
  text-align: center;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  font-weight: 600;
}

.signup-box form p {
  margin-bottom: 1rem;
}

.signup-box label {
  display: block;
  color: #555;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.signup-box input[type="text"],
.signup-box input[type="email"],
.signup-box input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #1a1a1a;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

.signup-box input[type="text"]:focus,
.signup-box input[type="email"]:focus,
.signup-box input[type="password"]:focus {
  outline: none;
  border-color: #ff4444;
}

.signup-submit {
  width: 100%;
  background-color: #ff4444;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  margin-top: 1rem;
}

.signup-submit:hover {
  background-color: #ff6666;
  transform: translateY(-2px);
}

.signup-links {
  text-align: center;
  margin-top: 1.5rem;
}

.login-link {
  color: #ff4444;
  text-decoration: none;
  transition: color 0.3s;
}

.login-link:hover {
  color: #ff6666;
}

.signup-box .errorlist {
  color: #ff4444;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.signup-box .errorlist li {
  margin-bottom: 0.25rem;
}

.signup-box .helptext {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.footer {
  background-color: #ffffff;
  color: #1a1a1a;
  padding: 1rem 0;
  border-top: 1px solid #e0e0e0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 2rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    padding: 1rem;
    gap: 1.5rem;
  }
}

.footer-bottom {
  background-color: #f0f0f0;
  text-align: center;
  padding: 0.5rem;
  border-top: 1px solid #e0e0e0;
}

/* Footer Links Styling */
.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: #ff4444;
}

.footer-section a:visited {
  color: #1a1a1a;
}

.footer-section a:active {
  color: #1a1a1a;
}

.footer-section h3,
.footer-section h4 {
  color: #1a1a1a;
  margin-bottom: 1rem;
}

.footer-section p {
  color: #555;
  margin: 0.5rem 0;
}

/* Vehicle Detail Page Styles */
.vehicle-detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
  box-sizing: border-box;
}

/* PDP Two-Column Layout */
.pdp-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.pdp-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pdp-image-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pdp-details-section {
  padding: 1.5rem;
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
}

.pdp-details-section .vehicle-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.6rem;
}

.pdp-details-section .vehicle-year {
  margin: 0 0 0.5rem 0;
}

.pdp-details-section .vehicle-price {
  margin-bottom: 1rem;
  justify-content: flex-start;
}

.vehicle-description {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.vehicle-description p {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.5;
}

.vehicle-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.wishlist-form {
  margin: 0;
}

.btn-wishlist {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #ffffff;
  color: #1a1a1a;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.btn-wishlist:hover {
  border-color: #ff4444;
  background: #fff5f5;
  color: #ff4444;
}

.btn-wishlist.active {
  border-color: #ff4444;
  background: #ff4444;
  color: #ffffff;
}

.btn-wishlist.active:hover {
  background: #ff6666;
  border-color: #ff6666;
  color: #ffffff;
}

.wishlist-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.pdp-inquiry-sidebar {
  flex: 0 0 340px;
  position: sticky;
  top: 2rem;
}

.pdp-inquiry-sidebar .inquiry-section {
  margin-top: 0;
  height: 100%;
  min-height: 400px;
}

.vehicle-main-image,
.vehicle-gallery-carousel {
  width: 100%;
  margin-bottom: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.pdp-image-section .vehicle-gallery-carousel {
  margin-bottom: 0;
}

.gallery-main-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.gallery-main {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
  font-size: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, opacity 0.2s;
  z-index: 2;
}

.gallery-arrow span {
  font-size: 2rem;
  line-height: 1;
  font-weight: 300;
  display: block;
}

.gallery-arrow:hover {
  background: #ffffff;
  opacity: 1;
}

.gallery-arrow-prev {
  left: 12px;
}

.gallery-arrow-next {
  right: 12px;
}

.gallery-thumbnails {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f9f9f9;
  border-radius: 0 0 12px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  transition: border-color 0.2s, opacity 0.2s;
}

.gallery-thumb:hover {
  opacity: 0.9;
}

.gallery-thumb.active {
  border-color: #ff4444;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-image {
  width: 100%;
  max-width: 100%;
  height: 500px;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.no-hero-image {
  width: 100%;
  height: 500px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 1.5rem;
  border-radius: 12px;
}

.vehicle-title {
  font-size: 1.8rem;
  color: #1a1a1a;
  margin: 0 0 0.3rem 0;
  font-weight: 700;
}

.vehicle-year {
  font-size: 1rem;
  color: #666;
  margin: 0 0 0.5rem 0;
}

.vehicle-price {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.price-yen {
  font-size: 1.5rem;
  color: #ff4444;
  font-weight: bold;
}

.price-usd {
  font-size: 1.1rem;
  color: #666;
  font-weight: 500;
}

.vehicle-details-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.vehicle-details-table th,
.vehicle-details-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.95rem;
}

.vehicle-details-table th {
  color: #666;
  font-weight: 500;
  width: 40%;
}

.vehicle-details-table td {
  color: #1a1a1a;
  font-weight: 500;
}

.vehicle-details-table tr:last-child th,
.vehicle-details-table tr:last-child td {
  border-bottom: none;
}

.pdp-details-section .vehicle-details-grid {
  margin-bottom: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

.vehicle-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 0;
  padding: 0;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.detail-value {
  font-size: 1rem;
  color: #1a1a1a;
  font-weight: 500;
}

.vehicle-gallery-section {
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.gallery-title {
  font-size: 1.8rem;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.vehicle-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s;
  cursor: pointer;
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

/* Inquiry form on vehicle PDP */
.inquiry-section {
  padding: 2rem;
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.inquiry-title {
  color: #1a1a1a;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.inquiry-success {
  color: #4ade80;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: rgba(74, 222, 128, 0.1);
  border-radius: 6px;
}

.inquiry-login-prompt {
  color: #555;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.btn-inquiry-login {
  text-decoration: none;
  text-align: center;
}

.inquiry-form p {
  margin-bottom: 1rem;
}

.inquiry-form label {
  display: block;
  color: #555;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.inquiry-form input[type="text"],
.inquiry-form input[type="email"],
.inquiry-form input[type="tel"],
.inquiry-form textarea {
  width: 100%;
  padding: 0.75rem;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #1a1a1a;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
}

.inquiry-form input:focus,
.inquiry-form textarea:focus {
  outline: none;
  border-color: #ff4444;
}

.inquiry-form textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-inquiry {
  display: inline-block;
  background-color: #ff4444;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 0.5rem;
  transition: background-color 0.3s, transform 0.2s;
}

.btn-inquiry:hover {
  background-color: #ff6666;
  transform: translateY(-2px);
}

.inquiry-form .errorlist {
  color: #ff4444;
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0 0;
  font-size: 0.85rem;
}

.vehicle-actions {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #e0e0e0;
  text-align: center;
}

.btn-back {
  display: inline-block;
  background-color: #ff4444;
  color: white;
  padding: 0.75rem 2rem;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.2s;
}

.btn-back:hover {
  background-color: #ff6666;
  transform: translateY(-2px);
}

/* Mobile Responsive Styles for Vehicle Detail */
@media (max-width: 768px) {
  .vehicle-detail-container {
    padding: 1rem;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .pdp-layout {
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    width: 100%;
  }

  .pdp-left {
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
  }

  .pdp-inquiry-sidebar {
    flex: none;
    width: 100%;
    max-width: 100%;
    position: static;
  }

  .pdp-inquiry-sidebar .inquiry-section {
    min-height: 0;
  }

  /* Image container: width 100%, max-height 300px */
  .pdp-image-section {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .vehicle-gallery-carousel {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .gallery-main-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
  }

  .gallery-main {
    width: 100%;
    max-width: 100%;
    height: 280px;
    max-height: 300px;
    overflow: hidden;
    position: relative;
  }

  /* Image: max-width 100%, height auto, object-fit cover, no overflow */
  .hero-image {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
  }

  .no-hero-image {
    height: 280px;
    max-height: 300px;
    width: 100%;
    max-width: 100%;
  }

  /* Arrows: visible, properly positioned over image */
  .gallery-arrow {
    width: 36px;
    height: 36px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .gallery-arrow span {
    font-size: 1.5rem;
  }

  .gallery-arrow-prev {
    left: 8px;
  }

  .gallery-arrow-next {
    right: 8px;
  }

  /* Details section: full width, proper padding, no overflow */
  .pdp-details-section {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .vehicle-title {
    font-size: 1.4rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .vehicle-year {
    font-size: 0.9rem;
  }

  .price-yen {
    font-size: 1.25rem;
  }

  .price-usd {
    font-size: 0.9rem;
  }

  .vehicle-details-table {
    width: 100%;
    table-layout: fixed;
  }

  .vehicle-details-table th,
  .vehicle-details-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .vehicle-details-table th {
    width: 40%;
  }

  .vehicle-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .btn-wishlist {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .pdp-details-section .vehicle-details-grid,
  .vehicle-details-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0;
  }

  .detail-item {
    padding: 0.5rem 0;
  }

  .inquiry-section {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .vehicle-actions {
    padding: 1rem 0;
  }

  .gallery-thumbnails {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem;
    gap: 0.4rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .gallery-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }

  .vehicle-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  .gallery-item img {
    height: 120px;
  }

  .gallery-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .vehicle-title {
    font-size: 1.3rem;
  }

  .vehicle-year {
    font-size: 0.85rem;
  }

  .price-yen {
    font-size: 1.2rem;
  }

  .price-usd {
    font-size: 0.9rem;
  }

  .vehicle-details-grid {
    padding: 0.75rem;
  }

  .detail-value {
    font-size: 0.9rem;
  }
}

/* Form Pages Styling (Add Listing, Vehicle Request, etc.) */
.form-page-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.form-page-container h2 {
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  font-weight: 600;
}

.form-page-container form {
  color: #1a1a1a;
}

.form-page-container form p {
  margin-bottom: 1rem;
}

.form-page-container label {
  display: block;
  color: #555;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-page-container input[type="text"],
.form-page-container input[type="number"],
.form-page-container input[type="email"],
.form-page-container input[type="file"],
.form-page-container select,
.form-page-container textarea {
  width: 100%;
  padding: 0.75rem;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: #1a1a1a;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-page-container input[type="text"]:focus,
.form-page-container input[type="number"]:focus,
.form-page-container input[type="email"]:focus,
.form-page-container select:focus,
.form-page-container textarea:focus {
  outline: none;
  border-color: #ff4444;
}

.form-page-container input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  accent-color: #ff4444;
}

.form-page-container button[type="submit"] {
  background-color: #ff4444;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  margin-top: 1rem;
}

.form-page-container button[type="submit"]:hover {
  background-color: #ff6666;
  transform: translateY(-2px);
}

.form-page-container .helptext {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.form-page-container .errorlist {
  color: #ff4444;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.form-page-container .errorlist li {
  margin-bottom: 0.25rem;
}

.form-page-container .form-error {
  color: #ff4444;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(255, 68, 68, 0.08);
  border-radius: 6px;
}

/* Image preview on add listing - thumbnail grid + large selected preview + delete */
.form-page-container .image-preview-section {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.image-preview-section .preview-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #1a1a1a;
}

.image-preview-section .preview-hint {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: #666;
}

.image-preview-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-preview-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.image-preview-main-placeholder {
  width: 100%;
  max-width: 400px;
  height: 240px;
  background: #e8e8e8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 1rem;
}

.image-preview-main-img {
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #fff;
}

.image-preview-delete-btn {
  padding: 0.5rem 1rem;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.image-preview-delete-btn:hover {
  background: #ff6666;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
}

.image-preview-thumb {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  transition: border-color 0.2s;
}

.image-preview-thumb:hover {
  border-color: #ccc;
}

.image-preview-thumb.selected {
  border-color: #ff4444;
  box-shadow: 0 0 0 1px #ff4444;
}

.image-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .image-preview-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .image-preview-thumb {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    flex-shrink: 0;
  }

  .image-preview-main-placeholder {
    max-width: 100%;
    height: 200px;
  }

  .image-preview-main-img {
    max-height: 220px;
  }
}

/* User List Page Styling */
.user-list-container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem;
}

.user-list-container h3 {
  color: #1a1a1a;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.user-list-container p {
  color: #666;
  font-size: 1rem;
}

.user-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.user-list-item {
  background-color: #ffffff;
  padding: 1rem;
  border-radius: 8px;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid #e0e0e0;
}

.user-list-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-list-item a {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s;
}

.user-list-item a:hover {
  color: #ff4444;
}

.user-list-item a:visited {
  color: #1a1a1a;
}

/* Responsive Form Pages */
@media (max-width: 768px) {
  .form-page-container {
    margin: 1rem;
    padding: 1.5rem;
  }

  .form-page-container h2 {
    font-size: 1.5rem;
  }

  .user-list-container {
    padding: 1rem;
  }

  .user-list-grid {
    grid-template-columns: 1fr;
  }
}

main {
  min-height: calc(100vh - 150px);
  padding-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}