*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #efefef;
  color: #111;
  min-height: 100vh;
}

/* ─── Header ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #111;
  box-shadow: 0 2px 12px rgba(0,0,0,.5);
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo { height: 46px; width: auto; object-fit: contain; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
}

.search-wrap {
  width: 340px;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 0 12px;
  gap: 8px;
  height: 40px;
}

.search-icon { color: #999; flex-shrink: 0; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
  color: #111;
}
.search-input::placeholder { color: #bbb; }

.search-clear {
  border: none;
  background: none;
  color: #aaa;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 50%;
  display: none;
  line-height: 1;
  transition: color .15s;
}
.search-clear:hover { color: #555; }
.search-clear.visible { display: block; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-home {
  color: #aaa;
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 4px;
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.nav-home:hover { color: #fff; background: rgba(255,255,255,.1); }

.btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.btn:hover { opacity: .85; transform: translateY(-1px); }
.btn-follow { background: #a60031; color: #fff; }
.btn-contact { background: #a60031; color: #fff; }

/* ─── Filter Bar ─── */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 66px;
  z-index: 90;
}

.category-wrap { position: relative; }

.category-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid #ddd;
  font-family: inherit;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 8px;
  transition: background .15s, border-color .15s;
}

.cat-label-static {
  font-weight: 400;
  color: #888;
}

.cat-label-value {
  font-weight: 600;
  color: #111;
}
.category-btn:hover { background: #f6f6f6; border-color: #bbb; }
.category-btn svg { transition: transform .2s; }
.category-btn.open svg { transform: rotate(180deg); }

.category-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
  min-width: 190px;
  overflow: hidden;
  list-style: none;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 200;
}

.category-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cat-option {
  padding: 12px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: background .12s;
  color: #333;
}
.cat-option:hover { background: #f5f5f5; }
.cat-option.active { color: #e84011; font-weight: 600; background: #fff6f3; }

.filter-right { display: flex; align-items: center; gap: 16px; }

.item-count { font-size: 13px; color: #777; }

.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.share-btn:hover { background: #f0f0f0; color: #111; }
.share-btn.copied { color: #25a244; }

/* ─── Grid ─── */
.portfolio-grid {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px;
  columns: 5 260px;
  column-gap: 8px;
}

/* ─── Card ─── */
.card {
  break-inside: avoid;
  margin-bottom: 8px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #ddd;
  display: block;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .4s ease;
}

.card:hover img { transform: scale(1.04); }

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, transparent 55%);
  opacity: 0;
  transition: opacity .28s ease;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.card:hover .card-overlay { opacity: 1; }

.card-info { color: #fff; }

.card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-cat-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
  color: rgba(255,255,255,.65);
}

/* ─── No Results ─── */
.no-results {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 100px 20px;
  text-align: center;
  color: #999;
}
.no-results p { font-size: 18px; font-weight: 500; color: #666; }
.no-results span { font-size: 14px; }

/* ─── Lightbox ─── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }

.lb-inner {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lb-inner img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.lb-spinner {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 520;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
}
.lb-spinner.active { display: flex; }

.spinner {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}
.spinner span {
  position: absolute;
  top: 50%;
  left: var(--left);
  width: 35px;
  height: 7px;
  transform: rotate(90deg);
  animation: dominos 1s ease infinite;
  box-shadow: 2px 2px 3px 0px rgba(0,0,0,.6);
}
.spinner span:nth-child(odd)  { background: #A60031; }
.spinner span:nth-child(even) { background: #CB9A38; }
.spinner span:nth-child(1) { --left: 80px; animation-delay: 0.125s; }
.spinner span:nth-child(2) { --left: 70px; animation-delay: 0.3s; }
.spinner span:nth-child(3) { --left: 60px; animation-delay: 0.425s; }
.spinner span:nth-child(4) { --left: 50px; animation-delay: 0.54s; }
.spinner span:nth-child(5) { --left: 40px; animation-delay: 0.665s; }
.spinner span:nth-child(6) { --left: 30px; animation-delay: 0.79s; }
.spinner span:nth-child(7) { --left: 20px; animation-delay: 0.915s; }
.spinner span:nth-child(8) { --left: 10px; animation-delay: 0s; }

@keyframes dominos {
  50%  { opacity: 0.7; }
  75%  { transform: rotate(0deg); }
  80%  { opacity: 1; }
}

.lb-inner img.loading { opacity: 0; }

.lb-caption {
  color: rgba(255,255,255,.8);
  font-size: 14px;
  text-align: center;
}

.lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 510;
}
.lb-close:hover { background: rgba(255,255,255,.3); }

.lb-prev, .lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 32px;
  width: 48px;
  height: 64px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 510;
}
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.25); }

/* ─── Contact Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.contact-modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 380px;
  max-width: 90vw;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateY(12px);
  transition: transform .22s;
}
.modal-overlay.open .contact-modal { transform: translateY(0); }

.contact-modal h2 { font-size: 20px; margin-bottom: 6px; }
.contact-modal > p { font-size: 14px; color: #777; margin-bottom: 24px; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f0f0f0;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: #e0e0e0; }

.contact-options { display: flex; flex-direction: column; gap: 12px; }

.contact-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 10px;
  text-decoration: none;
  color: #111;
  border: 1.5px solid #eee;
  transition: border-color .15s, transform .15s;
}
.contact-option:hover { transform: translateY(-2px); border-color: #ddd; }
.contact-option.whatsapp { color: #25a244; border-color: #d0ead7; }
.contact-option.whatsapp:hover { background: #f3fbf5; border-color: #25a244; }
.contact-option.email { color: #e84011; border-color: #fde3da; }
.contact-option.email:hover { background: #fff6f3; border-color: #e84011; }

.contact-option div { display: flex; flex-direction: column; gap: 2px; }
.contact-option strong { font-size: 15px; }
.contact-option span { font-size: 12px; color: #999; }

/* ─── Footer ─── */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: #999;
  border-top: 1px solid #e0e0e0;
  margin-top: 24px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-credit {
  font-size: 12px;
  color: #bbb;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .portfolio-grid { columns: 4 180px; }
}

@media (max-width: 768px) {
  .search-wrap { width: 220px; }
}

@media (max-width: 640px) {
  .header-inner { padding: 0 12px; }
  .logo { height: 34px; }
  .search-wrap { width: 160px; }
  .search-input { font-size: 13px; }
  .btn { padding: 8px 14px; font-size: 13px; }
  .filter-bar { padding: 0 14px; }
  .item-count { display: none; }
  .portfolio-grid { columns: 2 150px; padding: 8px; column-gap: 5px; }
  .card { margin-bottom: 5px; }
}

@media (max-width: 420px) {
  .search-wrap { display: none; }
  .header-right { justify-content: flex-end; }
}
