/* ─── Type-card with hover/modal illustration ─────────────────────────
   Used on: yubki, platya, bluzy, bryuki, palto, futbolka-i-top, trikotazh,
            dzhinsy, obuv, sumki, aksessuary, volosy-tip-i-tekstura, tip-figury
   Mechanism: text-only card stays as-is; on hover a small preview floats
   over the card; click opens a fullscreen lightbox modal.
   ─────────────────────────────────────────────────────────────────────── */

/* Card affordance — show it is clickable when has illustration */
.type-card.has-illus,
.shape-block.has-illus {
  cursor: pointer;
  position: relative;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.type-card.has-illus:hover,
.shape-block.has-illus:hover {
  background-color: rgba(189, 139, 46, 0.04);
  box-shadow: 0 4px 18px rgba(17, 17, 17, 0.05);
}

/* Tiny "click to view" icon in the corner of the card */
.type-card.has-illus::after,
.shape-block.has-illus::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bd8b2e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='11' r='1.5'/%3E%3Cpath d='M21 17 L15 11 L5 19'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.4;
  transition: opacity .15s ease;
  pointer-events: none;
}

.type-card.has-illus:hover::after,
.shape-block.has-illus:hover::after {
  opacity: 1;
}

/* ─── Hover preview (desktop only) ──────────────────────────────────── */

.type-illus-preview {
  position: fixed;
  width: 280px;
  height: 280px;
  background: #fffaf0;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(17, 17, 17, 0.18);
  padding: 8px;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}

.type-illus-preview.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.type-illus-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Hide hover preview on touch devices (no real hover) */
@media (hover: none), (max-width: 800px) {
  .type-illus-preview {
    display: none !important;
  }
}

/* ─── Modal lightbox ────────────────────────────────────────────────── */

.type-illus-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.78);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.type-illus-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.type-illus-modal-card {
  position: relative;
  background: #fffaf0;
  border-radius: 12px;
  max-width: 760px;
  width: 100%;
  max-height: calc(100vh - 80px);
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  transform: scale(0.96);
  transition: transform .2s ease;
}

.type-illus-modal.is-open .type-illus-modal-card {
  transform: scale(1);
}

.type-illus-modal-image {
  flex: 1;
  min-height: 0;
  background: #fff7e9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.type-illus-modal-image img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.type-illus-modal-caption h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 520;
  margin: 0 0 6px;
  color: #111;
}

.type-illus-modal-caption p {
  font-size: 14px;
  color: #676057;
  line-height: 1.55;
  margin: 0;
}

.type-illus-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(17, 17, 17, 0.06);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease;
}

.type-illus-modal-close:hover {
  background: rgba(17, 17, 17, 0.12);
}

.type-illus-modal-close::before,
.type-illus-modal-close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 1.5px;
  background: #111;
  border-radius: 1px;
}

.type-illus-modal-close::before { transform: rotate(45deg); }
.type-illus-modal-close::after  { transform: rotate(-45deg); }

@media (max-width: 640px) {
  .type-illus-modal { padding: 16px; }
  .type-illus-modal-card { padding: 16px 18px 20px; gap: 12px; }
  .type-illus-modal-caption h3 { font-size: 18px; }
}
