/* COCOS — блок портфолио для страницы /portfolio */

.cocos-portfolio {
  --cpf-bg: #f6f4f2;
  --cpf-card: #ffffff;
  --cpf-border: #e3dfda;
  --cpf-text: #4f4740;
  --cpf-text-muted: #9a8f86;
  --cpf-accent: #4f4740;
  --cpf-radius: 12px;

  font-family: 'Oswald', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--cpf-text);
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  box-sizing: border-box;
  font-weight: 300;
  background: var(--cpf-bg);
  border-radius: 16px;
}
.cocos-portfolio *,
.cocos-portfolio *::before,
.cocos-portfolio *::after { box-sizing: border-box; }

.cocos-pf__title {
  font-size: 48px;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.cocos-pf__subtitle {
  font-size: 18px;
  color: var(--cpf-text-muted);
  margin: 0 0 32px;
  line-height: 1.5;
  max-width: 820px;
  font-weight: 300;
}

.cocos-pf__salons-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--cpf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cocos-pf__salons-label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--cpf-text-muted);
  opacity: 0.5;
}
.cocos-pf__salons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 28px;
}
.cocos-pf__salon-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: 22px;
  border: 1px solid var(--cpf-border);
  background: transparent;
  color: var(--cpf-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.cocos-pf__salon-tab:hover {
  border-color: var(--cpf-accent);
  color: var(--cpf-text);
}
.cocos-pf__salon-tab.is-active {
  background: var(--cpf-accent);
  color: var(--cpf-bg);
  border-color: var(--cpf-accent);
}

.cocos-pf__cats-wrap { margin: 0 0 16px; }
.cocos-pf__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cocos-pf__cat-tab {
  flex-shrink: 0;
  padding: 10px 20px;
  border: 1px solid var(--cpf-border);
  border-radius: 22px;
  background: var(--cpf-card);
  color: var(--cpf-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cocos-pf__cat-tab:hover {
  border-color: var(--cpf-accent);
}
.cocos-pf__cat-tab.is-active {
  background: var(--cpf-accent);
  color: var(--cpf-bg);
  border-color: var(--cpf-accent);
}

.cocos-pf__master-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 24px;
  max-width: 320px;
}
.cocos-pf__master-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cpf-text-muted);
  font-weight: 500;
}
.cocos-pf__master {
  appearance: none;
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 1px solid var(--cpf-border);
  border-radius: 10px;
  background: var(--cpf-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234f4740' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--cpf-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}
.cocos-pf__master:focus {
  outline: none;
  border-color: var(--cpf-accent);
}

.cocos-pf__loading,
.cocos-pf__empty {
  text-align: center;
  color: var(--cpf-text-muted);
  font-size: 15px;
  padding: 48px 16px;
}

.cocos-pf__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cocos-pf__thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 12px;
  padding: 0;
  cursor: zoom-in;
  background: rgba(79, 71, 64, 0.06) center / cover no-repeat;
  overflow: hidden;
  transition: transform 0.2s ease;
}
.cocos-pf__thumb:hover { transform: scale(1.02); }
.cocos-pf__thumb-master {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: auto;
  max-width: calc(100% - 16px);
  z-index: 2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.cocos-pf__thumb-master .cocos-pf__chip-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.cocos-pf__thumb-master .cocos-pf__chip-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
@media (max-width: 600px) {
  .cocos-pf__thumb-master {
    left: 6px;
    bottom: 6px;
    padding: 4px 10px 4px 4px;
    font-size: 12px;
    gap: 6px;
  }
  .cocos-pf__thumb-master .cocos-pf__chip-avatar {
    width: 24px;
    height: 24px;
  }
  .cocos-pf__thumb-master .cocos-pf__chip-text { max-width: 90px; }
}

/* Наверх */
.cocos-pf__top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--cpf-accent);
  color: #f6f4f2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
  box-shadow: 0 4px 16px rgba(79, 71, 64, 0.25);
}
.cocos-pf__top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.cocos-pf__top:hover { background: #3b352f; }

/* Лайтбокс */
.cocos-pf__lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483300;
  background: rgba(20, 18, 16, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  padding: 40px;
  box-sizing: border-box;
  font-family: 'Oswald', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.cocos-pf__lightbox.is-open { opacity: 1; visibility: visible; }
.cocos-pf__lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  user-select: none;
}
.cocos-pf__lightbox-close,
.cocos-pf__lightbox-nav {
  position: absolute;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}
.cocos-pf__lightbox-close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  font-size: 22px;
}
.cocos-pf__lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 28px;
}
.cocos-pf__lightbox-nav--prev { left: 20px; }
.cocos-pf__lightbox-nav--next { right: 20px; }
.cocos-pf__lightbox-close:hover,
.cocos-pf__lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }

.cocos-pf__lightbox-caption {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: min(92vw, 480px);
  pointer-events: auto;
}
.cocos-pf__lightbox-caption:empty { display: none; }
.cocos-pf__chip-services {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.cocos-pf__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e3dfda;
  color: #4f4740;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
  opacity: 1;
}
.cocos-pf__chip--master { padding: 6px 16px 6px 6px; }
.cocos-pf__chip-avatar,
.cocos-pf__chip-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(79, 71, 64, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  overflow: hidden;
  color: inherit;
}
.cocos-pf__chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
button.cocos-pf__chip--master:hover .cocos-pf__chip-avatar {
  background: rgba(246, 244, 242, 0.2);
}
button.cocos-pf__chip:hover {
  background: #4f4740;
  border-color: #4f4740;
  color: #f6f4f2;
  transform: translateY(-1px);
}
.cocos-pf__chip--static {
  cursor: default;
  pointer-events: none;
}
.cocos-pf__lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .cocos-pf__grid { grid-template-columns: repeat(2, 1fr); }
  .cocos-pf__title { font-size: 36px; }
}
@media (max-width: 600px) {
  .cocos-portfolio { padding: 24px 16px; }
  .cocos-pf__title { font-size: 28px; }
  .cocos-pf__subtitle { font-size: 16px; margin-bottom: 20px; }
  .cocos-pf__cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .cocos-pf__master-wrap { max-width: 100%; }
  .cocos-pf__lightbox { padding: 16px; }
  .cocos-pf__lightbox-nav { width: 40px; height: 40px; font-size: 20px; }
  .cocos-pf__lightbox-nav--prev { left: 8px; }
  .cocos-pf__lightbox-nav--next { right: 8px; }
  .cocos-pf__lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 18px; }
  .cocos-pf__top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}
