/* ========================================
   MR Repuestos - Catalog Styles
   Paleta de colores oficial
   ======================================== */

:root {
  /* CSS HEX */
  --crushed-berry: #880d1eff;
  --raspberry: #dd2d4aff;
  --bubblegum-pink: #f26a8dff;
  --pink-mist: #f49cbbff;
  --light-cyan: #cbeef3ff;

  /* SCSS Gradient */
  --gradient-top: linear-gradient(0deg, #880d1eff, #dd2d4aff, #f26a8dff, #f49cbbff, #cbeef3ff);
  --gradient-right: linear-gradient(90deg, #880d1eff, #dd2d4aff, #f26a8dff, #f49cbbff, #cbeef3ff);
  --gradient-bottom: linear-gradient(180deg, #880d1eff, #dd2d4aff, #f26a8dff, #f49cbbff, #cbeef3ff);
  --gradient-left: linear-gradient(270deg, #880d1eff, #dd2d4aff, #f26a8dff, #f49cbbff, #cbeef3ff);
  --gradient-top-right: linear-gradient(45deg, #880d1eff, #dd2d4aff, #f26a8dff, #f49cbbff, #cbeef3ff);
  --gradient-bottom-right: linear-gradient(135deg, #880d1eff, #dd2d4aff, #f26a8dff, #f49cbbff, #cbeef3ff);
  --gradient-top-left: linear-gradient(225deg, #880d1eff, #dd2d4aff, #f26a8dff, #f49cbbff, #cbeef3ff);
  --gradient-bottom-left: linear-gradient(315deg, #880d1eff, #dd2d4aff, #f26a8dff, #f49cbbff, #cbeef3ff);
  --gradient-radial: radial-gradient(#880d1eff, #dd2d4aff, #f26a8dff, #f49cbbff, #cbeef3ff);

  /* Additional Colors */
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --medium-gray: #6c757d;
  --dark-gray: #343a40;
  --black: #000000;
}

/* ========================================
   Global Styles
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--light-gray);
  color: var(--dark-gray);
  overflow-x: hidden;
}

/* ========================================
   Utilities
   ======================================== */

.clickable {
  cursor: pointer;
}

/* ========================================
   Navbar
   ======================================== */

.navbar {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(136, 13, 30, 0.1);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--crushed-berry) !important;
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-brand i {
  color: var(--raspberry);
}

.brand-text {
  background: var(--gradient-right);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link {
  color: var(--dark-gray) !important;
  font-weight: 500;
  margin: 0 0.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-right);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

.nav-link:hover {
  color: var(--raspberry) !important;
}

.btn-login {
  background: var(--gradient-right);
  color: var(--white) !important;
  border-radius: 25px;
  padding: 0.5rem 1.5rem !important;
  font-weight: 600;
}

.btn-login::after {
  display: none;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(136, 13, 30, 0.3);
}

/* ========================================
   Hero Section
   ======================================== */

.hero-section {
  background: var(--gradient-bottom-right);
  color: var(--white);
  padding: 4rem 0;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.hero-section h1,
.hero-section p {
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Filters Section
   ======================================== */

.filters-section {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.input-group-text {
  background: var(--gradient-right);
  color: var(--white);
  border: none;
}

.form-control,
.form-select {
  border: 2px solid var(--light-cyan);
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--raspberry);
  box-shadow: 0 0 0 0.2rem rgba(221, 45, 74, 0.25);
}

.btn-secondary {
  background: var(--medium-gray);
  border: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--dark-gray);
  transform: translateY(-2px);
}

/* ========================================
   Products Section
   ======================================== */

.products-section {
  min-height: 400px;
}

.section-title {
  color: var(--crushed-berry);
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-title i {
  color: var(--raspberry);
}

/* Product Card */
.product-card {
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 2px solid transparent;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(136, 13, 30, 0.2);
  border-color: var(--raspberry);
}

.product-image-container {
  width: 100%;
  height: 220px;
  background: var(--gradient-radial);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-image-container.clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-image-container.clickable:hover {
  transform: scale(1.02);
}

.product-image-container.clickable:focus {
  outline: 3px solid var(--raspberry);
  outline-offset: 2px;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(136, 13, 30, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: var(--white);
  z-index: 2;
  pointer-events: none;
}

.product-image-container:hover .image-overlay,
.product-image-container:focus .image-overlay {
  opacity: 1;
}

.image-overlay i {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  animation: pulse 2s infinite;
}

.image-overlay span {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.1);
}

.product-no-image {
  color: var(--white);
  font-size: 4rem;
  opacity: 0.7;
}

.stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stock-available {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: var(--white);
}

.stock-low {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  color: var(--white);
}

.stock-out {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: var(--white);
}

.product-body {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--raspberry);
  background: rgba(242, 106, 141, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--crushed-berry);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  min-height: 2.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  font-size: 0.875rem;
  color: var(--medium-gray);
  margin-bottom: 1rem;
  line-height: 1.5;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-details {
  margin-top: auto;
}

.product-brand {
  font-size: 0.875rem;
  color: var(--medium-gray);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.product-brand i {
  color: var(--bubblegum-pink);
  margin-right: 0.5rem;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 2px solid var(--light-cyan);
}

.product-price {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--gradient-right);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.product-stock {
  font-size: 0.875rem;
  color: var(--medium-gray);
  display: flex;
  align-items: center;
}

.product-stock i {
  margin-right: 0.4rem;
  color: var(--raspberry);
}

/* ========================================
   Loading & No Results
   ======================================== */

.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3rem;
}

#noResults i {
  color: var(--pink-mist);
}

/* ========================================
   Footer
   ======================================== */

.footer {
  background: var(--gradient-bottom);
  color: var(--white);
}

.footer h5 {
  color: var(--white);
  position: relative;
  padding-bottom: 0.5rem;
}

.footer h5::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--light-cyan);
  border-radius: 2px;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.footer a:hover {
  color: var(--light-cyan);
  padding-left: 5px;
}

.footer li {
  margin-bottom: 0.5rem;
}

.footer hr {
  border-color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Large Screens */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

/* Tablets */
@media (max-width: 991px) {
  .hero-section {
    padding: 3rem 0;
  }

  .hero-section h1 {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .product-image-container {
    height: 200px;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
  }
  
  .filters-section {
    padding: 1.5rem;
  }
  
  .navbar-nav {
    margin-top: 1rem;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .navbar-brand {
    font-size: 1.25rem;
  }

  .hero-section {
    padding: 2rem 0;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .hero-section p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.5rem;
    text-align: center;
  }

  .product-card {
    max-width: 400px;
    margin: 0 auto;
  }

  .product-image-container {
    height: 250px;
  }

  .filters-section .col-md-2,
  .filters-section .col-md-3,
  .filters-section .col-md-4 {
    margin-bottom: 0.5rem;
  }
  
  .filters-section {
    padding: 1rem;
  }
  
  .filters-section .form-control,
  .filters-section .form-select {
    font-size: 0.875rem;
  }

  .footer .col-md-4 {
    text-align: center;
    margin-bottom: 2rem;
  }

  .footer h5::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .btn-view-details {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* Small Mobile */
@media (max-width: 575px) {
  .hero-section {
    padding: 1.5rem 0;
  }
  
  .hero-section h1 {
    font-size: 1.75rem;
  }
  
  .hero-section p {
    font-size: 0.9rem;
  }

  .product-price {
    font-size: 1.5rem;
  }

  .product-name {
    font-size: 1rem;
  }

  .product-image-container {
    height: 200px;
  }
  
  .filters-section {
    padding: 0.75rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .footer {
    padding: 2rem 0 1rem;
  }
  
  .footer h5 {
    font-size: 1rem;
  }
  
  .footer p,
  .footer ul li a {
    font-size: 0.875rem;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .btn-contact {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeIn 0.5s ease-out;
}

/* Stagger animation for cards */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }

/* ========================================
   Utility Classes
   ======================================== */

.text-gradient {
  background: var(--gradient-right);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient {
  background: var(--gradient-bottom-right);
}

.shadow-custom {
  box-shadow: 0 5px 20px rgba(136, 13, 30, 0.15);
}

/* ========================================
   Product Detail Modal
   ======================================== */

#productDetailModal .modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#productDetailModal .modal-header {
  background: var(--gradient-right);
  color: var(--white);
  border-radius: 16px 16px 0 0;
  padding: 1.5rem;
  border-bottom: none;
}

#productDetailModal .modal-title {
  font-weight: 700;
  font-size: 1.5rem;
}

#productDetailModal .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

#productDetailModal .btn-close:hover {
  opacity: 1;
}

.product-detail-container {
  padding: 1rem;
}

.product-detail-image-container {
  position: relative;
  width: 100%;
  background: var(--light-gray);
  border-radius: 12px;
  overflow: hidden;
  padding: 1rem;
}

.product-detail-image {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
}

.product-detail-no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--medium-gray);
}

.product-detail-no-image i {
  font-size: 5rem;
  opacity: 0.3;
}

.stock-indicator {
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
}

.stock-indicator.stock-available {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
  color: #28a745;
  border: 2px solid rgba(40, 167, 69, 0.3);
}

.stock-indicator.stock-low {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
  color: #ffc107;
  border: 2px solid rgba(255, 193, 7, 0.3);
}

.stock-indicator.stock-out {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
  color: #dc3545;
  border: 2px solid rgba(220, 53, 69, 0.3);
}

.product-detail-info {
  padding: 1rem 0;
}

.product-detail-header {
  margin-bottom: 1.5rem;
}

.product-detail-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--crushed-berry);
  margin: 0.5rem 0;
  line-height: 1.3;
}

.product-detail-code {
  font-size: 0.95rem;
  margin: 0.5rem 0;
}

.product-detail-price-section {
  background: linear-gradient(135deg, var(--raspberry), var(--crushed-berry));
  color: var(--white);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  margin: 1.5rem 0;
  box-shadow: 0 4px 15px rgba(136, 13, 30, 0.2);
}

.product-detail-price {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.product-detail-section {
  margin: 1.5rem 0;
}

.product-detail-section .section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--crushed-berry);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.product-detail-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dark-gray);
  margin: 0;
}

.product-specs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--light-gray);
  border-radius: 8px;
  border-left: 4px solid var(--raspberry);
}

.spec-item i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.spec-item strong {
  min-width: 100px;
  color: var(--dark-gray);
}

.spec-item span {
  color: var(--medium-gray);
}

.availability-info {
  padding: 1rem;
  background: var(--light-gray);
  border-radius: 8px;
}

.availability-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.availability-badge.stock-available {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: var(--white);
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.availability-badge.stock-low {
  background: linear-gradient(135deg, #ffc107, #ffb300);
  color: var(--white);
  box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
}

.availability-badge.stock-out {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: var(--white);
  box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

.bg-gradient-primary {
  background: var(--gradient-right) !important;
  color: var(--white) !important;
  border: none;
}

/* Modal Responsive Design */
@media (max-width: 768px) {
  #productDetailModal .modal-dialog {
    margin: 0.5rem;
  }
  
  .product-detail-name {
    font-size: 1.4rem;
  }
  
  .product-detail-price {
    font-size: 2rem;
  }
  
  .product-detail-image {
    max-height: 250px;
  }
  
  .availability-badge {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }
}

@media (max-width: 576px) {
  #productDetailModal .modal-header {
    padding: 1rem;
  }
  
  #productDetailModal .modal-title {
    font-size: 1.2rem;
  }
  
  .product-detail-price-section {
    padding: 1rem;
  }
  
  .spec-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .spec-item strong {
    min-width: auto;
  }
}
