/* General Styles */
:root {
  --primary-color: #b45309;
  --secondary-color: #6b5b4c;
  --success-color: #1f7a5c;
  --danger-color: #b42318;
  --warning-color: #f59e0b;
  --dark-color: #2b2017;
  --light-color: #f6f1eb;
  --surface-color: #ffffff;
  --surface-alt: #efe6dd;
  --accent-color: #0f766e;
}

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

body {
  font-family: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--light-color);
  color: var(--dark-color);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.display-4, .display-6 {
  font-family: 'Space Grotesk', 'Source Sans 3', sans-serif;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.navbar.bg-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

.btn-primary {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.btn-outline-primary {
  color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.btn-outline-primary:hover {
  background-color: var(--primary-color) !important;
  color: #fff !important;
}

.btn-outline-primary .bi-person-plus-fill,
.seller-profile-icon {
  color: #667eea !important;
}

.bi-person-plus-fill {
  color: #667eea !important;
}

/* Navbar */
.navbar-brand {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.nav-link {
  transition: color 0.3s ease;
  font-weight: 500;
}

.login-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.95) !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  animation: loginCtaPulse 2.2s infinite;
}

.login-cta .bi {
  font-size: 1rem;
}

.login-cta:hover,
.login-cta:focus {
  color: #1f2937 !important;
  background: #ffffff;
  border-color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.28);
}

@keyframes loginCtaPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  padding: 60px 0;
  min-height: 600px;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 70% 10%, rgba(255, 255, 255, 0.18), transparent 40%),
    radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.12), transparent 35%);
  opacity: 0.6;
}

.min-vh-75 {
  min-height: 75vh;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.hero-pills .benefit-badge {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse Button Animation */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(255, 193, 7, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
  }
}

.pulse-button {
  animation: pulse 2s infinite;
  transition: all 0.3s ease;
}

.pulse-button:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4) !important;
}

/* Animación para la sección de Vendedor Digital */
.bg-gradient {
  position: relative;
  overflow: hidden;
}

.bg-gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}


.animate-fade-in {
  animation: fadeIn 1s ease-out;
}

.animate-fade-in-delay {
  animation: fadeIn 1s ease-out 0.3s backwards;
}

.animate-fade-in-delay-2 {
  animation: fadeIn 1s ease-out 0.6s backwards;
}

/* Benefit Badges */
.benefit-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  padding: 10px 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.benefit-badge i {
  font-size: 1.2rem;
}

/* Search Card */
.search-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(25, 15, 8, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}

.nav-tabs {
  border-bottom: 1px solid rgba(43, 32, 23, 0.12);
}

.nav-tabs .nav-link {
  color: var(--secondary-color);
  border: none;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
  border-color: transparent;
  color: var(--primary-color);
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  background: transparent;
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

.trust-strip {
  background: var(--surface-color);
  border-top: 1px solid #e7ddd2;
  border-bottom: 1px solid #e7ddd2;
  padding: 18px 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-color);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 8px 20px rgba(24, 16, 10, 0.08);
  border: 1px solid #efe6dd;
}

.trust-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-alt);
  color: var(--primary-color);
  font-size: 1.2rem;
}

.trust-title {
  font-weight: 700;
  color: var(--dark-color);
}

.trust-subtitle {
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-head-centered {
  align-items: center;
  text-align: center;
}

.section-head-inline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title {
  display: inline-block;
  position: relative;
  font-weight: 700;
  color: var(--dark-color);
  letter-spacing: -0.03em;
  padding-bottom: 10px;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 52px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  opacity: 0.9;
}

.section-subtitle {
  color: var(--secondary-color);
  font-weight: 500;
}

/* Publicidad rotativa */
.publicidad-rotativa-wrapper {
  width: 100%;
  margin: 24px 0;
}

.publicidad-rotativa {
  width: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.publicidad-rotativa.is-visible {
  opacity: 1;
}

.publicidad-rotativa-link {
  display: block;
  width: 100%;
}

.publicidad-rotativa img {
  width: 100%;
  height: auto;
  display: block;
}

/* Benefit Cards */
.benefit-card {
  background: var(--surface-color);
  padding: 28px;
  border-radius: 18px;
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid #efe6dd;
  box-shadow: 0 12px 28px rgba(24, 16, 10, 0.08);
}

.benefit-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 30px rgba(24, 16, 10, 0.12);
}

.benefit-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: white;
  font-size: 2rem;
}

/* Parts Feed */
.pieza-card {
  background: var(--surface-color);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid #efe6dd;
}

.pieza-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 30px rgba(24, 16, 10, 0.12);
}

.pieza-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--surface-alt);
}

.pieza-body {
  padding: 20px;
}

.pieza-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--dark-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pieza-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.pieza-seller {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

.seller-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  flex-shrink: 0;
}

.seller-avatar-img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #e9ecef;
}

.seller-info {
  flex: 1;
  min-width: 0;
}

.seller-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seller-location {
  font-size: 0.8rem;
  color: var(--secondary-color);
}

/* Botón de seguir en feed */
.pieza-seller .btn-outline-primary,
.pieza-seller .btn-success {
  padding: 4px 8px;
  font-size: 0.85rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.pieza-seller .btn-outline-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.pieza-seller .btn-success {
  background: #28a745;
  border-color: #28a745;
}

.pieza-seller .btn-success:hover {
  background: #218838;
  border-color: #1e7e34;
  transform: scale(1.05);
}

/* Promotion Cards */
.promocion-card {
  background: linear-gradient(135deg, #2f251c 0%, #7c3f12 55%, #b45309 100%);
  border-radius: 15px;
  overflow: hidden;
  color: white;
  position: relative;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 25px;
  box-shadow: 0 12px 26px rgba(22, 14, 8, 0.25);
  transition: transform 0.3s ease;
}

.promocion-card:hover {
  transform: scale(1.03);
}

.promocion-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}
.seller-cta {
  background-color: var(--promo-bg, #2f251c);
  background-image: var(--promo-image, none), linear-gradient(140deg, #2f251c 0%, #6f3b12 45%, #b45309 100%);
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay;
  min-height: 600px;
}

.seller-cta .badge.bg-warning {
  background: #f8c35f !important;
  color: #2b2017 !important;
}

.seller-cta .bg-white {
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.seller-cta .progress {
  background: rgba(255, 255, 255, 0.25);
}

.seller-cta .progress-bar {
  border-radius: 999px;
}

.promo-form-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 14px 30px rgba(24, 16, 10, 0.18);
}

.promo-form-header {
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.18), rgba(15, 118, 110, 0.15));
  color: #2b2017;
}

.promo-form-header h5 {
  font-weight: 700;
  margin: 0;
}

.promo-form-body {
  padding: 18px 20px 22px;
}

.promo-form-body .form-label {
  font-weight: 600;
  color: #3a2b20;
}

.promo-form-body .form-control,
.promo-form-body .form-control-color {
  border-radius: 12px;
  border-color: #eadfd4;
}

.promocion-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.promocion-description {
  opacity: 0.9;
  margin-bottom: 15px;
}

.promocion-price {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.promocion-seller {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

/* Desguaces Destacados */
.desguace-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7f5f2 100%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(22, 26, 29, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  border: 1px solid #efe7de;
}

.desguace-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 30px rgba(22, 26, 29, 0.14);
}

.desguace-image {
  width: 100%;
  height: 230px;
  object-fit: cover;
  background: #f8f9fa;
}

.desguace-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0;
  flex-wrap: wrap;
}

.desguace-thumb {
  border: 1px solid #e4dcd2;
  padding: 0;
  width: 54px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.desguace-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.desguace-thumb:hover {
  transform: translateY(-2px);
  border-color: #b58441;
}

.desguace-body {
  padding: 16px 18px 18px;
}

.desguace-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #2f2318;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.desguace-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: #c45b00;
  margin-bottom: 10px;
}

.desguace-meta {
  font-size: 0.85rem;
  color: #5a4c40;
}

.desguace-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.desguace-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.desguace-actions .btn {
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
}

/* Seller Stats */
.seller-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.stat-label {
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Footer */
footer a:hover {
  color: var(--primary-color) !important;
  transition: color 0.3s ease;
}

.social-links a {
  transition: transform 0.3s ease;
  display: inline-block;
}

.social-links a:hover {
  transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section {
    padding: 40px 0;
    min-height: auto;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .section-head-inline {
    align-items: flex-start;
  }

  .search-card {
    padding: 20px;
  }

  .benefit-badge {
    font-size: 0.85rem;
    padding: 8px 15px;
  }

  .display-4 {
    font-size: 2rem;
  }

  .display-6 {
    font-size: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  #piezas-feed,
  #desguaces-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  #piezas-feed > [class*="col-"],
  #desguaces-container > [class*="col-"] {
    flex: 0 0 82%;
    max-width: 82%;
    scroll-snap-align: start;
  }
}

/* Loading States */
.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3em;
}

/* Badges */
.badge-stock {
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 5px;
}

.badge-stock.disponible {
  background: var(--success-color);
}

.badge-stock.bajo {
  background: var(--warning-color);
  color: var(--dark-color);
}

.badge-stock.agotado {
  background: var(--danger-color);
}

/* VIN Input */
#vin-input {
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

/* Button Styles */
.btn {
  border-radius: 8px;
  padding: 10px 25px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #764ba2);
  border: none;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #0f5132);
  border: none;
}
