/* ==========================================================================
   PORTFOLIO SECTION STYLES
   ========================================================================== */

/* Main Section */
.portfolio-section {
  position: relative;
  padding: 120px 0 140px;
  background: linear-gradient(145deg, #f8f9fa 0%, #eaeaea 100%);
  overflow: hidden;
  z-index: 1;
}

.portfolio-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
      radial-gradient(circle at 25px 25px, rgba(192, 189, 48, 0.15) 2%, transparent 0%),
      radial-gradient(circle at 75px 75px, rgba(192, 189, 48, 0.1) 2%, transparent 0%);
  background-size: 100px 100px;
  z-index: -1;
  opacity: 0.4;
  animation: pattern-pulse 15s ease-in-out infinite alternate;
}

.portfolio-section::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -200px;
  width: 700px;
  height: 700px;
  border-radius: 71% 29% 65% 35% / 42% 73% 27% 58%;
  background: linear-gradient(135deg, rgba(192, 189, 48, 0.04) 0%, rgba(192, 189, 48, 0.02) 100%);
  animation: blob-float 20s infinite alternate ease-in-out;
  z-index: -1;
  filter: blur(60px);
}

/* ==========================================================================
   SECTION HEADER
   ========================================================================== */

.section-header {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.section-badge {
  display: inline-flex;
  padding: 10px 20px;
  background-color: rgba(192, 189, 48, 0.08);
  color: #C0BD30;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  border-radius: 30px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(192, 189, 48, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 15px;
}

.section-badge::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
  animation: badge-shine 3s infinite;
}

.section-heading {
  font-size: 42px;
  font-weight: 800;
  color: #222;
  margin: 20px 0 25px;
  line-height: 1.2;
  position: relative;
  letter-spacing: -0.5px;
}

.highlight-text {
  position: relative;
  color: #C0BD30;
  z-index: 1;
}

.highlight-text::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 10px;
  background-color: rgba(192, 189, 48, 0.15);
  z-index: -1;
  transform: skewX(-12deg);
  border-radius: 4px;
}

.section-subtitle {
  font-size: 18px;
  color: #666;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   PORTFOLIO FILTER
   ========================================================================== */

.portfolio-filter-wrapper {
  margin: 50px 0 40px;
  position: relative;
  z-index: 2;
}

.portfolio-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 0;
  list-style: none;
  margin: 0 0 40px 0;
}

.portfolio-filter .filter-item {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #444;
  background-color: #fff;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(192, 189, 48, 0.05);
  position: relative;
  overflow: hidden;
}

.portfolio-filter .filter-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #C0BD30, #d8d534);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.portfolio-filter .filter-item:hover,
.portfolio-filter .filter-item.active {
  color: #fff;
  background: linear-gradient(135deg, #C0BD30, #d8d534);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(192, 189, 48, 0.2);
}

.portfolio-filter .filter-item:hover::after,
.portfolio-filter .filter-item.active::after {
  transform: scaleX(1);
}

/* ==========================================================================
   PORTFOLIO GRID & ITEMS
   ========================================================================== */

   .portfolio-grid {
    position: relative;
    max-width: 1280px;  
    width: 100%;        
    margin-left: auto;  
    margin-right: auto; 
    padding: 0 15px;    
    overflow: visible;
    min-height: 630px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.portfolio-item {
  width: calc(33.333% - 48px);
  padding: 24px;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.portfolio-item.show {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   PORTFOLIO CARD
   ========================================================================== */

  .portfolio-card {
  background-color: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  height: 600px;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.215, 0.61, 0.355, 1),
              box-shadow 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
  position: relative;
}

.portfolio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #C0BD30, #d8d534);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: 2;
}

.portfolio-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.portfolio-card:hover::before {
  transform: scaleX(1);
}

/* ==========================================================================
   CARD IMAGE
   ========================================================================== */

.portfolio-image-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 65%;
  background-color: #f5f5f5;
}

.portfolio-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.portfolio-image-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-color: rgba(192, 189, 48, 0.2);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-image-wrapper.loading::after {
  opacity: 1;
  animation: pulse 1.5s infinite;
}

.portfolio-card:hover .portfolio-image {
  transform: scale(1.05);
}

.portfolio-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 60%);
  opacity: 0.4;
  transition: all 0.4s ease;
}

.portfolio-card:hover .portfolio-image-overlay {
  opacity: 0.6;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 70%);
}

.portfolio-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 8px 16px;
  background-color: rgba(255, 255, 255, 0.85);
  color: #333;
  font-size: 13px;
  font-weight: 600;
  border-radius: 30px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2;
  transition: all 0.4s ease;
  border-left: 3px solid #C0BD30;
}

.portfolio-card:hover .portfolio-badge {
  background-color: rgba(192, 189, 48, 0.85);
  color: #fff;
  box-shadow: 0 4px 12px rgba(192, 189, 48, 0.25);
}

/* ==========================================================================
   CARD CONTENT
   ========================================================================== */

.portfolio-content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-title {
  font-size: 20px;
  font-weight: 700;
  color: #222;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.portfolio-card:hover .portfolio-title {
  color: #C0BD30;
}

.portfolio-description {
  font-size: 15px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 20px;
  flex-grow: 1;
}

.portfolio-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #C0BD30, #d8d534);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(192, 189, 48, 0.15);
  align-self: flex-start;
  margin-top: auto;
}

.portfolio-button:hover {
  background: linear-gradient(135deg, #d8d534, #C0BD30);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(192, 189, 48, 0.3);
  color: #fff;
  text-decoration: none;
}

.portfolio-button:focus,
.portfolio-button:active {
  color: #fff;
  text-decoration: none;
  outline: none;
}

.portfolio-button i {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.portfolio-button:hover i {
  transform: translateX(3px);
}

/* ==========================================================================
   CTA BUTTON
   ========================================================================== */

.portfolio-cta {
  text-align: center;
  margin-top: 40px;
}

.btn-portfolio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px;
  background: linear-gradient(135deg, #C0BD30, #d8d534);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: 40px;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(192, 189, 48, 0.25);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
  border: none;
}

.btn-portfolio::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
  transition: all 0.8s ease;
  z-index: 1;
}

.btn-portfolio:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 30px rgba(192, 189, 48, 0.35);
  color: #fff;
  text-decoration: none;
}

.btn-portfolio:hover::before {
  left: 100%;
}

.btn-portfolio:focus,
.btn-portfolio:active {
  color: #fff;
  text-decoration: none;
  outline: none;
}

.btn-portfolio span {
  position: relative;
  z-index: 2;
}

.btn-portfolio i {
  margin-left: 12px;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
}

.btn-portfolio:hover i {
  transform: translateX(5px);
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */

.portfolio-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(5px);
  padding: 20px;
  box-sizing: border-box;
}

.portfolio-modal.show {
  opacity: 1;
  visibility: visible;
}

.portfolio-modal-body {
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  color: var(--modal-text);
  line-height: 1.6;
  box-sizing: border-box;
}

.portfolio-modal-content {
  position: relative;
  background-color: #000;
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

.portfolio-modal.show .portfolio-modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.3s, transform 0.3s;
  font-size: 32px;
  z-index: 10;
}

.modal-close:hover {
  background: var(--modal-accent);
  transform: rotate(90deg);
}

/* Header vira um "hero" sem padding interno */
.modal-header {
  position: relative;
  padding: 0;              
  border-bottom: 1px solid #dee2e6;
  background: #000;           /* evita flash branco */
  overflow: hidden;
  border-radius: 12px 12px 0 0; 
}

/* Container define a altura do hero (responsivo) */
.modal-header-container {
  position: relative;
  width: 100%;
  height: clamp(180px, 30vh, 460px); /* mobile -> desktop */
  overflow: hidden;
  margin: 0;
  display: block;           
  background: #000;

  /* cor padrão (fallback) */
  --dominant: rgba(0, 0, 0, 0.55);
}

/* camada que reage à cor dominante */
.modal-header-container::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;                 /* fica acima do blur, abaixo da imagem */
  background: radial-gradient(
    circle at 30% 20%,
    var(--dominant),
    rgba(0,0,0,0.65) 60%,
    rgba(0,0,0,0.85) 100%
  );
  mix-blend-mode: color;    
  opacity: .75;
  pointer-events: none;
}

/* Blur continua como fundo */
.modal-header-blur-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(24px);     /* aumenta blur */
  transform: scale(1.25); /* evita bordas visíveis */
  opacity: 0.25;         
  z-index: 1;
  pointer-events: none;
}

/* Imagem principal agora é CAPA */
.modal-header-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;         
  object-position: center;   
  z-index: 3;               

  /* remove “card/miniatura” */
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  display: block;
  transition: transform .35s ease, object-fit .3s ease;
  filter: none;               /* separa visualmente do blur */
}

/* Imagens quadradas ou verticais - Adaptive Fitting */
.modal-header-img.contain {
  object-fit: contain;
  background: transparent;   
}

.portfolio-modal.show .modal-header-img {
  transform: scale(1.03);
}

.modal-category {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 8px 20px;
  background: rgba(192, 189, 48, 0.9);
  color: #ffffff;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
  font-size: 14px;
  font-weight: 600;
  border-radius: 30px;
  backdrop-filter: blur(4px);
  z-index: 5;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: 
    radial-gradient(circle at 50% 30%, rgba(0,0,0,.05), rgba(0,0,0,.65) 70%, rgba(0,0,0,.9)), 
    linear-gradient(to bottom, rgba(0,0,0,.15), rgba(0,0,0,.55));
  pointer-events: none;
}

.modal-content-inner {
  position: relative;
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  background-color: var(--modal-bg);
  z-index: 2;
}

.modal-content-inner::-webkit-scrollbar {
  width: 8px;
}

.modal-content-inner::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.modal-content-inner::-webkit-scrollbar-thumb {
  background: #C0BD30;
  border-radius: 4px;
}

.modal-content-inner::-webkit-scrollbar-thumb:hover {
  background: #a8a529;
}

.modal-title {
  font-size: 36px;
  font-weight: 800;
  color: #C0BD30;
  margin-bottom: 1em;
  margin-top: 0.5em;
  text-align: center;
  letter-spacing: -1px;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(192,189,48,0.08), 0 1px 0 #fff;
  position: relative;
}

.modal-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #C0BD30, #d8d534);
  margin: 16px auto 0 auto;
  border-radius: 2px;
  opacity: 0.7;
}

.modal-metadata {
  display: flex;
  gap: 30px;
  margin-bottom: 5px;
}

.metadata-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
}

.metadata-item i {
  color: #C0BD30;
}

.modal-description {
  font-size: 16px;
  line-height: 1.8;
  color: #444;
  margin-bottom: 30px;
}

.modal-client {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
  padding: 15px;
  background-color: #f8f8f8;
  border-radius: 12px;
  border-left: 4px solid #C0BD30;
}

.modal-client-icon {
  margin-right: 15px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C0BD30, #d8d534);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.modal-client-details {
  flex: 1;
}

.modal-client-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 3px;
}

.modal-client-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.modal-features {
  margin-bottom: 30px;
}

.modal-features h3,
.modal-technologies h3 {
  font-size: 20px;
  font-weight: 600;
  color: #222;
  margin-bottom: 15px;
}

.features-list,
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.features-list li,
.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: #444;
  position: relative;
  padding-left: 28px;
}

.features-list li::before,
.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  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='%23C0BD30'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-tag {
  padding: 6px 16px;
  background: #f5f5f5;
  color: #444;
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.tech-tag:hover {
  background: #C0BD30;
  color: #fff;
  transform: translateY(-2px);
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 30px;
}

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  height: 120px;
  background-color: #f5f5f5;
  position: relative;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-zoom-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover .gallery-zoom-icon {
  opacity: 1;
}

.gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
  opacity: 1;
}

.modal-cta {
  display: flex;
  justify-content: center;
  margin-top: 35px;
}

.modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 30px;
  background: linear-gradient(135deg, #C0BD30, #d8d534);
  color: white;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(192, 189, 48, 0.2);
}

.modal-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(192, 189, 48, 0.3);
  background: linear-gradient(135deg, #d8d534, #C0BD30);
  color: white;
  text-decoration: none;
}

.modal-btn i {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.modal-btn:hover i {
  transform: translateX(3px);
}

/* ==========================================================================
   ISOTOPE STYLES
   ========================================================================== */

.isotope-item {
  z-index: 2;
  backface-visibility: hidden;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.isotope-hidden.isotope-item {
  pointer-events: none;
  z-index: 1;
}

.isotope,
.isotope .isotope-item {
  transition-duration: 0.5s;
}

.isotope {
  transition-property: height, width;
}

.isotope .isotope-item {
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes pattern-pulse {
  0% {
    opacity: 0.3;
    background-size: 100px 100px;
  }
  50% {
    opacity: 0.5;
    background-size: 110px 110px;
  }
  100% {
    opacity: 0.3;
    background-size: 100px 100px;
  }
}

@keyframes blob-float {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    border-radius: 70% 30% 65% 35% / 42% 73% 27% 58%;
  }
  50% {
    transform: translate(20px, -20px) rotate(4deg) scale(1.03);
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
  }
  100% {
    transform: translate(-10px, 10px) rotate(-2deg) scale(0.97);
    border-radius: 65% 35% 60% 40% / 45% 65% 35% 55%;
  }
}

@keyframes badge-shine {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.6; }
}

/* ==========================================================================
   MEDIA QUERIES - RESPONSIVIDADE
   ========================================================================== */

/* Estilos específicos para Home Portfolio Grid */
#homePortfolioGrid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center; /* ou center  */
  width: 100%;
  margin-left: 2em;
}

#homePortfolioGrid .portfolio-item {
  width: calc(33.333% - 48px);
  padding: 10px;
  box-sizing: border-box;
  position: relative;
  /* Remova position: absolute, left, top se não for necessário para o layout */
}

/* Forçar override dos estilos inline do Isotope em mobile */
@media (max-width: 576px) {
  #homePortfolioGrid.isotope .portfolio-item {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    top: 0 !important;
    float: none !important;
  }
  
  #homePortfolioGrid[style] {
    height: auto !important;
    min-height: auto !important;
  }
  
  #homePortfolioGrid .portfolio-item[style] {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    top: 0 !important;
  }
}

/* Desktop Grande (1200px+) */
@media (max-width: 1200px) {
  .portfolio-item {
    width: calc(33.333% - 30px);
  }

  .section-heading {
    font-size: 36px;
  }
}

/* Tablet (992px - 768px) */
@media (max-width: 992px) {
  .portfolio-section {
    padding: 100px 0 120px;
  }

  .portfolio-item {
    width: calc(50% - 30px);
    padding: 15px;
  }

  .portfolio-grid {
    min-height: auto !important;
    height: auto !important;
  }
  
  #homePortfolioGrid {
    height: auto !important;
    min-height: auto !important;
  }

  .section-heading {
    font-size: 32px;
  }
  
  .features-list,
  .feature-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Pequeno (768px) */
@media (max-width: 768px) {
  .portfolio-section {
    padding: 80px 0 100px;
  }

  .section-heading {
    font-size: 28px;
  }

  .modal-title {
    font-size: 24px;
    margin-top: 1.5em;
  }
  
  .modal-header-img {
    height: 220px;
  }
  
  .features-list,
  .feature-list {
    grid-template-columns: 1fr;
  }
  
  .modal-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-modal-content {
    margin: 0;
    max-height: calc(100vh - 2rem);
  }
  
  .modal-content-inner {
    padding: 1.5rem;
  }

  .modal-metadata {
    flex-direction: column;
    gap: 15px;
  }
  
  /* Força layout em bloco para mobile */
  .portfolio-grid .portfolio-item {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    top: 0 !important;
    float: none !important;
    display: block !important;
    width: calc(50% - 30px) !important;
    margin-bottom: 30px;
  }
  
  #homePortfolioGrid .portfolio-item {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    top: 0 !important;
    float: none !important;
    display: block !important;
    width: calc(50% - 30px) !important;
    margin-bottom: 30px;
  }
}

/* Mobile (576px) */
@media (max-width: 576px) {
  .portfolio-section {
    padding: 60px 0 80px;
  }

  .portfolio-item {
    width: calc(100% - 30px);
    padding: 15px;
    margin-bottom: 30px;
  }

  .portfolio-grid {
    min-height: auto !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .portfolio-grid .portfolio-item {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    top: 0 !important;
    float: none !important;
    display: block !important;
    width: calc(100% - 30px) !important;
    max-width: 400px !important;
    margin-bottom: 30px !important;
    order: initial !important;
  }
  
  /* Estilo específico para itens filtrados em mobile */
  .portfolio-grid .portfolio-item[style*="display: block"] {
    order: -1 !important;
  }
  
  .portfolio-grid .portfolio-item[style*="display: none"] {
    order: 999 !important;
    margin-bottom: 0 !important;
  }
  
  #homePortfolioGrid {
    height: auto !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  #homePortfolioGrid .portfolio-item {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    top: 0 !important;
    float: none !important;
    display: block !important;
    width: calc(100% - 30px) !important;
    max-width: 400px !important;
    margin-bottom: 30px !important;
    order: initial !important;
  }
  
  /* Estilo específico para itens filtrados em mobile - Home */
  #homePortfolioGrid .portfolio-item[style*="display: block"] {
    order: -1 !important;
  }
  
  #homePortfolioGrid .portfolio-item[style*="display: none"] {
    order: 999 !important;
    margin-bottom: 0 !important;
  }

  .section-heading {
    font-size: 26px;
  }

  .section-badge {
    font-size: 12px;
    padding: 8px 16px;
  }

  .portfolio-filter .filter-item {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .portfolio-card:hover {
    transform: translateY(-8px);
  }
  
  .modal-content-inner {
    padding: 1.5rem;
  }
  
  .modal-title {
    font-size: 22px;
    margin-top: 2.5em;
  }
  
  .modal-btn {
    width: 100%;
    padding: 12px 20px;
  }
  
  .modal-gallery {
    grid-template-columns: repeat(1, 1fr);
    gap: 10px;
  }
  
  .gallery-item {
    height: 180px;
  }
}

/* Mobile Muito Pequeno (480px) */
@media (max-width: 480px) {
  .portfolio-section {
    padding: 50px 0 60px;
  }
  
  #homePortfolioGrid {
    margin: 0 -10px !important;
  }
  
  #homePortfolioGrid .portfolio-item {
    width: calc(100% - 20px) !important;
    padding: 10px !important;
    margin-bottom: 20px !important;
  }
  
  .portfolio-card {
    height: auto !important;
    min-height: 450px;
  }
  
  .portfolio-content {
    padding: 20px;
  }
  
  .portfolio-title {
    font-size: 18px;
  }
  
  .portfolio-description {
    font-size: 14px;
  }
}

/* Estilos para o modal de imagem expandida */
.gallery-image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-image-modal.show {
  opacity: 1;
}

.gallery-image-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  margin: auto;
}

.gallery-image-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gallery-close-btn {
  position: absolute;
  top: -40px;
  right: -40px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  opacity: 0.8;
}

.gallery-close-btn:hover {
  transform: scale(1.1);
  opacity: 1;
}

/* Ajuste para dispositivos móveis */
@media (max-width: 768px) {
  .gallery-close-btn {
    top: -35px;
    right: 0;
    font-size: 28px;
  }
  
  .gallery-image-content {
    max-width: 95%;
  }

  .modal-close {
    background: #fff !important;   
    color: #222 !important;       
    box-shadow: 0 2px 8px rgba(0,0,0,0.12); 
    opacity: 1 !important;        
  }
  .modal-close:hover {
    background: var(--modal-accent) !important; 
    color: #222 !important;
    transform: rotate(90deg);
  }
}

:root {
  --modal-bg: #ececec;
  --modal-text: #1a1a1a;
  --modal-accent: #C0BD30;
}

@media (max-width: 600px) {
  .portfolio-modal-content {
    max-width: 98vw;
    border-radius: 10px;
    margin: 1vw;
    padding: 0;
  }
  .modal-content-inner,
  .portfolio-modal-body .modal-body {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .portfolio-modal-content {
    margin: 0.5rem;
    max-height: calc(100vh - 2rem);
  }
}

@media (max-width: 480px) {
  .modal-header-container {
    height: clamp(160px, 26vh, 260px);
  }
  
  .portfolio-modal-content {
    margin: 0;
    max-height: calc(100vh - 1rem);
  }
}

/* Media queries para ajuste responsivo */
@media (min-width: 1200px) {
  /* Mantém estilos base do hero banner */
}

@media (max-width: 992px) {
  /* Mantém estilos base do hero banner */
}