.ref-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.ref-cover-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(8px, 2vw, 24px);
  /* responsive spacing */
  pointer-events: none;
  /* lets the back button remain clickable */
  z-index: 10;
}

@media (max-width: 640px) {
  .ref-cover-title {
    align-items: center;
    padding-bottom: 18px;
  }
}

.ref-cover-title h1 {
  margin: 0;
  color: #fff;
  font-weight: 800;
  line-height: 1.15;
  font-size: clamp(22px, 4vw, 46px);
  /* responsive font size only */
  text-shadow: 0 3px 12px rgba(0, 0, 0, .45);
  max-width: min(92%, 980px);
  /* prevent overly long lines */
}

.ref-cover {
  position: relative;
  width: 100%;
  height: 540px;
  overflow: hidden;
  background: #fff;
}

.ref-cover .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ref-cover-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  /* Premium shadow */
}

/* .ref-back removed */

/* Navigation Bas de Page */
.ref-footer-nav {
  padding: 40px 0;
  background: #fff;
  border-top: 1px solid #edf2f7;
}

.ref-footer-nav .container {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
}

.ref-footer-nav .nav-btn {
  text-decoration: none;
  font-weight: 700;
  color: #0B5E92;
  font-size: 1.1rem;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-footer-nav .nav-btn:hover {
  color: #064577;
  transform: translateX(var(--move, 0));
}

.ref-footer-nav .nav-btn.prev {
  --move: -5px;
}

.ref-footer-nav .nav-btn.next {
  --move: 5px;
}

.ref-footer-nav .arrow {
  font-size: 1.4rem;
  font-weight: 400;
}

@media (max-width: 640px) {
  .ref-footer-nav {
    padding: 30px 0;
  }

  .ref-footer-nav .nav-btn {
    font-size: 1rem;
  }
}

@media (max-width: 900px) {

  /* Clean Mobile Layout */
  .ref-title-bar .container {
    display: flex !important;
    flex-direction: column;
    position: relative !important;
    padding-bottom: 0px;
  }

  /* Full Width Cover on Mobile */
  .ref-cover {
    height: auto;
    background: #fff;
    padding-bottom: 0;
  }

  .ref-cover .container {
    padding: 0;
    max-width: 100%;
  }

  .ref-cover-inner {
    border-radius: 0;
    box-shadow: none;
  }

  .ref-cover img {
    border-radius: 0;
    width: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center;
    display: block;
  }
}

.ref-main {
  background: #fff;
  padding: 48px 0 32px 0;
}

.ref-main-grid {
  display: flex;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: flex-start;
}

.ref-desc {
  flex: 2;
}

.ref-desc h2 {
  margin-top: 0;
  color: #0B5E92;
  font-size: 1.4rem;
}

.ref-desc p {
  font-size: 1.1rem;
  color: #222;
  line-height: 1.7;
}

.ref-coords {
  flex: 1;
  background: #ffffff;
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 10px 40px rgba(11, 94, 146, 0.08);
  border: 1px solid rgba(11, 94, 146, 0.05);
  position: sticky;
  top: 100px;
}

.ref-coords h3 {
  margin-top: 0;
  margin-bottom: 24px;
  color: #0B5E92;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ref-coords h3::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, rgba(11, 94, 146, 0.2), transparent);
  border-radius: 2px;
}

.ref-coords ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ref-coords li {
  margin-bottom: 0;
  color: #475569;
  font-size: 0.95rem;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  line-height: 1.5;
}

.ref-coords li .icon {
  font-size: 1.2rem;
  min-width: 44px;
  height: 44px;
  background: #f1f8ff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #0B5E92;
  transition: all 0.3s ease;
}

.ref-coords li:hover .icon {
  background: #0B5E92;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(11, 94, 146, 0.2);
}

.ref-coords li .info {
  display: flex;
  flex-direction: column;
}

.ref-coords li strong {
  display: block;
  color: #64748b;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.ref-coords li span:not(.icon) {
  display: block;
  font-weight: 600;
  color: #1e293b;
  font-size: 0.95rem;
  line-height: 1.4;
}

.ref-gallery-section {
  background: #f1f5f9;
  padding: 40px 0 60px 0;
}

.ref-gallery-section h2 {
  text-align: center;
  color: #0B5E92;
  margin-bottom: 1.5em;
}

.ref-gallery-scroll {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 10px;
  max-width: 1100px;
  margin: 0 auto;
  scroll-snap-type: x mandatory;
}

.ref-gallery-scroll img {
  width: 220px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(30, 40, 90, 0.07);
}

.ref-gallery-scroll img:hover {
  box-shadow: 0 6px 24px rgba(30, 40, 90, 0.13);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: fadeIn .3s;
}

.lightbox .close {
  position: absolute;
  top: 32px;
  right: 48px;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10;
  font-weight: 300;
  transition: color 0.2s;
}

.lightbox .close:hover {
  color: #0B5E92;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(30, 40, 90, 0.18);
  margin-bottom: 24px;
}

.lightbox-thumbs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.thumb-mini {
  width: 60px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0.7;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s, opacity 0.2s;
}

.thumb-mini.active,
.thumb-mini:hover {
  border: 2px solid #0B5E92;
  opacity: 1;
}

@media (max-width: 900px) {
  .ref-main-grid {
    flex-direction: column;
    gap: 24px;
  }

  .ref-coords {
    width: 100%;
    position: relative;
    top: 0;
    padding: 24px;
  }

  .ref-cover {
    height: 200px;
  }
}

.ref-title-bar {
  width: 100%;
  padding: 20px 0;
  background: radial-gradient(circle at 20% 20%, rgb(11, 94, 146) 0%, rgb(5, 56, 107) 45%, rgb(2, 27, 56) 70%, rgb(2, 6, 23) 100%);
  margin-top: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.ref-title-bar .container {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 100% !important;
}

.ref-title-bar h1 {
  margin: 0;
  color: #fff;
  font-weight: 800;
  line-height: 1.2;
  font-size: clamp(22px, 4vw, 42px);
  max-width: 800px;
  text-align: center;
  position: relative;
  z-index: 1;
  /* Ensure text is above potentially overlapping elements */
}

/* CTA Business Button */
.ref-cta-container {
  margin-top: 32px;
  display: flex;
  justify-content: flex-start;
}

.ref-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #0B5E92 0%, #064577 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(11, 94, 146, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ref-cta-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.ref-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(11, 94, 146, 0.45);
  background: linear-gradient(135deg, #0f70ad 0%, #08538c 100%);
}

.ref-cta-btn:hover::before {
  opacity: 1;
}

.ref-cta-btn .icon {
  font-size: 1.25rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

@media (max-width: 640px) {
  .ref-cta-container {
    justify-content: center;
    margin-top: 40px;
  }

  .ref-cta-btn {
    width: 100%;
    /* Full width on mobile for better touch target */
    justify-content: center;
  }
}

/* Medelec Value Added */
.ref-added-value {
  background: #f1f8ff;
  /* Very light blue background */
  border-left: 4px solid #0B5E92;
  /* Brand accent */
  border-radius: 8px;
  padding: 20px 24px;
  margin: 32px 0 24px;
  box-shadow: 0 2px 8px rgba(11, 94, 146, 0.05);
  /* Subtle lift */
}

.ref-added-value h4 {
  margin: 0 0 12px;
  color: #064577;
  /* Darker blue for contrast */
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ref-added-value h4 .icon {
  font-size: 1.25rem;
}

.ref-added-value ul {
  margin: 0;
  padding-left: 20px;
  /* Indent list */
  list-style: none;
  /* Custom bullet */
}

.ref-added-value li {
  position: relative;
  margin-bottom: 8px;
  color: #334155;
  /* Slate color */
  font-size: 0.95rem;
  line-height: 1.5;
}

.ref-added-value li:last-child {
  margin-bottom: 0;
}

.ref-added-value li::before {
  content: "✔";
  /* Checkmark */
  position: absolute;
  left: -20px;
  color: #10b981;
  /* Success Green */
  font-weight: bold;
  font-size: 0.9rem;
  top: 2px;
}

/* Context Badge */
.ref-context-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  color: #0369a1;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 10px;
  margin-bottom: 24px;
  border: 1px solid rgba(186, 230, 253, 0.5);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .ref-added-value {
    padding: 16px;
  }
}