/* tienda.css - Estilos modernos actualizados con paleta de index.php */
:root {
  --primary: #e91e63;
  --primary-light: #f8bbd9;
  --primary-dark: #c2185b;
  --secondary: #9c27b0;
  --secondary-light: #e1bee7;
  --accent: #ff4081;
  --success: #4caf50;
  --warning: #ff9800;
  --dark: #2d3748;
  --light: #f8f9fa;
  --gray-light: #f5f5f5;
  --border: #e0e0e0;
  --gradient: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
  --gradient-light: linear-gradient(135deg, #f8bbd9 0%, #e1bee7 100%);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Header de la tienda */
.tienda-header {
    text-align: center;
    padding: 3rem 0;
    background: var(--gradient);
    color: white;
    margin-bottom: 3rem;
}

.tienda-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.tienda-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid de productos */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
  padding: 0 1rem;
}

.product-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  border-radius: 12px;
  /*margin-bottom: 1rem;*/
  transition: all 0.3s ease;
  background-color: var(--light);
  /*adding: 1rem;*/
}

.product-card:hover .product-image {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.product-card h3 {
  color: var(--dark);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.4;
}

.product-card p {
  color: var(--dark);
  opacity: 0.8;
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  min-height: 40px;
}

.product-card .price {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  display: block;
  font-weight: 700;
}

.product-card form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.product-card input[type="number"] {
  width: 80px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-size: 1rem;
  background: var(--light);
  transition: all 0.3s ease;
}

.product-card input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.product-card button {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  flex: 1;
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.product-card button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.product-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 30, 99, 0.3);
}

.product-card button:hover::before {
  left: 100%;
}

.product-card button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.product-card button:disabled:hover::before {
  left: -100%;
}

.stock-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--success);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 10;
  box-shadow: var(--shadow);
}

.stock-badge.low-stock {
  background: var(--warning);
}

.stock-badge.out-of-stock {
  background: #f44336;
}

/* Mejoras para el carrito */
.cart-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  position: relative;
  transition: transform 0.2s ease;
}

.cart-btn:hover {
  transform: scale(1.1);
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid white;
  box-shadow: var(--shadow);
}

.cart-menu {
  position: absolute;
  right: 0;
  top: 100%;
  width: 380px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-hover);
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-menu.open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gradient);
  color: white;
  border-radius: 16px 16px 0 0;
}

.cart-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.close-cart {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.close-cart:hover {
  opacity: 1;
}

.cart-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.cart-item:hover {
  background: var(--light);
  border-color: var(--primary-light);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  background-color: var(--light);
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  line-height: 1.3;
}

.cart-item-price {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.quantity-btn {
  background: var(--light);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}

.quantity-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.remove-btn {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.remove-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.1);
}

.cart-summary {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--light);
  border-radius: 0 0 16px 16px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
}

.cart-actions {
  display: flex;
  gap: 0.75rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  transition: all 0.3s ease;
  flex: 1;
  font-size: 0.9rem;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gradient);
  color: white;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 30, 99, 0.3);
}

/* Empty cart state */
.cart-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--dark);
  opacity: 0.7;
}

.cart-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.cart-empty p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* Scroll personalizado para el carrito */
.cart-list::-webkit-scrollbar {
  width: 6px;
}

.cart-list::-webkit-scrollbar-track {
  background: var(--light);
  border-radius: 10px;
}

.cart-list::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.cart-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Animaciones de agregar al carrito */
@keyframes addToCart {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.added-to-cart {
  animation: addToCart 0.3s ease;
}

/* Checkout styles */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    padding: 0 1rem;
}

.order-summary, .payment-form {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.order-summary::before,
.payment-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--primary);
    color: var(--dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--light);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: white;
}

/* Orders list */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
}

.order-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.order-header, .order-body {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    align-items: center;
}

/* Estados de pedidos */
.estado-confirmado {
    background: var(--success);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.estado-pendiente {
    background: var(--warning);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.estado-cancelado {
    background: #f44336;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.estado-entregado {
    background: var(--secondary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Botones de estado actualizados */
.btn.danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 600;
}

.btn.danger:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* Imágenes para favoritos y otros */
.favorito-image {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background-color: var(--light);
    padding: 0.5rem;
}

.item-imagen {
    width: 60px;
    height: 60px;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    background-color: var(--light);
    padding: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  
  .cart-menu {
    width: 90vw;
    right: 5vw;
    left: 5vw;
  }
  
  .checkout-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .tienda-header h1 {
    font-size: 2.5rem;
  }
  
  .order-header, .order-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  .cart-menu {
    width: 95vw;
    right: 2.5vw;
    left: 2.5vw;
  }
  
  .cart-actions {
    flex-direction: column;
  }
  
  .tienda-header {
    padding: 2rem 1rem;
  }
  
  .tienda-header h1 {
    font-size: 2rem;
  }
  
  .tienda-header p {
    font-size: 1rem;
  }
  
  .product-card {
    padding: 1.25rem;
  }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .cart-btn,
  .btn,
  .cart-item,
  .quantity-btn,
  .remove-btn {
    transition: none !important;
    animation: none !important;
  }
  
  .product-card:hover,
  .btn:hover,
  .cart-item:hover {
    transform: none !important;
  }
}
