/* ==========================================================================
   Shop View — Merchant Feed theme (Main Street Feed layout)
   BuyUSAFirst brand colors. Use with templates/Shop/UsersShops/view_by_slug.php
   ========================================================================== */

.shop-view-mf {
  --sf-primary: #0075B2;
  --sf-primary-dark: #005A8B;
  --sf-accent: #E21F26;
  --sf-success: #2BCA6E;
  --sf-secondary: #219CD2;
  --sf-text: #3F4B59;
  --sf-bg: #EEF2F6;
  --sf-white: #FFFFFF;
  --sf-border: #dee2e6;
}

.shop-view-mf a {
  color: var(--sf-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.shop-view-mf a:hover {
  color: var(--sf-primary-dark);
}

/* Top bar (optional announcement) */
.shop-view-mf .mf-topbar {
  background: var(--sf-primary);
  color: var(--sf-white);
  text-align: center;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Cover / banner — taller hero, full image with blurred fill when needed */
.shop-view-mf .mf-cover {
  min-height: 380px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sf-primary) 0%, var(--sf-primary-dark) 100%);
}

.shop-view-mf .mf-cover.mf-cover--alpha-friendly {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(238, 242, 246, 0.98) 100%);
}

.shop-view-mf .mf-cover.mf-cover--alpha-friendly::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.08) 100%),
    radial-gradient(circle at 1px 1px, rgba(63, 75, 89, 0.055) 1px, transparent 0);
  background-size: auto, 18px 18px;
  z-index: 0;
}

/* Blurred background so full image can use object-fit: contain; letterbox areas show blur */
.shop-view-mf .mf-cover.mf-cover--has-image .mf-cover-blur {
  position: absolute;
  inset: -40px;
  background-image: var(--mf-cover-bg);
  background-size: cover;
  background-position: center;
  filter: blur(20px);
  transform: scale(1.15);
  z-index: 0;
}

.shop-view-mf .mf-cover.mf-cover--alpha-friendly .mf-cover-blur {
  opacity: 0.16;
  filter: blur(18px) saturate(0.8);
}

.shop-view-mf .mf-cover.mf-cover--has-image .mf-cover-blur::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
}

.shop-view-mf .mf-cover.mf-cover--alpha-friendly .mf-cover-blur::after {
  background: rgba(255, 255, 255, 0.4);
}

.shop-view-mf .mf-cover img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.shop-view-mf .mf-cover.mf-cover--alpha-friendly img {
  filter: drop-shadow(0 10px 24px rgba(63, 75, 89, 0.12));
}

/* No image: gradient fills the height */
.shop-view-mf .mf-cover:not(.mf-cover--has-image) {
  height: 380px;
}

/* Profile wrap — sits below hero so profile pic can overlap */
.shop-view-mf .mf-profile-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* Round avatar overlaps the bottom of the hero */
.shop-view-mf .mf-profile-pic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--sf-white);
  margin-top: -76px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

/* <picture> is inline by default; block it so it fills the circular container */
.shop-view-mf .mf-profile-pic picture {
  display: block;
  width: 100%;
  height: 100%;
}

/* Must render the avatar the same way the upload page previews it
   (templates/Merchant/UsersShops/upload_avatar.php — 120px circle,
   object-fit: contain, 4px inset, white ground). `cover` cropped the edges of
   the artwork, so a logo the merchant had just approved on the upload screen
   came out clipped here. Keep these two in step. */
.shop-view-mf .mf-profile-pic img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  background: #ffffff;
}

.shop-view-mf .mf-profile-info {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.shop-view-mf .mf-profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--sf-text);
}

/* Ownership and owner-context badges sit on the light profile surface. Do not
   inherit a theme's generic white badge text, which becomes unreadable here. */
.shop-view-mf .mf-owned-store-badge {
  background: #d9effa;
  border: 1px solid #8fc9e3;
  color: #004b73;
  font-weight: 700;
}

.shop-view-mf .mf-ownership-badge {
  background: #f5f8fb;
  border-color: #b8c7d5 !important;
  color: #243b53;
  font-weight: 700;
}

.shop-view-mf .mf-profile-tagline {
  color: var(--sf-text);
  opacity: 0.85;
  font-size: 0.9rem;
  margin: 0;
}

.shop-view-mf .mf-profile-btns {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.shop-view-mf .mf-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, background-color 0.2s, border-color 0.2s;
  text-decoration: none;
  display: inline-block;
}

.shop-view-mf .mf-btn--primary {
  background: var(--sf-primary);
  color: var(--sf-white);
}

.shop-view-mf .mf-btn--primary:hover {
  background: var(--sf-primary-dark);
  color: var(--sf-white);
}

.shop-view-mf .mf-btn--outline {
  background: transparent;
  color: var(--sf-primary);
  border: 2px solid var(--sf-primary);
}

.shop-view-mf .mf-btn--outline:hover {
  background: rgba(0, 117, 178, 0.08);
  color: var(--sf-primary-dark);
}

/* Tabs */
.shop-view-mf .mf-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  margin-top: 18px;
  border-bottom: 1px solid var(--sf-border);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  background: var(--sf-white);
}

.shop-view-mf .mf-tab {
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--sf-text);
  opacity: 0.7;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s, opacity 0.2s;
}

.shop-view-mf .mf-tab:hover {
  opacity: 1;
}

.shop-view-mf .mf-tab.active {
  color: var(--sf-primary);
  border-bottom-color: var(--sf-primary);
  opacity: 1;
}

/* Main: sidebar + content */
.shop-view-mf .mf-main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
  background: var(--sf-bg);
}

/* Sidebar cards */
.shop-view-mf .mf-card {
  background: var(--sf-white);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--sf-border);
  margin-bottom: 16px;
}

.shop-view-mf .mf-card:last-child {
  margin-bottom: 0;
}

.shop-view-mf .mf-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--sf-primary);
}

.shop-view-mf .mf-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.shop-view-mf .mf-card-list li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--sf-text);
}

.shop-view-mf .mf-card-list li + li {
  border-top: 1px solid var(--sf-border);
}

/* Grid header */
.shop-view-mf .mf-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.shop-view-mf .mf-grid-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--sf-text);
}

/* Product grid */
.shop-view-mf .mf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.shop-view-mf .mf-product {
  background: var(--sf-white);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--sf-border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.shop-view-mf .mf-product:hover {
  border-color: var(--sf-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.shop-view-mf .mf-product a {
  text-decoration: none;
  color: inherit;
}

.shop-view-mf .mf-product-img {
  aspect-ratio: 1;
  background: var(--sf-bg);
  overflow: hidden;
}

.shop-view-mf .mf-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-view-mf .mf-product-body {
  padding: 12px 14px;
}

.shop-view-mf .mf-product-name {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0 0 4px;
  line-height: 1.3;
  color: var(--sf-text);
}

.shop-view-mf .mf-product-name a:hover {
  color: var(--sf-primary);
}

.shop-view-mf .mf-product-price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--sf-primary);
}

.shop-view-mf .mf-product-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 117, 178, 0.1);
  color: var(--sf-primary);
  font-size: 0.7rem;
  font-weight: 600;
}

.shop-view-mf .mf-product .badge-out-of-stock {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--sf-accent);
  color: var(--sf-white);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 1;
}

.shop-view-mf .mf-product .badge-coming-soon,
.shop-view-mf .mf-product .badge-made-to-order {
  position: absolute;
  top: 8px;
  left: 8px;
  color: var(--sf-white);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 1;
}

.shop-view-mf .mf-product .badge-coming-soon {
  background: #6c757d;
}

.shop-view-mf .mf-product .badge-made-to-order {
  background: var(--sf-primary);
}

.shop-view-mf .mf-product-img {
  position: relative;
}

/* Paginator */
.shop-view-mf .mf-paginator {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--sf-border);
}

.shop-view-mf .mf-paginator .pagination {
  justify-content: center;
  gap: 4px;
}

.shop-view-mf .mf-paginator .page-link {
  color: var(--sf-primary);
  border-color: var(--sf-border);
}

.shop-view-mf .mf-paginator .page-item.active .page-link {
  background: var(--sf-primary);
  border-color: var(--sf-primary);
  color: var(--sf-white);
}

.shop-view-mf .mf-paginator .page-link:hover {
  background: rgba(0, 117, 178, 0.08);
  border-color: var(--sf-primary);
  color: var(--sf-primary-dark);
}

/* No products message */
.shop-view-mf .mf-no-products {
  background: var(--sf-white);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  border: 1px solid var(--sf-border);
  color: var(--sf-text);
}

/* Policies section (below main grid) */
.shop-view-mf .mf-policies {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.shop-view-mf .mf-policy-card {
  background: var(--sf-white);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--sf-border);
}

.shop-view-mf .mf-policy-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--sf-primary);
}

.shop-view-mf .mf-policy-card p,
.shop-view-mf .mf-policy-card div {
  font-size: 0.9rem;
  color: var(--sf-text);
  line-height: 1.5;
  margin: 0 0 8px;
}

/* ── Stripe payment card ── */
.shop-view-mf .mf-stripe-card {
  position: relative;
}

.shop-view-mf .mf-stripe-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.shop-view-mf .mf-stripe-status i {
  font-size: 1rem;
}

.shop-view-mf .mf-stripe-acct-id {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.82rem;
  color: var(--sf-text);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

.shop-view-mf .mf-stripe-source {
  font-size: 0.75rem;
  color: #8898aa;
  margin-top: 2px;
}

.shop-view-mf .mf-stripe-icon {
  color: #635bff;
  vertical-align: -2px;
  margin-right: 4px;
}

/* Stripe button variants */
.shop-view-mf .mf-btn--warning {
  background: #f5a623;
  color: #fff;
}

.shop-view-mf .mf-btn--warning:hover {
  background: #e09510;
  color: #fff;
}

.shop-view-mf .mf-btn--danger {
  background: #e25950;
  color: #fff;
}

.shop-view-mf .mf-btn--danger:hover {
  background: #c9433a;
  color: #fff;
}

.shop-view-mf .mf-btn.w-100 {
  width: 100%;
  text-align: center;
}

/* ── Tab content visibility (only active tab shown) ── */
.shop-view-mf .mf-tab-content {
  display: none;
}

.shop-view-mf .mf-tab-content.active {
  display: block;
}

/* ── Cover wrapper for pencil overlay positioning ── */
.shop-view-mf .mf-cover-wrap {
  position: relative;
}

/* ── Avatar wrapper for pencil overlay positioning ── */
.shop-view-mf .mf-avatar-wrap {
  position: relative;
  display: inline-block;
}

/* ── Facebook-style edit pencil buttons ── */
.shop-view-mf .mf-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sf-white);
  color: var(--sf-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--sf-border);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  z-index: 5;
}

.shop-view-mf .mf-edit-btn:hover {
  background: var(--sf-primary);
  color: var(--sf-white);
  border-color: var(--sf-primary);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 117, 178, 0.3);
}

/* Edit button on cover photo — bottom-right corner */
.shop-view-mf .mf-edit-cover {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  font-size: 0.95rem;
}

/* Edit button on avatar — bottom-right of the circle */
.shop-view-mf .mf-edit-avatar {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

/* Inline edit pencil — sits next to text (shop name, section titles) */
.shop-view-mf .mf-edit-inline {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
  vertical-align: middle;
  margin-left: 6px;
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.shop-view-mf .mf-edit-inline:hover {
  opacity: 1;
}

/* ── Sidebar icon styling ── */
.shop-view-mf .mf-icon {
  width: 16px;
  text-align: center;
  margin-right: 6px;
  color: var(--sf-primary);
  opacity: 0.7;
  font-size: 0.85rem;
}

.shop-view-mf .mf-card-title i {
  margin-right: 6px;
  opacity: 0.8;
}

/* ── Social media links ── */
.shop-view-mf .mf-social-links {
  display: flex;
  gap: 10px;
  padding: 4px 0;
}

.shop-view-mf .mf-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 117, 178, 0.08);
  color: var(--sf-primary);
  font-size: 1rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.shop-view-mf .mf-social-link:hover {
  background: var(--sf-primary);
  color: var(--sf-white);
  transform: translateY(-2px);
}

/* Larger social links in About section */
.shop-view-mf .mf-social-links--large .mf-social-link {
  width: auto;
  padding: 8px 16px;
  border-radius: 8px;
  gap: 8px;
  font-size: 0.9rem;
}

.shop-view-mf .mf-social-links--large .mf-social-link span {
  font-weight: 500;
}

/* ── Elegant pending-setup empty state ── */
.shop-view-mf .mf-pending-setup {
  background: var(--sf-white);
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  border: 1px solid var(--sf-border);
  position: relative;
  overflow: hidden;
}

/* Decorative gradient top stripe */
.shop-view-mf .mf-pending-setup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sf-primary), var(--sf-secondary), var(--sf-accent));
}

.shop-view-mf .mf-pending-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 117, 178, 0.08), rgba(33, 156, 210, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--sf-primary);
}

.shop-view-mf .mf-pending-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sf-text);
  margin: 0 0 12px;
}

.shop-view-mf .mf-pending-subtitle {
  font-size: 1rem;
  color: var(--sf-text);
  opacity: 0.8;
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.shop-view-mf .mf-pending-features {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.shop-view-mf .mf-pending-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(0, 117, 178, 0.05), rgba(33, 156, 210, 0.08));
  border: 1px solid rgba(0, 117, 178, 0.15);
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sf-primary-dark);
}

.shop-view-mf .mf-pending-feature i {
  font-size: 0.9rem;
  color: var(--sf-primary);
}

.shop-view-mf .mf-pending-contact {
  font-size: 0.9rem;
  color: var(--sf-text);
  opacity: 0.7;
}

.shop-view-mf .mf-pending-contact a {
  font-weight: 600;
}

/* ── Section cards (About/Policies tab content) ── */
.shop-view-mf .mf-section-card {
  background: var(--sf-white);
  border-radius: 12px;
  padding: 28px;
  border: 1px solid var(--sf-border);
}

.shop-view-mf .mf-section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--sf-primary);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sf-border);
}

.shop-view-mf .mf-section-title i {
  margin-right: 8px;
  opacity: 0.8;
}

.shop-view-mf .mf-section-body {
  font-size: 0.95rem;
  color: var(--sf-text);
  line-height: 1.7;
}

/* ── Empty section state (About/Policies not filled) ── */
.shop-view-mf .mf-empty-section {
  background: var(--sf-white);
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
  border: 1px dashed rgba(0, 117, 178, 0.25);
}

.shop-view-mf .mf-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 117, 178, 0.06), rgba(33, 156, 210, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--sf-primary);
  opacity: 0.6;
}

.shop-view-mf .mf-empty-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sf-text);
  margin: 0 0 10px;
}

.shop-view-mf .mf-empty-section p {
  font-size: 0.9rem;
  color: var(--sf-text);
  opacity: 0.7;
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Owner action buttons inside empty states */
.shop-view-mf .mf-empty-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ── Policies grid (inside tab content) ── */
.shop-view-mf .mf-policies-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
  .shop-view-mf .mf-main {
    grid-template-columns: 1fr;
  }

  .shop-view-mf .mf-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .shop-view-mf .mf-policies,
  .shop-view-mf .mf-policies-grid {
    grid-template-columns: 1fr;
  }

  .shop-view-mf .mf-pending-features {
    gap: 12px;
  }
}

@media (max-width: 576px) {
  .shop-view-mf .mf-profile-wrap,
  .shop-view-mf .mf-tabs,
  .shop-view-mf .mf-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .shop-view-mf .mf-profile-btns {
    margin-left: 0;
    width: 100%;
  }

  .shop-view-mf .mf-grid {
    grid-template-columns: 1fr;
  }

  .shop-view-mf .mf-pending-setup {
    padding: 40px 20px;
  }

  .shop-view-mf .mf-pending-features {
    flex-direction: column;
    align-items: center;
  }

  .shop-view-mf .mf-social-links--large {
    flex-direction: column;
    align-items: stretch;
  }

  .shop-view-mf .mf-empty-actions {
    flex-direction: column;
    align-items: center;
  }
}
