/* =========================================
   PROFESSIONAL JOINT REPLACEMENT REDESIGN
   (Pure CSS OVERHAUL - No HTML Changes)
========================================= */

/* --- GLOBAL RESETS & TYPOGRAPHY --- */
body.clinic-body {
    background-color: #f8f9fa; /* Sleek, clinical light gray */
    overflow-x: hidden;
    color: #4a5568;
}

.text-gold { color: #d4af37 !important; }
.text-blue { color: #0056b3 !important; }

/* Keep global header styles intact */
.clinic-logo-img { height: 65px; transform: scale(2); transition: 0.3s; filter: none !important; }
.clinic-header { background: #ffffff !important; box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important; padding: 10px 0 !important; }
.clinic-header .nav-link { color: #333333 !important; text-shadow: none !important; font-weight: 600 !important; }
.clinic-header.scrolled .header-phone { background: linear-gradient(135deg, #013578 0%, #136ab6 100%) !important; }

/* --- HERO SECTION REFINEMENT --- */
.jr-hero {
    background: linear-gradient(135deg, #01162e 0%, #003366 100%);
    padding: 180px 0 100px 0; /* Expanded breathing room */
    position: relative;
    border-bottom: 5px solid #d4af37;
}

.jr-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" opacity="0.03" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="%23ffffff"/></svg>');
    pointer-events: none;
}

.jr-tag {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    letter-spacing: 4px;
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 20px;
    background: rgba(212, 175, 55, 0.9);
    padding: 8px 20px;
    border-radius: 4px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.jr-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    font-size: 0; /* Hides original HTML string */
}

/* CSS Override to change "Advanced Joint Replacement" to "Joint Replacement" */
.jr-title::before {
    content: "Joint "; 
    font-size: clamp(40px, 6vw, 64px);
    color: #ffffff;
}
.jr-title .text-gold {
    font-size: clamp(40px, 6vw, 64px);
    color: #d4af37 !important;
}

.jr-subtitle {
    font-family: 'Lato', sans-serif;
    color: rgba(255, 255, 255, 0.85);
    font-size: 19px;
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 300;
}

/* --- TABS NAVIGATION (Professional Hospital Look) --- */
.jr-content-section {
    padding: 0 0 100px 0;
    margin-top: -60px; /* Strong overlap to tie sections together */
    position: relative;
    z-index: 5;
    background-color: #f8f9fa; /* Sleek, clinical light gray wrapper */
}

.jr-tabs-container {
    display: flex;
    justify-content: center;
    gap: 0; /* Flush tabs for clean grid look */
    margin-bottom: 0; 
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08); /* Elevated shadow so it pops off the hero section */
}

/* Center text and increase weight when there are no icons */
.jr-tabs-container.text-only-tabs .jr-tab-btn {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 24px 20px;
}
.jr-tabs-container.text-only-tabs .jr-tab-btn.active {
    font-weight: 700;
}

.jr-tab-btn {
    flex: 1;
    background: #ffffff;
    border: none;
    border-bottom: 3px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    color: #4a5568;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 16px;
    padding: 22px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.jr-tab-btn:last-child {
    border-right: none;
}

.jr-tab-btn i {
    color: #a0aec0;
    font-size: 18px;
    transition: all 0.3s;
}

.jr-tab-btn:hover {
    background: #f8fafc;
    color: #0056b3;
}

.jr-tab-btn.active {
    background: #ffffff;
    color: #0056b3;
    border-bottom: 3px solid #0056b3;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.1); /* Active tab glow */
    z-index: 10; /* Keep shadow visible */
}

.jr-tab-btn.active i {
    color: #d4af37;
}

/* --- PANELS (Clean, Uniform Grid) --- */
.jr-panels-wrapper {
    background: #ffffff;
    border-radius: 0 0 12px 12px;
    padding: 70px 60px;
    min-height: 500px; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.08); /* Stronger overall panel shadow */
}

.jr-panel {
    display: none;
    animation: fadeInSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.jr-panel.active {
    display: block;
}

/* ALIGNMENT FIX: Ensure the text column and image column align nicely without stretching */
.jr-panel .row.g-5 {
    align-items: flex-start; /* Align columns to the top */
}

.panel-title {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    color: #1a202c;
    margin-bottom: 15px;
    font-weight: 700;
}

.panel-accent {
    width: 60px;
    height: 4px;
    background-color: #d4af37;
    margin-bottom: 30px;
    border-radius: 2px;
}

.panel-text {
    font-family: 'Lato', sans-serif;
    font-size: 17px;
    color: #4a5568;
    line-height: 1.8;
    margin-bottom: 25px;
}

/* Customizing the inner "Key Benefits" & "Procedure" headers */
.jr-panel h5.text-blue {
    color: #1a202c !important; /* Darker, more serious */
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    margin-top: 40px !important;
    margin-bottom: 20px !important;
    position: relative;
    padding-bottom: 10px;
}

.jr-panel h5.text-blue::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 40px;
    height: 2px;
    background: #e2e8f0;
}

/* Clean List Styling */
.jr-panel ul li {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 12px !important;
    display: flex;
    align-items: flex-start;
}

.jr-panel ul li i {
    margin-top: 5px;
    font-size: 14px;
    color: #d4af37 !important; /* Gold icons */
}

/* --- IMAGE POLISH: STRICT SIZING FOR EQUAL CONTAINERS --- */
.jr-panel .col-lg-5 {
    display: flex;
    justify-content: center; /* Center the image in its column */
    align-items: flex-start; /* Ensure it doesn't stretch vertically */
}

.panel-img {
    width: 100%;
    max-width: 450px; /* Prevents the image from getting too wide */
    height: 380px !important; /* Strict fixed height for equality across all tabs */
    min-height: auto !important; /* Override inline HTML styles */
    object-fit: cover;
    border-radius: 8px; /* Sharper, modern corners */
    box-shadow: 0 12px 35px rgba(0,0,0,0.12); /* Increased image shadow */
    display: block;
    margin-top: 15px;
}

@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ACCORDION FAQs (Medical Boxed Style) --- */
.mt-5.pt-4.border-top {
    margin-top: 70px !important;
    padding-top: 50px !important;
    border-top: 1px solid #e2e8f0 !important;
}

.clinic-accordion .accordion-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px !important;
    margin-bottom: 20px; /* More space between items */
    background: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04); /* Deeper shadow on accordion cards */
}

.clinic-accordion .accordion-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08); /* Lift effect on hover */
    transform: translateY(-2px);
}

.clinic-accordion .accordion-button {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 17px;
    color: #1a202c;
    background: #f8fafc;
    padding: 22px 25px;
    box-shadow: none;
    border-radius: 8px !important;
}

.clinic-accordion .accordion-button:not(.collapsed) {
    color: #0056b3;
    background: #ffffff;
    box-shadow: none;
    font-weight: 600;
    border-bottom: 1px solid #f1f5f9;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.clinic-accordion .accordion-body {
    font-family: 'Lato', sans-serif;
    color: #4a5568;
    line-height: 1.7;
    padding: 25px;
    font-size: 16px;
    background: #ffffff;
}


/* =========================================
   FINAL RESPONSIVE SYSTEM (SECTION-WISE)
   + HAMBURGER FIX INCLUDED
========================================= */


/* ===============================
   MOBILE + TABLET (≤ 991px)
=============================== */
@media (max-width: 991px) {

  .clinic-header {
      padding: 3px 0 !important;
  }

  /* ---------------------------
     HAMBURGER MENU (IMPORTANT)
  --------------------------- */
  .hamburger-lines {
    display: flex;
    height: 20px;
    width: 28px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 2000;
    position: relative;
  }

  .hamburger-lines .line {
    display: block;
    height: 2px;
    width: 100%;
    background: #000;
    border-radius: 10px;
    transition: 0.4s ease;
  }

  /* ---------------------------
     ABOUT SECTION
  --------------------------- */
  .about-section {
    padding: 60px 15px 40px !important;
  }

  .hero-title {
    font-size: 24px !important;
    margin-bottom: 12px !important;
  }

  .lead-paragraph {
    margin-bottom: 15px !important;
  }

  .doctor-signature {
    margin-bottom: 5px !important;
    padding-top: 10px !important;
  }

  .square-grid {
    margin-top: 8px !important;
    gap: 10px !important;
  }

  /* ---------------------------
     SERVICES SECTION
  --------------------------- */
  .services-scroll-section {
    padding: 40px 0 30px 0;
    justify-content: center;
  }

  .services-header-box {
    margin-bottom: 18px !important;
  }

  .services-main-title {
    font-size: 24px !important;
  }

  .service-box {
    padding: 25px 20px !important;
  }

  .service-box h4 {
    margin-bottom: 8px;
  }

  .service-box p {
    margin-bottom: 12px;
  }

  .mobile-service-controls {
    margin-top: 20px;
  }

  /* ---------------------------
     JR HERO
  --------------------------- */
  .jr-hero {
    padding: 140px 20px 70px;
  }

  .jr-title::before,
  .jr-title .text-gold {
    font-size: 32px !important;
  }

  .jr-subtitle {
    margin-bottom: 15px;
  }

  /* ---------------------------
     JR CONTENT
  --------------------------- */
  .jr-content-section {
    margin-top: -40px;
    padding-bottom: 60px;
  }

  .jr-tabs-container {
    margin-bottom: 10px;
  }

  .jr-tab-btn {
    padding: 15px;
  }

  .jr-panels-wrapper {
    padding: 30px 20px;
  }

  .panel-title {
    font-size: 26px;
    margin-bottom: 10px;
  }

  .panel-text {
    margin-bottom: 15px;
  }

  .panel-img {
    height: 260px !important;
    margin-top: 20px;
  }

  /* ---------------------------
     FAQ SECTION
  --------------------------- */
  .mt-5.pt-4.border-top {
    margin-top: 40px !important;
    padding-top: 25px !important;
  }

  .clinic-accordion .accordion-item {
    margin-bottom: 15px;
  }

  .clinic-accordion .accordion-button {
    padding: 16px;
    font-size: 15px;
  }

}


/* =========================================
   JR PAGE - MOBILE STACKED TABS (NO SCROLL)
========================================= */

@media (max-width: 767px) {

  /* TABS CONTAINER */
  .jr-tabs-container {
    display: flex;
    flex-direction: column;   /* 🔥 STACK */
    gap: 10px;
    padding: 10px 15px;
    box-shadow: none;
    background: transparent;
  }

  /* TAB BUTTON */
  .jr-tab-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;

    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;

    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;

    transition: all 0.3s ease;
  }

  /* ACTIVE TAB */
  .jr-tab-btn.active {
    border: 1px solid #0056b3;
    border-left: 4px solid #0056b3; /* 🔥 premium touch */
    background: #f8fbff;
    font-weight: 600;
  }

  /* REMOVE DESKTOP BORDER SYSTEM */
  .jr-tab-btn:last-child {
    border-right: 1px solid #e2e8f0 !important;
  }

  /* PANEL FIX */
  .jr-panels-wrapper {
    margin-top: 15px;
    padding: 20px 15px;
    border-radius: 8px;
  }

  /* TEXT */
  .panel-title {
    font-size: 22px;
  }

  .panel-text {
    font-size: 14px;
    line-height: 1.5;
  }

  /* IMAGE */
  .panel-img {
    height: 200px !important;
    margin-top: 15px;
  }

}


/* ===============================
   SMALL DESKTOP ADJUSTMENT
=============================== */
@media (min-width: 992px) and (max-width: 1200px) {

  .services-scroll-section {
    padding-top: 70px;
  }

  .jr-hero {
    padding: 160px 0 90px;
  }

  .jr-panels-wrapper {
    padding: 50px 40px;
  }

}