/* =====================================================
   STORE VIEW - Estilos para la vista de tienda individual
   ===================================================== */

/* Variables CSS personalizadas */
:root {
  --store-primary: #3b82f6;
  --store-secondary: #10b981;
  --store-accent: #f59e0b;
  --store-danger: #ef4444;
  --store-success: #22c55e;
  
  --text-dark: #1e293b;
  --text-body: #475569;
  --text-muted: #94a3b8;
  
  --bg-body: #ffffff;
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* =====================================================
   STORE HEADER
   ===================================================== */

.store-header {
  background: var(--bg-light);
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.store-info {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.store-logo-wrapper {
  width: 120px;
  height: 120px;
  border-radius: 1rem;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-logo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-details h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.store-details p {
  color: var(--text-body);
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* =====================================================
   SOCIAL BUTTONS
   ===================================================== */

.social-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.social-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: white;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: white;
}

.social-btn.whatsapp {
  background: #25D366;
}

.social-btn.facebook {
  background: #1877F2;
}

.social-btn.instagram {
  background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF, #515BD4);
}

.social-btn.twitter {
  background: #1DA1F2;
}

.social-btn.youtube {
  background: #FF0000;
}

/* =====================================================
   SEARCH & FILTERS
   ===================================================== */

.search-filter-section {
  background: var(--bg-light);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.search-wrapper {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-input-group {
  flex: 1;
  position: relative;
}

.search-input-group input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input-group input:focus {
  outline: none;
  border-color: var(--store-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input-group::before {
  content: "\F52A";
  font-family: bootstrap-icons;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-btn {
  background: var(--store-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.search-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* =====================================================
   CATEGORY FILTERS
   ===================================================== */

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.category-label {
  font-weight: 600;
  color: var(--text-dark);
  margin-right: 0.5rem;
}

.filter-badge {
  background: white;
  color: var(--text-body);
  border: 2px solid var(--border-color);
  padding: 0.375rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.filter-badge:hover {
  border-color: var(--store-primary);
  color: var(--store-primary);
  transform: translateY(-1px);
}

.filter-badge.active {
  background: var(--store-primary);
  color: white;
  border-color: var(--store-primary);
}

/* =====================================================
   PRODUCT GRID
   ===================================================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.product-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--store-primary);
}

.product-image-wrapper {
  position: relative;
  overflow: hidden;
  height: 250px;
  background: var(--bg-light);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.no-image-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 3rem;
}

.product-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--store-primary);
  margin-bottom: 0.75rem;
}

.product-description {
  color: var(--text-body);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.product-tag {
  background: var(--bg-light);
  color: var(--text-body);
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* =====================================================
   STOCK INFORMATION
   ===================================================== */

.stock-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
}

.stock-badge.in-cart {
  color: var(--store-primary);
}

.stock-badge.available {
  color: var(--store-success);
}

.stock-badge.warning {
  color: var(--store-accent);
}

.stock-badge.out-of-stock {
  color: var(--store-danger);
}

/* =====================================================
   PRODUCT ACTIONS
   ===================================================== */

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  padding-top: 0;
}

.btn-add-cart {
  background: var(--store-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.btn-add-cart:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-add-cart:disabled {
  background: var(--bg-light);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.btn-view-details {
  background: transparent;
  color: var(--store-primary);
  border: 2px solid var(--store-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.btn-view-details:hover {
  background: var(--store-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.stock-alert {
  background: var(--bg-light);
  padding: 0.75rem;
  border-radius: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.stock-alert.warning {
  background: #fef3c7;
  color: #92400e;
}

.stock-alert.error {
  background: #fee2e2;
  color: #991b1b;
}

.stock-alert.info {
  background: #dbeafe;
  color: #1e40af;
}

/* =====================================================
   FLOATING CART
   ===================================================== */

.floating-cart {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--store-primary);
  color: white;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
  text-decoration: none;
  transition: all 0.3s ease;
  z-index: 1000;
}

.floating-cart:hover {
  transform: scale(1.1);
  background: #2563eb;
  color: white;
  text-decoration: none;
}

.floating-cart i {
  font-size: 1.5rem;
}

.cart-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background: var(--store-danger);
  color: white;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.floating-cart.bounce {
  animation: cartBounce 0.6s ease;
}

@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.2); }
  60% { transform: scale(0.9); }
}

/* =====================================================
   EMPTY STATES
   ===================================================== */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
}

.empty-state h3 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.no-results {
  background: var(--bg-light);
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
  margin: 2rem 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
  .store-info {
    flex-direction: column;
    text-align: center;
  }
  
  .store-logo-wrapper {
    margin: 0 auto;
  }
  
  .social-buttons {
    justify-content: center;
  }
  
  .search-wrapper {
    flex-direction: column;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  .product-image-wrapper {
    height: 200px;
  }
  
  .floating-cart {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-body {
    padding: 1rem;
  }

  .product-actions {
    padding: 1rem;
  }

  .product-title {
    font-size: 1rem;
  }

  .product-price {
    font-size: 1.25rem;
  }
}

/* =====================================================
   OVERRIDE PARA CARD-MERCANA-PRODUCT EN ESTE GRID
   ===================================================== */

.products-grid .card-mercana-product {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
}

.products-grid .card-mercana-product:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--store-primary);
}

.products-grid .card-mercana-product-image {
  position: relative;
  overflow: hidden;
  height: 250px !important;
  max-height: 250px !important;
  aspect-ratio: unset !important;
  background: var(--bg-light);
}

.products-grid .card-mercana-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.products-grid .card-mercana-product:hover .card-mercana-product-image img {
  transform: scale(1.05);
}

.products-grid .card-mercana-product-image .no-image {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 3rem;
}

@media (max-width: 768px) {
  .products-grid .card-mercana-product-image {
    height: 200px !important;
    max-height: 200px !important;
  }
}