/* =========================================================
   DEMO 3: CATÁLOGO DIGITAL CON DETALLES Y RESEÑAS - CSS
   ========================================================= */

:root {
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --primary: #d97706;          /* Ámbar/Café cálido */
  --primary-hover: #b45309;
  --border-color: #e2e8f0;
  --gold: #f59e0b;
  --whatsapp: #25d366;

  --font: 'Outfit', sans-serif;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.5;
}

/* 1. HEADER DE LA TIENDA */
.store-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}

.store-cover {
  height: 160px;
  overflow: hidden;
  position: relative;
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-info-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.store-logo-wrapper {
  margin-top: -45px;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 2;
}

.store-logo {
  width: 85px;
  height: 85px;
  border-radius: 50%;
  border: 4px solid var(--card-bg);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.4rem;
}

.status-pill.open {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
}

.store-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.store-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.store-rating-badge {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.store-rating-badge .stars {
  font-weight: 700;
  color: var(--gold);
}

.rating-count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.store-meta {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.store-meta i { color: var(--primary); }

/* 2. NAVEGACIÓN Y FILTROS (STICKY) */
.catalog-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1rem 0.5rem;
}

.search-box {
  max-width: 900px;
  margin: 0 auto 0.75rem;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  background-color: #ffffff;
}

.categories-scroll {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar { display: none; }

.cat-btn {
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.cat-btn.active, .cat-btn:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* 3. GRILLA DE PRODUCTOS CON IMÁGENES UNIFORMES Y COMPLETAS */
.catalog-container {
  max-width: 900px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* Contenedor uniforme */
.product-img-wrapper {
  height: 180px;
  position: relative;
  overflow: hidden;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

/* Imagen que se adapta 100% sin recortar */
.product-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.product-card:hover .product-img-wrapper img {
  transform: scale(1.06);
}

.badge-category {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  z-index: 2;
}

.product-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-card-rating {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.product-card-rating small {
  color: var(--text-muted);
  font-weight: 400;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-dark);
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.product-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-view-detail {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.product-card:hover .btn-view-detail {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* 4. MODAL DETALLE DE PRODUCTO Y RESEÑAS */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.active { opacity: 1; visibility: visible; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
}

.detail-modal-card {
  position: relative;
  z-index: 1001;
  background-color: var(--card-bg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  transform: scale(0.95);
  transition: var(--transition);
}

.modal.active .detail-modal-card { transform: scale(1); }

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--text-dark);
  cursor: pointer;
  z-index: 10;
}

.modal-detail-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

@media (min-width: 580px) {
  .modal-detail-body {
    grid-template-columns: 220px 1fr;
  }
}

.modal-img-wrapper {
  height: 200px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-product-info h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 0.3rem;
  margin-bottom: 0.2rem;
}

.modal-product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.85rem;
}

.detail-block h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.detail-block p {
  font-size: 0.88rem;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.btn-consult-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--whatsapp);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-consult-whatsapp:hover {
  background-color: #1eb956;
  transform: translateY(-2px);
}

.modal-divider {
  border: none;
  height: 1px;
  background-color: var(--border-color);
  margin: 1.5rem 0;
}

/* 5. RESEÑAS / VALORACIONES */
.reviews-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-gold { color: var(--gold); }

.review-form {
  background-color: var(--bg-color);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.review-form h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.star-rating-picker {
  display: flex;
  gap: 6px;
  color: #cbd5e1;
  font-size: 1.2rem;
  cursor: pointer;
  margin-bottom: 0.85rem;
}

.star-rating-picker span.active {
  color: var(--gold);
}

.form-row {
  margin-bottom: 0.75rem;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  background-color: #ffffff;
}

.btn-submit-review {
  background-color: var(--text-dark);
  color: #ffffff;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-submit-review:hover {
  background-color: var(--primary);
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.review-card {
  padding: 0.85rem;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.reviewer-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.review-stars {
  color: var(--gold);
  font-size: 0.75rem;
}

.review-comment {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.catalog-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
  background-color: var(--card-bg);
}