/* ========== VARIABLES GLOBALES Y RESET ========== */
/* ESTILOS QUE SE MUESTRA EN CARRITO.PHP Y PRODUCTOS.PHP*/
:root {
  --primary-color: #d4af37; /* Dorado */
  --secondary-color: #e67300; /* Naranja */
  --dark-color: #1f1e1e;
  --text-color: #333;
  --background-color: #fdfdfd;
  --surface-color: #fff;
  --danger-color: #e74c3c;
  --success-color: #27ae60;
  --border-radius: 8px;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

/* ========== COMPONENTES REUTILIZABLES ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px; /* Botones más redondeados */
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--secondary-color);
  color: white;
}
.btn-primary:hover {
  background-color: #cc5200;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}
.btn-danger:hover { background-color: #c0392b; }

.btn-success {
  background-color: var(--success-color);
  color: white;
}
.btn-success:hover { background-color: #229954; }

/* ========== ENCABEZADO Y NAVEGACIÓN ========== */
header {
  background-color: var(--dark-color);
  padding: 20px;
  text-align: center;
}

header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: white;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--surface-color);
  padding: 15px 0;
  display: flex;
  justify-content: center;
  gap: 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}

.navbar a:hover, .navbar a:hover i {
  color: var(--primary-color);
}

/* ========== SECCIONES DE PRODUCTOS ========== */
.product-section {
  margin-bottom: 50px;
}

.product-section h2 {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  margin-bottom: 30px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
}

/* ========== TARJETA DE PRODUCTO (NUEVO DISEÑO) ========== */
.product-card {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.product-card-image {
  width: 100%;
  aspect-ratio: 1 / 1; /* Mantiene la imagen cuadrada */
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ajusta la imagen sin deformarla */
  transition: transform 0.4s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: center;
}

.product-name {
  font-size: 1.1rem;
  margin-bottom: 10px;
  flex-grow: 1; /* Empuja el precio y botón hacia abajo */
}

.product-price {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

/* ========== PÁGINA DEL CARRITO ========== */
.cart-container {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 30px;
  max-width: 900px;
  margin: 30px auto;
}

.cart-container h2 {
  font-family: 'Playfair Display', serif;
  text-align: center;
  margin-bottom: 25px;
}

.cart-empty-message {
  display: none; /* Se activa con JS */
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px;
  text-align: center;
  color: #666;
}

.cart-empty-message i {
  font-size: 4rem;
  color: #ccc;
}

#cart-list {
  list-style: none;
  margin-bottom: 30px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
}
.cart-item-info span { color: #777; font-size: 0.9em; }

.cart-item-controls { display: flex; align-items: center; gap: 10px; }
.btn-qty {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid #ccc; background: #f9f9f9;
  cursor: pointer; font-size: 1.2rem;
}

.btn-remove {
  background: none; border: none; font-size: 1.3rem; color: var(--danger-color); cursor: pointer;
}

.cart-summary {
  text-align: right;
  border-top: 2px solid var(--primary-color);
  padding-top: 20px;
}

.cart-summary h3 { font-size: 1.5rem; margin-bottom: 20px; }
.cart-actions { display: flex; justify-content: flex-end; gap: 15px; }
#btn-next { min-width: 150px; }

/* ========== CARRUSEL DE RECOMENDADOS ========== */
.recommended-products {
  margin-top: 50px;
}
.recommended-products h2 {
  text-align: center;
  font-family: 'Playfair Display', serif;
  margin-bottom: 30px;
}

.carousel-container {
  position: relative;
}

.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 20px;
  padding-bottom: 20px; /* Espacio para la barra de scroll */
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
.carousel::-webkit-scrollbar { display: none; } /* Chrome, Safari, Opera */

.carousel-item {
  flex: 0 0 280px; /* Ancho fijo para cada item del carrusel */
  scroll-snap-align: start;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 45px; height: 45px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
}
.carousel-btn.prev { left: -20px; }
.carousel-btn.next { right: -20px; }


/* ========== NOTIFICACIÓN ========== */
.notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(200%);
  background-color: var(--dark-color);
  color: white;
  padding: 15px 25px;
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  z-index: 2000;
  transition: transform 0.4s ease-in-out;
}
.notification.show {
  transform: translateX(-50%) translateY(0);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .cart-item {
    grid-template-columns: 1fr auto;
    row-gap: 10px;
  }
  .cart-item-info { grid-column: 1 / 2; }
  .cart-item-controls { grid-column: 1 / 2; justify-content: flex-start; }
  .cart-item-subtotal { grid-column: 2 / 3; grid-row: 1 / 3; text-align: right; }
  .cart-item-remove { grid-column: 2 / 3; grid-row: 1 / 3; align-self: flex-start; }

  .cart-actions { flex-direction: column; align-items: stretch; text-align: center; }
  .carousel-btn { display: none; } /* Ocultar flechas en móvil, se usa el swipe */
}