/* Ficha comercio — ancho alineado al .container del Maule legacy (hasta 1320–1400px) */

.mc-store-detail-page {
  --store-detail-max: 1320px;
  --store-detail-px: 1.5rem;
  width: 100%;
  max-width: var(--store-detail-max);
  margin: 0 auto;
  padding: 0 var(--store-detail-px) 4rem;
  box-sizing: border-box;
}

@media (min-width: 1400px) {
  .mc-store-detail-page {
    --store-detail-max: 1400px;
    --store-detail-px: 2rem;
  }
}

@media (min-width: 1600px) {
  .mc-store-detail-page {
    --store-detail-max: min(96vw, 1520px);
  }
}

.mc-store-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: 32px;
  align-items: start;
  margin-top: 4px;
}

.mc-store-detail-main {
  min-width: 0;
}

.mc-store-detail-hero-block {
  margin-bottom: 24px;
}

.mc-store-detail-page .mc-store-detail-logo {
  width: 160px;
  height: 160px;
}

.mc-store-detail-page .mc-store-detail-panel {
  padding: 1.75rem 2rem;
}

.mc-store-detail-page .mc-store-detail-name {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
}

.mc-store-detail-panel--hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 0;
}

.mc-store-detail-identity {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 28px;
  align-items: start;
}

.mc-store-detail-identity__body {
  min-width: 0;
}

.mc-store-detail-name {
  word-break: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.mc-store-detail-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
  margin-bottom: 8px;
}

.mc-store-detail-quick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  width: 100%;
}

.mc-store-detail-quick__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #f8faf9;
  border-radius: 12px;
  border: 1px solid #e8ecef;
  font-size: 0.85rem;
  color: #4b5563;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mc-store-detail-quick__item:hover {
  border-color: #d4e8d0;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.08);
}

.mc-store-detail-quick__item i {
  color: var(--c-accent);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.mc-store-detail-quick__item strong {
  color: var(--c-primary);
}

.mc-store-detail-qr {
  border: 1px dashed #d4e8d0;
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  background: #f0fdf4;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mc-store-detail-qr:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.12);
}

.mc-store-detail-qr span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--c-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.mc-store-detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 20px;
  position: sticky;
  top: 72px;
  z-index: 20;
  background: linear-gradient(180deg, #fff 70%, rgba(255, 255, 255, 0.95) 100%);
  backdrop-filter: blur(8px);
  margin-bottom: 8px;
}

.mc-store-detail-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4b5563;
  background: #f3f4f6;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.mc-store-detail-nav a:hover,
.mc-store-detail-nav a.is-active {
  background: var(--c-accent);
  color: #fff;
  transform: translateY(-1px);
}

/* Sidebar estadísticas */
.mc-store-detail-sidebar {
  position: sticky;
  top: 88px;
}

.mc-store-stats-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 20px;
  padding: 1.35rem;
  box-shadow: 0 8px 32px rgba(10, 37, 64, 0.08);
  border-top: 4px solid var(--c-accent);
}

.mc-store-stats-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--c-primary);
  margin: 0 0 1rem;
}

.mc-store-stat-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f3;
}

.mc-store-stat-row:last-of-type {
  border-bottom: none;
}

.mc-store-stat-row__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f0fdf4;
  color: var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.mc-store-stat-row__icon--webpay {
  background: #ecfdf5;
  color: #059669;
}

.mc-store-stat-row h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--c-primary);
}

.mc-store-stat-row p {
  margin: 0;
  font-size: 0.78rem;
  color: #6b7280;
}

.mc-store-share {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #e8ecef;
}

.mc-store-share__btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.mc-store-share__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #e8ecef;
  background: #fff;
  color: var(--c-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.mc-store-share__btn:hover {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
  transform: scale(1.08);
}

.mc-store-sello {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  margin: 4px 4px 0 0;
}

/* Secciones */
.mc-store-section {
  padding: 40px 0 16px;
  scroll-margin-top: 100px;
}

.mc-store-section__head {
  text-align: center;
  margin-bottom: 28px;
}

.mc-store-section__eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 6px;
}

.mc-store-section__title {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 800;
  color: var(--c-primary);
  margin: 0 0 6px;
}

.mc-store-section__sub {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0;
}

.mc-store-empty {
  text-align: center;
  padding: 48px 24px;
  border-radius: 20px;
  border: 2px dashed #d4e8d0;
  background: linear-gradient(145deg, #f0fdf4, #fff);
}

.mc-store-empty i {
  font-size: 3rem;
  color: var(--c-accent);
  opacity: 0.6;
  margin-bottom: 12px;
}

.mc-store-empty h4 {
  font-weight: 800;
  color: var(--c-primary);
  margin-bottom: 8px;
}

/* Opiniones */
.mc-reviews-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.mc-reviews-summary {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(10, 37, 64, 0.06);
}

.mc-reviews-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--c-accent);
  line-height: 1;
  margin: 0;
}

.mc-reviews-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: #4b5563;
}

.mc-reviews-bar__track {
  flex: 1;
  height: 10px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}

.mc-reviews-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-accent), #34d399);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.mc-review-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 12px;
  transition: box-shadow 0.25s, transform 0.25s;
}

.mc-review-card:hover {
  box-shadow: 0 8px 24px rgba(10, 37, 64, 0.08);
  transform: translateY(-2px);
}

.mc-review-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.mc-review-card__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f0fdf4;
  color: var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Contacto */
.mc-contact-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(0, 1.6fr);
  gap: 32px;
  align-items: start;
}

.mc-contact-info-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mc-contact-info-card:hover {
  border-color: #d4e8d0;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.08);
}

.mc-contact-info-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f0fdf4;
  color: var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.mc-contact-form-panel {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(10, 37, 64, 0.06);
}

.mc-contact-form-panel .form-control,
.mc-contact-form-panel .form-select {
  border-radius: 12px;
  border-color: #e5e7eb;
  padding: 10px 14px;
}

.mc-contact-form-panel .form-control:focus,
.mc-contact-form-panel .form-select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* QR modal */
.mc-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.mc-qr-modal[hidden] {
  display: none;
}

.mc-qr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 37, 64, 0.55);
  backdrop-filter: blur(4px);
}

.mc-qr-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 2rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: mcQrPop 0.35s ease;
}

@keyframes mcQrPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.mc-qr-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: #f3f4f6;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.mc-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.mc-store-detail-page .products-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}

@media (min-width: 1200px) {
  .mc-store-detail-page .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
  }
}

@media (min-width: 1400px) {
  .mc-store-detail-page .products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.mc-store-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 0 8px;
  clear: both;
  width: 100%;
}

.mc-store-pagination .pagi {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mc-store-pagination .pagi__btn,
.mc-store-pagination .pagi__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: var(--c-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}

.mc-store-pagination .pagi__num--active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

.mc-store-pagination .pagi__btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mc-store-pagination .pagi__info {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
}

.mc-store-section--similares {
  margin-top: 24px;
  margin-left: calc(-1 * var(--store-detail-px));
  margin-right: calc(-1 * var(--store-detail-px));
  padding: 40px var(--store-detail-px) 48px;
  background: #f8faf9;
  border-radius: 20px;
  border: 1px solid #e8ecef;
}

.mc-related-grid .mc-store-card {
  height: 100%;
}

@media (max-width: 1024px) {
  .mc-store-detail-layout {
    grid-template-columns: 1fr;
  }
  .mc-store-detail-sidebar {
    position: static;
  }
  .mc-reviews-grid,
  .mc-contact-grid {
    grid-template-columns: 1fr;
  }
  .mc-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .mc-store-detail-identity {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .mc-store-detail-identity__body {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .mc-store-detail-nav {
    top: 60px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .mc-related-grid {
    grid-template-columns: 1fr;
  }
}
