/* Estilos específicos para la apariencia de tienda */
:root{
  --primario:#ff69b4;
  --primario-hover:#ff1493;
  --acento:#667eea;
  --fondo:#f8f9fe;
  --card-bg:#ffffff;
  --text-dark:#2d3748;
  --text-light:#718096;
}

body {
  background: var(--fondo);
}

/* Hero Section Mejorado */
.shop-hero{
  width:100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  border-radius:20px;
  padding:40px 35px;
  margin:20px 0 30px 0;
  text-align:left;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:25px;
  box-shadow:0 20px 50px rgba(102, 126, 234, 0.3);
  position:relative;
  overflow:hidden;
}

.shop-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  filter: blur(40px);
}

.hero-content {
  flex: 1;
  z-index: 1;
}

.shop-hero h1{ 
  margin:0 0 12px 0; 
  font-size:36px; 
  color:#fff; 
  font-weight:800;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.shop-hero p{ 
  margin:0; 
  color:rgba(255,255,255,0.95); 
  font-size:16px;
  line-height:1.5;
}

.hero-subtitle {
  margin-top: 8px !important;
  font-size: 14px !important;
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
}

.hero-cart-badge {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px 30px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  z-index: 1;
}

.cart-icon-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 8px;
}

.cart-icon-wrapper i {
  font-size: 36px;
  color: var(--primario);
}

.cart-badge-number {
  position: absolute;
  top: -8px;
  right: -12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cart-label {
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 600;
}

/* Sección de filtros mejorada */
.filter-section {
  background: white;
  padding: 20px;
  border-radius: 16px;
  margin: 25px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.category-bar{ 
  display:flex; 
  gap:25px; 
  margin-bottom: 20px;
  flex-wrap:wrap;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
  justify-content: center;
}

.category-btn{ 
  flex: 1 1 auto;
  min-width: 180px;
  max-width: 280px;
  padding:16px 35px; 
  border-radius:30px; 
  background:#fff; 
  border:2px solid #e2e8f0; 
  cursor:pointer; 
  font-size:16px;
  font-weight:600;
  color: var(--text-dark);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  text-align: center;
  white-space: nowrap;
}

.category-btn:hover {
  border-color: var(--primario);
  color: var(--primario);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.2);
}

.category-btn.active{ 
  background: linear-gradient(135deg, var(--primario), var(--primario-hover)); 
  color:#fff; 
  border-color:var(--primario);
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.3);
}

/* Barra de búsqueda y ordenamiento */
.search-sort-bar {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.search-wrapper {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 16px;
}

.search-input-shop {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  font-size: 15px;
  transition: all 0.3s ease;
  background: #fafbfc;
}

.search-input-shop:focus {
  outline: none;
  border-color: var(--acento);
  background: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.sort-select {
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  background: #fafbfc;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px;
}

.sort-select:hover {
  border-color: var(--acento);
  background: white;
}

.sort-select:focus {
  outline: none;
  border-color: var(--acento);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* Header de productos */
.products-header {
  text-align: center;
  margin: 35px 0 30px 0;
}

.products-header h2 {
  font-size: 32px;
  color: var(--text-dark);
  font-weight: 800;
  margin: 0 0 10px 0;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.products-count {
  color: var(--text-light);
  font-size: 16px;
  font-weight: 500;
}

.products-count span {
  font-weight: 700;
  color: var(--primario);
}

/* Contenedor principal */
.productos-container { 
  width:100%; 
  max-width:1600px; 
  margin:0 auto; 
  padding:30px 50px; 
  box-sizing:border-box;
  min-height: 100vh;
}

/* Grid de productos mejorado y distribuido */
.productos-grid { 
  display:grid; 
  grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); 
  gap:30px; 
  align-items:stretch;
  margin-bottom: 50px;
  justify-content: center;
  padding: 20px 0;
}

/* Tarjetas de producto con mejor distribución */
.producto-card { 
  background:white; 
  border-radius:18px; 
  padding:25px; 
  box-shadow:0 4px 15px rgba(0,0,0,0.06); 
  position:relative; 
  overflow:visible; 
  display:flex; 
  flex-direction:column; 
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  cursor: pointer;
  border: 2px solid transparent;
  height: 100%;
  min-height: 280px;
}

.producto-card:hover{ 
  transform:translateY(-8px); 
  box-shadow:0 12px 35px rgba(102, 126, 234, 0.2);
  border-color: var(--acento);
}

.producto-card:focus{ 
  outline:none;
  border-color: var(--primario);
  transform:translateY(-8px); 
}
.producto-img { 
  width:100%; 
  height:140px; 
  object-fit:cover; 
  border-radius:12px; 
  background:linear-gradient(135deg, #ffeef8, #e3f2fd); 
  display:block; 
  margin:0;
  transition: transform 0.3s ease;
}

.producto-card:hover .producto-img {
  transform: scale(1.05);
}

/* Diseño circular de productos con mejor distribución */
.producto-circle .circle-wrap{ 
  width:160px; 
  height:160px; 
  border-radius:18px; 
  background:linear-gradient(135deg,#ffeef8,#e3f2fd); 
  display:flex; 
  align-items:center; 
  justify-content:center; 
  position:relative; 
  margin:0 auto 18px; 
  box-shadow:0 6px 20px rgba(102, 126, 234, 0.12);
  transition: all 0.3s ease;
  overflow: hidden;
}

.producto-circle:hover .circle-wrap {
  transform: scale(1.05);
  box-shadow:0 10px 30px rgba(102, 126, 234, 0.2);
}

.producto-circle .circle-wrap .producto-img{ 
  width:150px; 
  height:150px; 
  border-radius:14px;
  object-fit: cover;
}

.producto-circle .circle-wrap .circle-cart{ 
  position:absolute; 
  right:-5px; 
  bottom:-5px; 
  background:linear-gradient(135deg, var(--primario), var(--primario-hover)); 
  color:#fff; 
  border:3px solid #fff; 
  width:48px; 
  height:48px; 
  border-radius:50%; 
  display:flex; 
  align-items:center; 
  justify-content:center; 
  cursor:pointer; 
  box-shadow:0 6px 20px rgba(255, 105, 180, 0.35);
  font-size: 20px;
  transition: all 0.3s ease;
  z-index: 10;
}

.producto-circle .circle-wrap .circle-cart:hover {
  transform: scale(1.15) rotate(10deg);
  box-shadow:0 8px 25px rgba(255, 105, 180, 0.5);
}

.producto-circle .circle-meta{ 
  text-align:center; 
  padding: 0 10px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.producto-circle .circle-name{ 
  font-size:17px; 
  font-weight:700; 
  color:var(--text-dark); 
  line-height:1.4;
  margin-bottom: 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.producto-circle .circle-price{ 
  font-size:20px; 
  color:var(--primario); 
  font-weight:800; 
  background: rgba(255, 105, 180, 0.1);
  padding: 10px 20px;
  border-radius: 25px;
  display: inline-block;
  margin-top: auto;
}
.producto-info h3{ margin:0 0 6px 0; font-size:14px; }
.producto-info p{ margin:0 0 8px 0; color:#666; font-size:13px; }

/* Overlay en la imagen con nombre y precio (menos texto en la tarjeta) */
.card-media{ position:relative; border-radius:8px; overflow:visible; display:flex; flex-direction:column; align-items:center; gap:8px; padding-top:6px; }
.card-overlay{ position:static; left:auto; right:auto; bottom:auto; padding:0; background:transparent; color:#222; display:flex; justify-content:space-between; align-items:center; width:100%; }
.overlay-title{ font-weight:700; font-size:11px; color:#222; text-align:center; }
.overlay-price{ font-weight:800; background:rgba(45,156,219,0.12); color:var(--primario); padding:4px 6px; border-radius:999px; font-size:10px; }

/* Ocultar descripciones largas para enfatizar imágenes */
.producto-card p{ display:none; }

.card-actions{ display:flex; gap:6px; margin-top:6px; }
.btn-anadir{ flex:1; padding:7px; border:none; background:var(--primario); color:#fff; border-radius:6px; font-weight:700; cursor:pointer; font-size:13px; }

/* Toast de notificaciones */
.shop-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 18px 30px;
    background: #333;
    color: white;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.shop-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.shop-toast.success {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.shop-toast.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

/* Modal de cantidad */
.quantity-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.quantity-modal {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.quantity-modal h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.modal-product-name {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.qty-btn {
    width: 45px;
    height: 45px;
    border: 2px solid #4CAF50;
    background: white;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.qty-btn:hover {
    background: #4CAF50;
    color: white;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-input {
    width: 80px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-weight: bold;
}

.qty-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.btn-add-cart {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-add-cart:active {
    transform: translateY(0);
}

/* Toast notifications */
.shop-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 10001;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.shop-toast.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.shop-toast.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive - Mejor distribución en todos los tamaños */
@media (max-width:1400px) {
  .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
  }
}

@media (max-width:1024px) {
  .productos-container {
    padding: 25px 35px;
  }
  
  .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
  }
  
  .producto-circle .circle-wrap {
    width: 140px;
    height: 140px;
  }
  
  .producto-circle .circle-wrap .producto-img {
    width: 130px;
    height: 130px;
  }
}

@media (max-width:768px){ 
  .shop-hero{ 
    flex-direction:column; 
    text-align:center;
    padding: 30px 20px;
  }
  
  .shop-hero h1 {
    font-size: 28px;
  }
  
  .hero-cart-badge {
    padding: 15px 25px;
  }
  
  .filter-section {
    padding: 15px;
  }
  
  .category-bar {
    gap: 8px;
  }
  
  .category-btn {
    padding: 10px 18px;
    font-size: 14px;
  }
  
  .search-sort-bar {
    flex-direction: column;
  }
  
  .search-wrapper,
  .sort-select {
    width: 100%;
  }
  
  .productos-container {
    padding: 20px 15px;
  }
  
  .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px;
  }
  
  .producto-card {
    padding: 18px;
    min-height: 260px;
  }
  
  .producto-img{ 
    height: 120px;
  }
  
  .producto-circle .circle-wrap {
    width: 130px;
    height: 130px;
  }
  
  .producto-circle .circle-wrap .producto-img {
    width: 120px;
    height: 120px;
  }
  
  .producto-circle .circle-name {
    font-size: 15px;
    min-height: 42px;
  }
  
  .producto-circle .circle-price {
    font-size: 18px;
    padding: 8px 16px;
  }
}

@media (max-width:480px) {
  .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }
  
  .producto-circle .circle-wrap {
    width: 120px;
    height: 120px;
  }
  
  .producto-circle .circle-wrap .producto-img {
    width: 110px;
    height: 110px;
  }
  
  .producto-circle .circle-name {
    font-size: 14px;
  }
  
  .producto-circle .circle-price {
    font-size: 16px;
  }
}

/* Toast */
.shop-toast{ position:fixed; left:50%; transform:translateX(-50%); bottom:28px; background:#222; color:#fff; padding:12px 18px; border-radius:10px; box-shadow:0 8px 30px rgba(0,0,0,0.2); opacity:0; pointer-events:none; transition:all .25s ease; z-index:9999; }
.shop-toast.show{ opacity:1; transform:translateX(-50%) translateY(-6px); pointer-events:auto; }
.shop-toast.error{ background:#b00020; }

/* Imagen que vuela al carrito */
.fly-img{ border-radius:8px; pointer-events:none; box-shadow:0 10px 30px rgba(0,0,0,0.18); }

/* Modal quick view */
.quick-modal{ position:fixed; inset:0; display:flex; align-items:center; justify-content:center; z-index:9998; opacity:0; pointer-events:none; transition:opacity .18s ease; }
.quick-modal.show{ opacity:1; pointer-events:auto; }
.quick-modal-overlay{ position:absolute; inset:0; background:rgba(12,18,24,0.55); }
.quick-modal-content{ position:relative; width:min(940px,95%); background:#fff; border-radius:12px; padding:18px; box-shadow:0 18px 60px rgba(10,15,30,0.4); z-index:2; }
.quick-modal-close{ position:absolute; right:12px; top:12px; background:transparent;border:none;font-size:18px;cursor:pointer }
.quick-modal-body{ display:flex; gap:14px; align-items:flex-start; }
.quick-modal-img{ width:320px; max-width:40%; border-radius:8px; object-fit:cover; }
.quick-modal-info{ flex:1; }
.quick-modal-title{ margin:0 0 8px 0; font-size:20px; color:#111; }
.quick-modal-desc{ color:#555; margin-bottom:10px; }
.quick-modal-price{ font-weight:800; color:var(--primario); font-size:18px; }

@media (max-width:720px){ .quick-modal-body{ flex-direction:column; } .quick-modal-img{ width:100%; max-width:none; } }

/* Estilos para navegación de categorías y estado activo */
.category-btn.active{ background:var(--primario); color:#fff; border-color:var(--primario); }

/* Estado oculto para animación de filtrado */
.producto-card.hide{ 
  opacity:0; 
  transform:scale(.95); 
  pointer-events:none;
  transition: all 0.3s ease;
}
