/* Portfolio Component Styles - ErfanChap */
.pf-page {
  direction: rtl;
  text-align: right;
}

/* Category Filter Chips */
.pf-filters-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 6px;
}

.pf-filters-scroll::-webkit-scrollbar {
  height: 4px;
}

.pf-filters-scroll::-webkit-scrollbar-thumb {
  background: #e0d0d0;
  border-radius: 999px;
}

.pf-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: max-content;
  padding: 4px 2px;
}

.pf-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #eadfdf;
  border-radius: 999px;
  color: #332a2a;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-decoration: none;
}

.pf-chip:hover {
  border-color: #FF0000;
  color: #FF0000;
  background: #fff8f8;
}

.pf-chip.is-active {
  background: #FF0000;
  border-color: #FF0000;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}

/* Portfolio Card */
.pf-card {
  background: #fff;
  border: 1px solid #f0e6e6;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pf-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(80, 16, 18, 0.1);
  border-color: #f3c2c2;
}

.pf-card-media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f7f3f3;
}

.pf-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.pf-card:hover .pf-card-media img {
  transform: scale(1.03);
}

.pf-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.pf-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
}

.pf-card-title a {
  color: #1a1212;
  text-decoration: none;
  transition: color 0.15s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pf-card-title a:hover {
  color: #FF0000;
}

.pf-card-meta {
  margin: 0;
  color: #877676;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Related Portfolio Block */
.pf-related {
  margin: 32px 0 24px;
}

.pf-related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f6eeee;
}

.pf-related-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a1212;
  margin: 0;
}

.pf-related-more {
  color: #FF0000;
  background: #fff5f5;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pf-related-more:hover {
  background: #FF0000;
  color: #fff;
}

/* Empty State */
.pf-empty {
  background: #fff;
  border-radius: 20px;
  padding: 40px 20px;
}

.pf-empty-msg {
  font-size: 15px;
  color: #7b6a6a;
  margin-bottom: 20px;
  font-weight: 700;
}

.pf-empty-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.pf-cta-wa {
  background: #25D366;
  color: #fff !important;
  border-radius: 12px;
  padding: 8px 18px;
  font-weight: 800;
}

.pf-cta-phone {
  background: #fff;
  border: 1px solid #e0d2d2;
  border-radius: 12px;
  padding: 8px 18px;
  font-weight: 800;
  color: #1a1212 !important;
}

.pf-cta-contact {
  background: #f7f3f3;
  border-radius: 12px;
  padding: 8px 18px;
  font-weight: 800;
  color: #1a1212 !important;
}

/* Header active navigation styling */
.site-nav > a[aria-current="page"] {
  color: #FF0000;
  font-weight: 800;
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
  .pf-card-title {
    font-size: 14px;
  }

  .pf-empty-actions {
    flex-direction: column;
    width: 100%;
  }

  .pf-empty-actions .btn {
    width: 100%;
    min-height: 44px;
  }
}

/* Portfolio detail. Scoped so product gallery classes stay untouched. */
body.pfd-lock {
  overflow: hidden;
}

.pfd-page {
  background: #feffff;
  padding-block: 24px 96px;
  overflow-x: clip;
  color: #1a1212;
}

.pfd-page img {
  max-width: 100%;
}

.pfd-page .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  list-style: none;
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(110, 134, 216, 0.1);
  font-size: 14px;
}

.pfd-page .breadcrumb li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.pfd-page .breadcrumb li:not(:first-child)::before {
  content: "/";
  margin-inline: 6px;
  color: #245d60;
  font-size: 13px;
}

.pfd-page .breadcrumb a {
  color: #6a6a6a;
  text-decoration: none;
}

.pfd-page .breadcrumb a[aria-label="خانه"] {
  color: #ff0000;
}

.pfd-page .breadcrumb span {
  color: #7a1216;
}

.pfd-page .breadcrumb [aria-current="page"] {
  overflow-wrap: anywhere;
}

.pfd-card {
  background: #fff;
  border: 1px solid #f0e6e6;
  border-radius: 20px;
  padding: 16px;
}

.pfd-grid,
.pfd-media,
.pfd-aside {
  min-width: 0;
}

.pfd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.pfd-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: min(78vh, 680px);
  background: #f7f3f3;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
}

.pfd-hero img {
  width: 100%;
  height: 100%;
  max-height: min(78vh, 680px);
  object-fit: contain;
  display: block;
}

.pfd-hero .fa-magnifying-glass-plus {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #ff0000;
}

.pfd-thumbs {
  display: flex;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0 0 6px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

.pfd-thumbs li {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.pfd-thumb {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eddcdc;
  background: #f7f3f3;
}

.pfd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pfd-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pfd-title {
  margin: 0;
  font-size: clamp(20px, 1.2rem + 1vw, 28px);
  font-weight: 800;
  line-height: 1.6;
  color: #1a1212;
  overflow-wrap: anywhere;
}

.pfd-lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
  color: #3d3232;
}

.pfd-specs h2,
.pfd-similar-head h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
}

.pfd-specs dl {
  margin: 0;
}

.pfd-spec {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-block: 12px;
  border-bottom: 1px solid #f3e9e9;
}

.pfd-spec:last-child {
  border-bottom: 0;
}

.pfd-spec dt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #7b6a6a;
  font-weight: 600;
  font-size: 14px;
}

.pfd-spec dt i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff1f1;
  color: #ff0000;
  flex: 0 0 auto;
}

.pfd-spec dd {
  margin: 0;
  color: #1a1212;
  font-weight: 700;
  font-size: 15px;
  text-align: start;
  overflow-wrap: anywhere;
}

.pfd-spec dd a {
  color: #ff0000;
  text-decoration: none;
}

.pfd-spec dd a:hover {
  text-decoration: underline;
}

.pfd-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pfd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 50px;
  font-weight: 800;
  text-decoration: none;
  border: 1.5px solid transparent;
}

.pfd-btn-wa {
  background: #25d366;
  color: #fff !important;
}

.pfd-btn-phone {
  background: #fff;
  color: #1a1212 !important;
  border-color: #e5d7d7;
}

.pfd-btn-muted {
  background: #fff;
  color: #1a1212 !important;
  border-color: #e5d7d7;
}

.pfd-cta-note {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #7b6a6a;
}

.pfd-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pfd-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ff0000;
  font-weight: 700;
  text-decoration: none;
}

.pfd-links i {
  margin-inline-start: 2px;
}

.pfd-links a:hover {
  text-decoration: underline;
}

.pfd-similar {
  margin-top: 28px;
}

.pfd-similar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pfd-similar-head a {
  color: #ff0000;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.pfd-similar-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 4px;
  padding-bottom: 8px;
}

.pfd-similar-rail > .pf-card {
  scroll-snap-align: start;
  min-width: 0;
}

.pfd-page .pfd-hero:focus-visible,
.pfd-page .pfd-thumb:focus-visible,
.pfd-page .pfd-lightbox button:focus-visible {
  outline: 2px solid #ff0000;
  outline-offset: 2px;
}

.pfd-lightbox[open] {
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(15, 10, 10, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pfd-lightbox::backdrop {
  background: transparent;
}

.pfd-lightbox img {
  max-width: 92vw;
  max-height: 86dvh;
  object-fit: contain;
}

.pfd-lightbox button {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: #1a1212;
  cursor: pointer;
}

.pfd-lightbox-close {
  inset-block-start: 16px;
  inset-inline-end: 16px;
}

.pfd-lightbox-prev {
  inset-inline-start: 12px;
  inset-block-start: 50%;
  transform: translateY(-50%);
}

.pfd-lightbox-next {
  inset-inline-end: 12px;
  inset-block-start: 50%;
  transform: translateY(-50%);
}

.pfd-lightbox-counter {
  position: absolute;
  inset-block-end: 18px;
  inset-inline: 0;
  margin: 0;
  text-align: center;
  color: #fff;
  font-weight: 700;
}

@media (max-width: 399px) {
  .pfd-spec {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (min-width: 576px) {
  .pfd-thumb {
    width: 72px;
    height: 72px;
  }

  .pfd-similar-rail {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
  }
}

@media (min-width: 768px) {
  .pfd-similar-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .pfd-card {
    padding: 28px;
  }

  .pfd-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 32px;
  }

  .pfd-aside {
    position: sticky;
    top: 24px;
    align-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pfd-page *,
  .pfd-page *::before,
  .pfd-page *::after {
    transition: none !important;
    scroll-behavior: auto !important;
    animation: none !important;
  }
}
