/* Estilos para el indicador de stock */
.stock-indicator {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-indicator.in-stock {
    background-color: #28a745; /* Verde éxito */
    color: #fff;
}

.stock-indicator.out-of-stock {
    background-color: #dc3545; /* Rojo peligro */
    color: #fff;
}

/* --- Estilos para la Página de Detalles del Producto --- */

/* --- Estilos para el Loader de Scroll Infinito --- */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    width: 100%;
}

.loader-icon {
    border: 4px solid #f3f3f3; /* Gris claro */
    border-top: 4px solid #e63946; /* Rojo de la marca */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.detalle-producto-main {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px;
    padding: 40px 20px;
    max-width: 1300px;
    margin: 40px auto;
}

/* Galería de Imágenes */
.detalle-images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 1px solid #e5e5e5;
}

/* Información del Producto */
.detalle-info {
    font-family: Arial, sans-serif;
}

.detalle-info .product-brand {
    font-size: 1em;
    color: #666;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight: bold;
}

.detalle-info h1 {
    font-size: 2.2em;
    margin: 5px 0;
    text-align: left;
    font-weight: bold;
}

.detalle-info .ref {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.detalle-info .price {
    font-size: 1.8em;
    font-weight: bold;
    color: #000;
    margin: 20px 0;
}

/* Sección de Tallas */
.sizes-section .section-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.size-box {
    border: 1px solid #ccc;
    padding: 12px 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.size-box:hover, .size-box.selected {
    border-color: #000;
    background-color: #fff;
}

/* Enlaces y Opciones Adicionales */
.product-links {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.product-links a {
    color: #000;
    text-decoration: none;
    font-size: 0.9em;
}

.extra-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background-color: #f7f7f7;
    margin: 20px 0;
    font-size: 0.9em;
}

.extra-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.payment-info {
    font-size: 0.9em;
    margin: 20px 0;
}

.payment-info a {
    color: #000;
    font-weight: bold;
}

/* Botón de Agregar al Carrito */
.add-to-cart-btn {
    background-color: #000;
    color: white;
    border: none;
    padding: 18px 25px;
    cursor: pointer;
    font-size: 1em;
    width: 100%;
    transition: background-color 0.3s;
    text-transform: uppercase;
}

.add-to-cart-btn:hover {
    background-color: #333;
}

/* --- Productos Relacionados --- */
.related-products-section {
    padding: 40px 20px;
    max-width: 1300px;
    margin: 40px auto;
}

.related-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.related-header h3 {
    font-size: 1.5em;
    margin: 0;
}

.related-nav .nav-arrow {
    background: none;
    border: 1px solid #ccc;
    padding: 10px 15px;
    cursor: pointer;
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}
.nav-list li {
  margin: 0 15px;
  position: relative;
}
.nav-list a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 5px 0;
}
.dropdown-menu {
  display: none;
  position: absolute;
  background-color: #222;
  list-style: none;
  padding: 10px;
  border-radius: 5px;
}
.dropdown:hover .dropdown-menu {
  display: block;
}
.dropdown-menu li {
  margin-bottom: 5px;
}

/* Layout Principal */
body {
  font-family: Arial, sans-serif;
  background-color: #f2f2f2;
  margin: 0;
}

.main-container {
  max-width: 1200px;
  margin: 2em auto;
  padding: 0 2em;
  background-color: white;
  border-radius: 10px;
  padding: 2em;
}

.page-title {
  text-align: center;
  margin-bottom: 1.5em;
  font-size: 2.2em;
  color: #333;
}

/* Grid de Productos */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.product-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card__image-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0; /* Rounded corners only at the top */
}

.product-card__image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card__image {
    transform: scale(1.05);
}

.product-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    color: white;
    font-size: 2.5rem;
    border-radius: 12px 12px 0 0;
}

.product-card:hover .product-card__overlay {
    opacity: 1;
}

.product-card__info {
    padding: 15px;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Dejar espacio para los elementos posicionados absolutamente */
    padding-bottom: 120px; 
}

.product-card__brand {
    font-size: 0.8em;
    color: #888;
    text-transform: uppercase;
    margin: 0 0 4px 0;
    font-weight: bold;
}

.product-card__brand.rgb-text {
    background: linear-gradient(90deg, red, blue, green);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stock-indicator {
    font-size: 0.75em;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 5px;
    display: inline-block;
    margin-bottom: 8px;
}

.stock-indicator.in-stock {
    background-color: #e9f5ec;
    color: #28a745;
    border: 1px solid #b8e0c2;
}

.stock-indicator.out-of-stock {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

.product-card__name {
    font-size: 1em;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin: 0 0 10px 0;
    flex-grow: 1;
}

.product-card__price {
    font-size: 1.2em;
    font-weight: 700;
    color: #d90429;
    margin: 0;
}

.product-card__talla-select {
    position: absolute;
    bottom: 70px;
    left: 15px;
    width: calc(100% - 30px);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    font-size: 0.9em;
    box-sizing: border-box;
}

.product-card__add-to-cart-btn {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: calc(100% - 30px);
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.product-card__add-to-cart-btn:hover:not(:disabled) {
    background-color: #333;
}

.product-card__add-to-cart-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Efecto Hover en Tarjeta - Clonado de index.html */
.producto .overlay-text {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  background-color: rgba(17, 17, 17, 0.8);
  color: white;
  padding: 0.5em 1.2em;
  border-radius: 5px;
  font-weight: bold;
  opacity: 0;
  transition: 
    opacity 0.3s ease,
    transform 0.3s ease,
    top 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.producto:hover .overlay-text {
  opacity: 1;
  top: 50%;
  transform: translate(-50%, -50%) scale(1.1);
  pointer-events: auto;
}

.producto .overlay-text:hover {
  animation: bounce 0.6s;
}

@keyframes bounce {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1.1);
  }
  50% {
    transform: translate(-50%, -60%) scale(1.2);
  }
}

/* Botón Ver Más */
.ver-mas-container {
  text-align: center;
  margin: 40px 0 20px 0;
}

.btn-ver-mas {
  background-color: #111;
  color: white;
  border: 2px solid #111;
  padding: 0.8em 2.5em;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  font-size: 1em;
}

.btn-ver-mas:hover {
  background-color: white;
  color: #111;
}

/* === RGB Text Effect (MACS Brand) === */
.rgb-text {
    animation: rgb-animation 4s infinite linear;
    font-weight: bold;
}

@keyframes rgb-animation {
    0% { color: #ff0000; }
    15% { color: #ff7f00; }
    30% { color: #ffff00; }
    45% { color: #00ff00; }
    60% { color: #0000ff; }
    75% { color: #4b0082; }
    90% { color: #9400d3; }
    100% { color: #ff0000; }
}

/* Estilos para el contenedor de productos en páginas de categorías */

.product-card__image-container {
    position: relative;
    display: block;
}

.product-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: bold;
    border-radius: 8px; /* Coincide con el contenedor de la imagen */
}

.product-card__image-container:hover .product-card__overlay {
    opacity: 1;
}

/* Estilos para el indicador de stock */
.product-card__stock {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    color: #fff;
    text-align: center;
    margin: 8px auto 4px;
    display: inline-block;
    letter-spacing: 0.5px;
}

.product-card__stock.available {
    background-color: #28a745; /* Verde */
}

.product-card__stock.unavailable {
    background-color: #dc3545; /* Rojo */
}

.product-card__image-container:hover .product-card__overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.product-card__overlay:hover {
    background-color: rgba(0, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.05);
}

/* --- Estilos para la sección de Stock y Cantidad --- */

.stock-section {
    margin: 25px 0;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.stock-title {
    font-weight: bold;
    font-size: 0.9em;
    margin: 0 0 10px 0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-selector label {
    font-size: 0.9em;
}

#quantity-select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}

.stock-available {
    font-size: 0.85em;
    color: #666;
}

.stock-agotado {
    font-weight: bold;
    color: #d9534f; /* Rojo */
    font-size: 1.1em;
}

.add-to-cart-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    color: #666;
}
