.ca-addons-proyecto {
  --spacing-xl: 80px;
  --spacing-lg: 40px;
  --spacing-md: 20px;
  --border-radius: 40px;
  padding: var(--spacing-xl) var(--spacing-md);
  box-sizing: border-box;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

.ca-addons-proyecto .ca-ap-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.ca-ap-title {
  font-size: 2.5rem;
  font-weight: 600;
  margin: 0 0 15px;
}

.ca-ap-description {
  color: #555555;
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto var(--spacing-lg);
  font-weight: 300;
}

.ca-ap-gallery {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  justify-content: center;
}

.ca-ap-gallery .gallery-column {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  flex: 1;
}

.ca-ap-gallery .gallery-column.main {
  flex: 1.5;
}

.ca-ap-item {
  width: 100% !important;
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
}

/* Force specific heights for the container - AGGRESSIVE */
.ca-ap-gallery .gallery-column.side .ca-ap-item.small {
  height: 350px !important;
}

.ca-ap-gallery .gallery-column.main .ca-ap-item.featured {
  height: 720px !important;
}

.ca-ap-extra-grid .ca-ap-item.small {
  height: 320px !important;
}

/* Force the link to be an absolute overlay filling the container exactly */
.ca-ap-item a.ca-ap-lightbox {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  cursor: pointer;
  z-index: 1;
}

.ca-ap-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ca-ap-item:hover img {
  transform: scale(1.1);
}

/* Unified Overlay Caption */
.ca-ap-caption {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 30px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 2;
  /* Sits above the image link */
  pointer-events: none;
  /* Let clicks pass through to the link below */
}

.ca-ap-item:hover .ca-ap-caption {
  opacity: 1;
  visibility: visible;
}

.ca-ap-caption strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 10px;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ca-ap-item:hover .ca-ap-caption strong {
  transform: translateY(0);
}

.ca-ap-caption-desc {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  line-height: 1.4;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) 0.1s;
}

.ca-ap-item:hover .ca-ap-caption-desc {
  transform: translateY(0);
}

.ca-ap-cta-wrap {
  margin-top: var(--spacing-lg);
}

.ca-ap-cta {
  display: inline-block;
  background-color: #0c0c0c;
  color: #ffffff;
  text-decoration: none;
  padding: 18px 45px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.ca-ap-cta:hover {
  background-color: #333333;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Extra images grid below the main five */
.ca-ap-extra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

/* Ensure items in the extra grid match the 'small' style and sizing */
.ca-ap-extra-grid .ca-ap-item.small {
  height: 300px;
  /* Consistent height for the extra items */
  width: 100%;
}

.ca-ap-field input,
.ca-ap-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  font-size: 14px;
}

.ca-ap-field textarea {
  min-height: 100px;
  resize: vertical;
}

.ca-ap-actions {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.ca-ap-submit {
  background: #0c0c0c;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.ca-ap-wa {
  display: inline-block;
  background: #25D366;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.ca-ap-contact-cta {
  display: inline-block;
  background: #0c0c0c;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.ca-ap-contact-cta:hover {
  opacity: 0.95;
}


.ca-ap-contact-cta:hover {
  opacity: 0.95;
}

.ca-ap-notice {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.ca-ap-success {
  background: #e6ffed;
  color: #1a7f37;
  border: 1px solid rgba(26, 127, 55, 0.15);
}

.ca-ap-error {
  background: #fff4f4;
  color: #8a1f1f;
  border: 1px solid rgba(138, 31, 31, 0.08);
}

/* Lightbox styles */
.ca-ap-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.ca-ap-lightbox-overlay.open {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}

.ca-ap-lightbox-inner {
  position: relative;
  max-width: 1100px;
  width: 96%;
  z-index: 10;
}

.ca-ap-lb-wrap {
  display: flex;
  gap: 30px;
  align-items: stretch;
}

.ca-ap-lb-media {
  flex: 1;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: calc(100% - 460px);
}

.ca-ap-lb-side {
  flex: 0 0 420px;
  max-width: 420px;
  padding: 18px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.ca-ap-lb-item-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}

.ca-ap-lb-item-desc {
  color: #ddd;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.ca-ap-lb-side form .ca-ap-field input,
.ca-ap-lb-side form .ca-ap-field textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #fff;
}

.ca-ap-lb-side form .ca-ap-field input::placeholder,
.ca-ap-lb-side form .ca-ap-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.ca-ap-lb-image {
  max-width: 100%;
  max-height: 85vh;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
  border-radius: 6px;
}

.ca-ap-lb-caption {
  color: #fff;
  margin-top: 12px;
  text-align: center;
  font-size: 1rem;
  opacity: 0.95;
}

.ca-ap-lb-prev,
.ca-ap-lb-next,
.ca-ap-lb-close {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 28px;
}

.ca-ap-lb-prev {
  left: -60px;
}

.ca-ap-lb-next {
  right: -60px;
}

.ca-ap-lb-close {
  right: -10px;
  top: -30px;
  transform: none;
  width: 36px;
  height: 36px;
  font-size: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .ca-ap-lb-wrap {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .ca-ap-lb-prev {
    left: 8px;
  }

  .ca-ap-lb-next {
    right: 8px;
  }

  .ca-ap-lb-close {
    right: 8px;
    top: 8px;
  }

  .ca-ap-lb-image {
    max-height: 50vh;
  }

  .ca-ap-lb-side {
    width: 100%;
    max-width: none;
  }
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .ca-ap-gallery {
    flex-direction: column;
  }

  .ca-ap-gallery .gallery-column.main {
    order: -1;
  }

  .ca-ap-gallery .gallery-column.side .ca-ap-item.small,
  .ca-ap-gallery .gallery-column.main .ca-ap-item.featured {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .ca-ap-title {
    font-size: 2rem;
  }

  .ca-ap-description {
    font-size: 1rem;
  }
}

/* Commercial Lightbox Specifics */
.ca-ap-lightbox-overlay[data-type="commercial"] .ca-ap-lb-header {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.ca-ap-lightbox-overlay[data-type="commercial"] .ca-ap-lb-thumb {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ca-ap-lightbox-overlay[data-type="commercial"] .ca-ap-lb-header-text {
  flex: 1;
}

.ca-ap-lightbox-overlay[data-type="commercial"] .ca-ap-lb-item-title {
  font-size: 1.4rem;
  margin-bottom: 5px;
}

.ca-ap-lightbox-overlay[data-type="commercial"] .ca-ap-lb-item-desc {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #ccc;
}

@media (max-width: 768px) {
  .ca-ap-lightbox-overlay[data-type="commercial"] .ca-ap-lb-header {
    flex-direction: row;
    /* keep thumb next to text even on mobile if possible, or stack if too narrow */
  }

  .ca-ap-lightbox-overlay[data-type="commercial"] .ca-ap-lb-thumb {
    width: 80px;
    height: 80px;
  }
}