/* ================================================================
   KOSINCEVA TATTOO — UI Components
   ================================================================ */


/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8125em 1.625em;  /* ~13px 26px at 16px base */
  font-size: var(--text-base);
  font-weight: var(--w-semibold);
  line-height: 1;
  border-radius: var(--r-md);
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--ease), color var(--ease),
              border-color var(--ease), transform var(--ease),
              box-shadow var(--ease);
  min-height: 48px;  /* touch target */
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Primary — чёрная на светлом фоне */
.btn--primary {
  background: #0A0A0A;
  color: #fff;
  border-color: #0A0A0A;
}
.btn--primary:hover {
  background: #1A1A1A;
  border-color: #1A1A1A;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* Primary — белая на тёмном фоне (автоматически через контекст) */
.section--dark .btn--primary {
  background: #ffffff;
  color: #0A0A0A;
  border-color: #ffffff;
}
.section--dark .btn--primary:hover {
  background: #F5F5F5;
  border-color: #F5F5F5;
  box-shadow: 0 6px 20px rgba(255,255,255,0.12);
  color: #0A0A0A;
}

/* Outline (on light bg) */
.btn--outline {
  background: transparent;
  color: #0A0A0A;
  border: 1.5px solid #0A0A0A;
}
.btn--outline:hover {
  background: #0A0A0A;
  color: #ffffff;
  border-color: #0A0A0A;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Outline white (on dark bg) */
.btn--outline-inv {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
}
.btn--outline-inv:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateY(-2px);
}

/* Telegram — фирменный #229ED9 */
.btn--tg {
  background: var(--c-tg);
  color: #fff;
  border-color: var(--c-tg);
}
.btn--tg:hover {
  background: #1a8bbf;
  border-color: #1a8bbf;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34,158,217,0.4);
}

/* WhatsApp — фирменный #25D366 */
.btn--wa {
  background: var(--c-wa);
  color: #fff;
  border-color: var(--c-wa);
}
.btn--wa:hover {
  background: #1aaa52;
  border-color: #1aaa52;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,211,102,0.4);
}

/* ВКонтакте — фирменный #0077FF */
.btn--vk {
  background: #0077FF;
  color: #fff;
  border-color: #0077FF;
}
.btn--vk:hover {
  background: #005fcc;
  border-color: #005fcc;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,119,255,0.4);
}

/* MAX — фирменный #7B2EFF */
.btn--max {
  background: #7B2EFF;
  color: #fff;
  border-color: #7B2EFF;
}
.btn--max:hover {
  background: #6020d4;
  border-color: #6020d4;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(123,46,255,0.4);
}

/* Sizes */
.btn--sm {
  padding: 0.5em 1em;
  font-size: var(--text-sm);
  min-height: 40px;
}
.btn--lg {
  padding: 1em 2em;
  font-size: var(--text-lg);
  min-height: 56px;
}


/* ── Service card ── */

.service-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  transition: box-shadow var(--ease);
}

.service-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
}

.service-card__img-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .service-card__img-wrap {
    aspect-ratio: unset;
    height: 280px;
  }
}

.service-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.service-card:hover .service-card__img {
  transform: scale(1.04);
}

.service-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--sp-3);
}

.service-card__num {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: var(--w-regular);
  color: var(--c-text-muted);
  line-height: 1;
  margin-bottom: var(--sp-1);
  user-select: none;
}

.service-card__name {
  font-size: var(--text-xl);
  font-weight: var(--w-bold);
  line-height: var(--lh-snug);
  margin-bottom: var(--sp-1);
}

.service-card__desc {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  line-height: var(--lh-relaxed);
  flex: 1;
  margin-bottom: var(--sp-2);
}

.service-card__price {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}

.service-card__price-val {
  display: block;
  font-size: var(--text-2xl);
  font-weight: var(--w-black);
  color: var(--c-text);
  line-height: 1.1;
  margin-bottom: 2px;
}


/* ── Gallery grid ── */

/* Главная — квадраты 3/2/2 колонки */
.gallery-preview {
  display: grid;
  gap: var(--sp-2);
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .gallery-preview {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Портфолио — masonry через columns */
.gallery-masonry {
  columns: 2;
  column-gap: var(--sp-2);
}

@media (min-width: 640px) {
  .gallery-masonry { columns: 3; }
}

@media (min-width: 1024px) {
  .gallery-masonry { columns: 4; }
}

/* Общая галерейная карточка */
.gallery-item {
  display: block;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--c-bg-dark-3);
  cursor: pointer;
  position: relative;
}

/* Для masonry — break-inside + фиксированная пропорция против layout shift */
.gallery-masonry .gallery-item {
  break-inside: avoid;
  margin-bottom: var(--sp-2);
  aspect-ratio: 1;
}

/* Для preview grid — aspect-ratio квадрат */
.gallery-preview .gallery-item {
  aspect-ratio: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--ease-slow);
}

.gallery-preview .gallery-item img {
  height: 100%;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

/* Overlay с иконкой лупы (для portfolio) */
.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease);
  color: #fff;
  opacity: 0;
}

.gallery-item:hover .gallery-item__overlay {
  background: rgba(0, 0, 0, 0.35);
  opacity: 1;
}


/* ── Accordion (native <details>/<summary>) ── */

.accordion {
  border-top: 1px solid var(--c-border);
}

.accordion__item {
  border-bottom: 1px solid var(--c-border);
}

.accordion__item > summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  padding-block: var(--sp-3);
  font-size: var(--text-base);
  font-weight: var(--w-semibold);
  cursor: pointer;
  user-select: none;
  transition: color var(--ease);
  line-height: var(--lh-snug);
}

.accordion__item > summary::-webkit-details-marker {
  display: none;
}

.accordion__item > summary::marker {
  display: none;
}

.accordion__item > summary:hover {
  color: var(--c-text);
}

.accordion__item > summary:hover .accordion__chevron {
  opacity: 1;
}

/* Плюс/минус иконка через CSS */
.accordion__chevron {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: var(--r-full);
  border: 2px solid currentColor;
  position: relative;
  opacity: 0.5;
  transition: opacity var(--ease), transform var(--ease);
}

.accordion__chevron::before,
.accordion__chevron::after {
  content: '';
  position: absolute;
  background: currentColor;
  border-radius: 2px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.accordion__chevron::before {
  width: 10px;
  height: 2px;
}

.accordion__chevron::after {
  width: 2px;
  height: 10px;
  transition: opacity var(--ease);
}

.accordion__item[open] > summary .accordion__chevron {
  opacity: 1;
  color: var(--c-text);
}

.accordion__item[open] > summary .accordion__chevron::after {
  opacity: 0;
}

.accordion__body {
  padding-bottom: var(--sp-3);
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--c-text-muted);
}


/* ── Review card ── */

.review-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.review-card__stars {
  color: var(--c-star);
  font-size: 1.1em;
  letter-spacing: 0.1em;
  line-height: 1;
}

.review-card__text {
  font-size: var(--text-sm);
  line-height: var(--lh-relaxed);
  color: var(--c-text-muted);
  flex: 1;
}

.review-card__meta {
  margin-top: var(--sp-1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-card__author {
  font-size: var(--text-sm);
  font-weight: var(--w-semibold);
  color: var(--c-text);
}

.review-card__date {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}


/* ── Process step ── */

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

@media (min-width: 640px) {
  .steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2);
  align-items: start;
}

.step__num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-text);
  color: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--w-bold);
  flex-shrink: 0;
  line-height: 1;
}

.section--dark .step__num {
  background: #ffffff;
  color: #0A0A0A;
}

.step__title {
  font-size: var(--text-base);
  font-weight: var(--w-semibold);
  margin-bottom: 4px;
  line-height: var(--lh-snug);
}

.step__desc {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  line-height: var(--lh-relaxed);
}

.section--dark .step__desc {
  color: var(--c-text-inv-muted);
}


/* ── Stats (hero счётчики) ── */

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
}

.stat__value {
  font-size: var(--text-4xl);
  font-weight: var(--w-black);
  line-height: 1;
  color: #fff;
}

.stat__label {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 4px;
}


/* ── Includes list (что входит) ── */

.includes {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

@media (min-width: 640px) {
  .includes {
    flex-direction: row;
    gap: var(--sp-4);
  }
}

.include-item {
  flex: 1;
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}

.include-item__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--c-bg-alt);
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.include-item__title {
  font-size: var(--text-base);
  font-weight: var(--w-semibold);
  margin-bottom: 4px;
}

.include-item__desc {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  line-height: var(--lh-relaxed);
}


/* ── Contact block ── */

.contact-channel {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: inherit;
  padding-block: var(--sp-1);
  transition: opacity var(--ease);
  min-height: 48px;
}

.contact-channel:hover {
  opacity: 0.75;
  text-decoration: none;
}

.contact-channel__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--c-bg-dark-3);
  color: var(--c-text-inv-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-channel__label {
  font-size: var(--text-xs);
  color: var(--c-text-inv-muted);
  display: block;
}

.contact-channel__value {
  font-size: var(--text-base);
  font-weight: var(--w-medium);
  color: var(--c-text-inv);
  display: block;
}


/* ── Aggregate rating badge ── */

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.4em 0.75em;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
}

.rating-badge__stars {
  color: var(--c-star);
}

.rating-badge__val {
  font-weight: var(--w-bold);
}

.rating-badge__count {
  color: var(--c-text-muted);
}


/* ── Lightbox (нативный <dialog>) ── */

.lb-open { overflow: hidden; }

.lightbox:not([open]) { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: var(--sp-4);
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100dvh - var(--sp-8));
  object-fit: contain;
  border-radius: var(--r-md);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-full);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
  font-size: 1.25rem;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.lightbox__close {
  top: var(--sp-2);
  right: var(--sp-2);
}

.lightbox__prev {
  left: var(--sp-2);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: var(--sp-2);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__picture {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100% - 128px);
  max-height: calc(100dvh - var(--sp-8));
}

.lightbox__counter {
  position: absolute;
  bottom: var(--sp-2);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--text-sm);
  white-space: nowrap;
  pointer-events: none;
}


/* ── Filter bar (portfolio) ── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-bottom: var(--sp-6);
}

.filter-btn {
  padding: 0.5em 1.1em;
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  border-radius: var(--r-full);
  border: 1.5px solid var(--c-border);
  color: var(--c-text-muted);
  background: transparent;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  min-height: 40px;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--c-text);
  color: var(--c-text);
}

.filter-btn[aria-pressed="true"],
.filter-btn.is-active {
  background: var(--c-text);
  border-color: var(--c-text);
  color: #fff;
}


/* ── Hidden gallery items (JS filter) ── */

.gallery-item.is-hidden {
  display: none;
}
