/*******MEDIA QUERIES********/
@media screen and (max-width:1170px) {

    .wrapper {
        width:940px;
        margin:0 auto;
        display:block;
        margin-top: 20px;
    }

    .upper-header {
       width:940px; 
    }

    .inner-subheader {
    width: 940px;
    margin: auto;
    }


    .logo {
        margin-bottom: 20px;
        width: 300px;
        float: none;
        margin: auto;
    }

    #nav {
        float: none;
        width: 560px;
        margin: auto;
    }

    ul#navlist li a {
    display: block;
    font-size: 16px;
    padding-top: 12px;
    }

    .sf-menu .sub-menu { padding-top: 0px; }

    .book-form {
    width: 940px;
    }
    .inner-form {
    width: 940px;
    margin: auto;
    }

    .l-more p {
    width: 77%;
    }

    .l-more a {
        margin-top: 
    }

    .inputs {
    width: 412px;
    float: left;
    }

    .inputs input[type="text"] {
    float: left;
    padding: 9px 9px 9px;
    width: 168px;}

    .inner-footer {
     width: 950px;   
    }

    .lastdiv {
    width: 950px;
    margin: auto;
    }

    /*Home2*/


    .tabs-widget .tab-links li {
    width: 45%;
    }

    .slide {
    margin-top: 7px;
    width: 291px !important;
    }

    /*Home3*/

    .partners .slide {
    margin-top: 7px;
    width: 156px !important;
    }

    /*Home-Boxed*/
    #boxed {
      width: 950px;
      margin: auto;
      padding: 0 10px;
      background: #fff;
    }

      #boxed header{
      width: 950px;
    }

    #foot-boxed {
      width: 950px;
      margin: auto;
      padding: 0 10px;
    }

    .inner-banner {
    max-width: 950px;
    margin: auto;
    }

    /*Blog*/
    .blog-text {
    float: left;
    width: 444px;
    }

    .blog-box img {
    float: left;
    margin-right: 20px;
    width: 225px;
    }

    .tabs-widget .tab-links li {
    width: 35%;
    }

    /*Contact*/

    .msg-form input[type="text"] {
    width: 163px;
    }

    .msg-form textarea {
    width: 582px;
    }

    /* Portfolio */

    #ourHolder {
    width: 940px;
    }

    #ourHolder div.item {
    width: 215px;
    height: 210px
    }

    .view-two .mask .btn-icon2 {
    margin: -50px 54px 0 !important;
    }

    .view-two .mask .btn-icon {
    margin: 50px 103px 0 !important;
    }

    /*Carousel*/

    .view-sixth h2 {
        margin: 0px 40px 0px 40px;
    }

    .view p {
    padding: 0px 20px 0px;
    }

}
/* for 980px or less */
@media screen and (max-width:980px) {
    .wrapper {
        width:724px;
        margin:0 auto;
        display:block;
        margin-top: 20px;
    }

    .inner-subheader {
    width: 724px;
    margin: auto;
    }

    header {
    position: relative;
    z-index: 999;
    background: #fff;
    width: 100%;
    }

    .flexslider .slides img {
    width: 100%;
    display: block;
    margin-top: 0px;
    }

    .upper-header {
    width: 724px;
    padding-top: 10px;
    }

    .logo {
    width: 300px;
    float: none !important;
    margin: auto !important;
    padding-top: 10px;
    }


    ul#navlist li a {
    font-size: 16px;
    }

    .flex-caption {
      left: 30%;
      bottom: 45%;
      font-size: 26px;
    }

    .book-form {
    width: 724px;
    }

    .inner-form {
    width: 724px;
    margin: auto;
    position: static;
    height: 218px;
    }

    .book-form h4 {
    float: none;
    text-align: center;
    padding: 10px 10px;
    -webkit-border-top-left-radius: 0px;
    -moz-border-radius-topleft: 0px;
    border-top-left-radius: 0px;
    }

    .inputs {
    width: 450px;
    float: left;
    }

    .inputs input[type="text"] {
    float: left;
    padding: 9px 9px 9px;
    width: 186px;
    }

    .l-more p {
    font-size: 16px;
    width: 73%;
    }

    .l-more a {
    margin-top: 35px;
    }
  
    .inner-footer {
     width: 724px;   
    }

    .lastdiv {
    width: 724px;
    margin: auto;
    }

    .height {
        display: none;
    }

    /*Home2*/

    .slide {
    margin-top: 7px;
    width: 347px !important;
    }

    /*Home3*/

    .partners .slide {
    margin-top: 7px;
    width: 144px !important;
    }

    .inner-banner {
    max-width: 724px;
    margin: auto;
    }

    /*Blog*/
    .blog-text {
    float: left;
    width: 100%;

    }

    .blog-box img {
    float: left;
    margin-right: 20px;
    width: 100%;
        margin-bottom: 10px;
    }

    .search input[type="text"] {
    width: 97%;
    border: 1px solid #e8e8e8;
    }

    .tabs-widget .tab-links li {
    width: 12%;
    }

    .side-blog {
        width: 100%;
        margin-left: 0 !important;
    }
    .main-blog {
        width: 100%;
    }
    .main-testimonials {
        width: 100%;
    }

     /*Home-Boxed*/
    #boxed {
      width: 724px;
      margin: auto;
      padding: 0 10px;
      background: #fff;
    }

      #boxed header{
      width: 724px;
    }

    #foot-boxed {
      width: 724px;
      margin: auto;
      padding: 0 10px;
    }

    .msg-form input[type="text"] {
    width: 116px;
    }

    .msg-form textarea {
    width: 442px;
    }

    /* Portfolio */

    #ourHolder {
    width: 724px;
    }

    #ourHolder div.item {
    width: 221px;
    height: 213px;
    }

    .view-two .mask .btn-icon2 {
    margin: -50px 70px 0 !important;
    }

    .view-two .mask .btn-icon {
    margin: 50px 120px 0 !important;
    }

    ul#filterOptions li {
    height: 41px;
    margin-right: 0px;
    }

    /*Carousel*/

    .view-sixth h2 {
        margin: 10px 40px 10px 40px;
    }

    .view p {
    padding: 10px 20px 10px;
    }

}
/* for 700px or less */
@media screen and (max-width:700px) {

    .wrapper {
        width:440px;
        margin:0 auto;
        display:block;
        margin-top: 20px;
    }

    .inner-subheader {
    width: 440px;
    margin: auto;
    }

    .logo {
    width: 270px;
    }

    .upper-header {
    width: 440px;
    }

    /* Main Menu */
    #nav > ul { display: none; }
    #nav select { display: block; padding: 3px; margin-top: 15px; outline: none; border: 1px solid #333; width: 100%; }
    
    #nav {
    float: none;
    width: 410px;
    margin-left: -15px;
    margin: auto;
    }

    .sub-menu span {
      display: block;
    }


    .book-form {
    width: 440px;
    }
    .inner-form {
    width: 440px;
    height: 428px;
    }
    
    .inputs {
    width: 420px;
    float: left;
    }

    .inputs input[type="text"] {
    float: left;
    padding: 9px 9px 9px;
    width: 376px;
    }

    .book-form input[type="submit"] {
    width: 393px;
    color: #fff;
    padding: 19px 40px;
    margin-top: 15px;
    }

    .l-more p {
    font-size: 16px;
    width: 100%;
    padding-left: 0;
    margin: 0 0 10px;
    float: none;
    }

    .l-banner {
    padding: 20px;
    }

    .l-more a {
    float: none;
    display: block;
    margin-top: 10px;
    text-align: center;
    }

    footer {
    background: #2190d7;
    clear: both;
    }


    .inner-footer {
     width: 440px;   
     padding-top: 5px;
    }

    .lastdiv {
    width: 440px;
    margin: auto;
    }

    .copyright {
        float: none;
    }

    .f-socials {
        float: none;
        padding-top: 0;
    }

    #back-to-top {
    right: 0;
    bottom: -81px;
    }

    /*Home2*/
    .slide {
    margin-top: 7px;
    width: 200px !important;
    }

    .inner-banner {
    max-width: 440px;
    margin: auto;
    }


    /*Blog*/

    .tabs-widget .tab-links li {
    width: 28%;
    }

    .side-blog .tab-links li:first-child a:before {
    left: 50px;
    }

    .side-blog .tab-links li:last-child a:before {
        left: 50px;
    }

    .search input[type="text"] {
    width: 95%;
    border: 1px solid #e8e8e8;
    }

    .widget-text {
        margin-bottom: 20px;
    }

    .tag-cloud {
        margin-bottom: 20px;
    }

    /*Home-Boxed*/
    #boxed {
      width: 440px;
      margin: auto;
      padding: 0 10px;
      background: #fff;
    }

      #boxed header{
      width: 440px;
    }

    #foot-boxed {
      width: 440px;
      margin: auto;
      padding: 0 10px;
    }

    .msg-form input[type="text"] {
    width: 104px;
    }

    .msg-form textarea {
    width: 406px;
    }

    /* Portfolio */

    #ourHolder {
    width: 440px;
    }

    #ourHolder div.item {
    width: 200px;
    height: 193px;
    }

    .view-two .mask .btn-icon2 {
    margin: -50px 50px 0 !important;
    }

    .view-two .mask .btn-icon {
    margin: 50px 100px 0 !important;
    }

    ul#filterOptions {
    width: 100%;
    height: 82px;
    }

    /*Carousel*/

    .view-sixth h2 {
        margin: 0px 40px 0px 40px;
        font-size: 12px;
    }

    .view p {
    padding: 0px 20px 0px;
    font-size: 10px;
    }

    .view a.info {
    padding: 2px 5px;
    font-size: 10px;
    }
        

}
/* for 480px or less */
@media screen and (max-width:480px) {

 .wrapper {
        width:300px;
        margin:0 auto;
        display:block;
        margin-top: 20px;
    }

    .inner-subheader {
    width: 300px;
    margin: auto;
    }
    .upper-header {
    width: 300px;
    }

    .logo {
        width:255px;
        overflow:hidden;
    }

    .logo img {
    margin: auto;
    width: 255px;
    }

    #nav {
    float: none;
    width: 290px;
    margin-left: -15px;
    margin: auto;
    }

   
   .subheader .subheader2 {
    float: none;
    }

    .subheader .phone {
     float: none;   
    }

    .flex-caption {
      display: none;
    }
    .flex-direction-nav a  {
        display: none;
    }

    .book-form {
    width: 300px;
    }

    .inner-form {
    width: 300px;
    }

    .inputs {
    width: 286px;
    float: left;
    }

    .inputs input[type="text"] {
    float: left;
    padding: 9px 9px 9px;
    width: 243px;
    }

    .book-form input[type="submit"] {
    width: 260px;
    }


    .inner-footer {
     width: 300px;   
    }
    .lastdiv {
    width: 300px;
    margin: auto;
    }

    .slide {
    margin-top: 7px;
    width: 300px !important;
    }
    
    .inner-banner {
    width: 300px;
    margin: auto;
    }

    .side-blog .tab-links li:first-child a:before {
        left: 35px;
    }

    .side-blog .tab-links li:last-child a:before {
        left: 35px;
    }

    .search input[type="text"] {
    width: 93%;
    border: 1px solid #e8e8e8;
    }

    /*Home-Boxed*/
    #boxed {
      width: 300px;
      margin: auto;
      padding: 0 10px;
      background: #fff;
    }

      #boxed header{
      width: 300px;
    }

    #foot-boxed {
      width: 300px;
      margin: auto;
      padding: 0 10px;
    }

    /*Contact*/

    .msg-form input[type="text"] {
    width: 265px;
    }

    .msg-form textarea {
    width: 267px;
    }

        #map {
    height: 300px;
    }
    /* Portfolio */

    #ourHolder {
    width: 300px;
    }

    #ourHolder div.item {
    width: 300px;
    height: 270px;
    }

    .view-two .mask .btn-icon2 {
    margin: -50px 90px 0 !important;
    }

   .view-two .mask .btn-icon {
    margin: 80px 150px 0 !important;
    }

    ul#filterOptions {
    width: 100%;
    height: 130px;
    }

    .error-page {
font-size: 146px;
}

    /*Carousel*/

    .view-sixth h2 {
        margin: 10px 40px 10px 40px;
        font-size: 16px;
    }

    .view p {
    padding: 10px 20px 10px;
    font-size: 12px;
    }

    .view a.info {
    padding: 5px 10px;
    font-size: 12px;
    }

}

/* ============================================================
   TMS Institute — Fluid + Mobile Responsive
   ============================================================ */

/* Fluid containers: override all fixed pixel widths */
.wrapper,
.upper-header,
.inner-subheader {
  width: 100% !important;
  max-width: 1170px;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Footer containers: fluid width but no extra padding (columns have their own margins) */
.inner-footer,
.lastdiv {
  width: 100% !important;
  max-width: 1170px;
  box-sizing: border-box;
}

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  z-index: 100;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: #002460;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.active span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* ---- Tablet (≤900px) ---- */
@media screen and (max-width: 900px) {

  /* Header layout: logo left, hamburger right — single row */
  .row2 { position: relative; }
  .upper-header {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    padding: 10px 16px !important;
    width: 100% !important;
  }
  .logo {
    float: none !important;
    margin: 0 !important;
    width: auto !important;
    max-width: 160px;
    padding: 0 !important;
    flex-shrink: 0;
  }
  .logo img { width: 100%; height: auto; }
  .upper-header .clear { display: none; }

  /* Show hamburger, push to right */
  .hamburger { display: flex; margin-left: auto; }

  /* Nav: static wrapper (just holds hamburger on desktop row) */
  #nav {
    float: none !important;
    width: auto !important;
    order: unset !important;
    margin: 0 0 0 auto !important;
    position: static !important;
    flex-shrink: 0;
    display: flex !important;
    align-items: center !important;
  }

  /* Hide the old "Go to..." select dropdown always */
  #nav select,
  #nav > select { display: none !important; }

  /* Mobile navlist: absolute dropdown below full header row */
  ul#navlist {
    display: none !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #002460 !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    list-style: none !important;
    z-index: 1000 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
  }
  ul#navlist.nav-open { display: flex !important; }

  /* Nav items: block so sub-menus stack below, not beside */
  ul#navlist > li {
    display: block !important;
    float: none !important;
    width: 100% !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  }
  ul#navlist > li > a {
    color: #fff !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    background: none !important;
    display: block !important;
  }
  ul#navlist > li.current > a,
  ul#navlist > li > a:hover {
    background: rgba(255,255,255,0.12) !important;
    color: #fff !important;
  }

  /* Sub-menus: stacked below parent link, indented */
  .sf-menu .sub-menu,
  ul#navlist .sub-menu {
    position: static !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: rgba(0,0,0,0.25) !important;
    padding: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
    min-width: 0 !important;
    top: auto !important;
    left: auto !important;
  }
  ul#navlist .sub-menu li {
    display: block !important;
    float: none !important;
    width: 100% !important;
  }
  ul#navlist .sub-menu li a {
    color: #c8d4e8 !important;
    padding: 8px 20px 8px 40px !important;
    font-size: 13px !important;
    display: block !important;
  }
  ul#navlist .sub-menu li a:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.08) !important;
  }

  /* Features: full-width stacked cards */
  .features.dark {
    display: block !important;
    width: 100% !important;
  }
  .features.dark [class*="column"],
  .features.dark .features-items {
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin: 0 0 12px 0 !important;
    padding: 16px 20px !important;
    box-sizing: border-box !important;
    background: #f2f5fa;
    border-left: 4px solid #cc9a22;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    text-align: left !important;
  }
  .features.dark .features-items > a {
    display: block !important;
    background: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
  .features.dark .features-items .service-item { margin: 0 0 8px 0 !important; }
  .features.dark .features-items .service-img img { width: 36px !important; height: 36px !important; margin: 0 !important; }
  .features.dark .features-items h4 { font-size: 15px !important; margin: 6px 0 4px !important; text-align: left !important; }
  .features.dark .features-items p { font-size: 13px !important; margin: 0 !important; text-align: left !important; }
  .features.dark .features-items .line { display: none; }
  .features.dark .clear { display: none; }

  /* Side-by-side sections: stack */
  .tms-criteria-layout,
  .apollo-layout,
  .dr-card {
    flex-direction: column !important;
  }
  .tms-criteria-img img { height: 280px; }
  .dr-avatar { width: 100% !important; }
  .dr-avatar img { max-width: 300px; display: block; }

  /* Treatment journey: 2 per row */
  .steps-section ul.dark {
    flex-wrap: wrap !important;
  }
  .steps-section ul.dark li.step-item {
    flex: 1 1 calc(50% - 8px) !important;
  }

  /* Schedule bar: stack */
  .inner-form-bar {
    flex-direction: column !important;
    min-height: unset !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .form-label {
    width: 100% !important;
    flex-direction: row !important;
    gap: 12px !important;
    padding: 14px 20px !important;
    justify-content: flex-start !important;
    align-self: auto !important;
    min-width: unset !important;
  }
  .form-label img { margin-bottom: 0 !important; }
  .form-fields {
    width: 100%;
    padding: 12px 16px !important;
    box-sizing: border-box;
  }
  .form-fields input[type="text"],
  .form-fields input[type="submit"] {
    width: 100% !important;
    flex: none !important;
    min-width: unset !important;
  }

  /* MSO grid: full width */
  .mso-card { flex: 1 1 100% !important; }

  /* Medical leadership inner width */
  .leadership-section > div[style] {
    width: 100% !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
  }

  /* Footer: 2 per row */
  .inner-footer .column3 {
    width: 50% !important;
    box-sizing: border-box !important;
    margin-bottom: 24px !important;
    padding-right: 16px !important;
  }

  /* l-banner */
  .l-more p { width: 100% !important; float: none !important; margin-bottom: 12px !important; }
  .l-more a { float: none !important; display: inline-block !important; margin-top: 0 !important; }
}

/* ---- Mobile (≤600px) ---- */
@media screen and (max-width: 600px) {

  /* Subheader: stack */
  .inner-subheader {
    flex-direction: column !important;
    text-align: center;
    gap: 4px;
    padding: 8px 16px;
  }
  .subheader2 ul { justify-content: center; }

  /* Features: full-width stacked cards */
  .features.dark {
    display: block !important;
    width: 100% !important;
  }
  .features.dark [class*="column"],
  .features.dark .features-items {
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin: 0 0 12px 0 !important;
    padding: 16px 20px !important;
    box-sizing: border-box !important;
    background: #f2f5fa;
    border-left: 4px solid #cc9a22;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    text-align: left !important;
  }
  .features.dark .features-items > a {
    display: block !important;
    background: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
  .features.dark .features-items .service-item {
    margin: 0 0 8px 0 !important;
  }
  .features.dark .features-items .service-img img {
    width: 36px !important;
    height: 36px !important;
    object-fit: contain;
    margin: 0 !important;
  }
  .features.dark .features-items h4 {
    font-size: 15px !important;
    margin: 6px 0 4px !important;
    word-break: normal !important;
    text-align: left !important;
  }
  .features.dark .features-items p {
    font-size: 13px !important;
    margin: 0 !important;
    word-break: normal !important;
    text-align: left !important;
  }
  .features.dark .features-items .line { display: none; }
  .features.dark .clear { display: none; }

  /* Steps: 1 per row */
  .steps-section ul.dark li.step-item { flex: 1 1 100% !important; }
  .steps-section { padding: 30px 16px !important; }

  /* Hero */
  .hero-section img.hero-img { max-height: 220px; }

  /* Is TMS Right for You image: natural height */
  .tms-criteria-img img { height: auto !important; }

  /* About page */
  .about-intro { flex-direction: column !important; }
  .about-intro .brain-img { width: 100% !important; }

  /* MSO services: 1 column */
  .mso-services-list { columns: 1 !important; }

  /* Footer: 1 per row */
  .inner-footer .column3 {
    width: 100% !important;
    float: none !important;
    margin: 0 0 20px !important;
    padding-right: 0 !important;
  }
  .copyright { float: none !important; text-align: center; }
  .f-socials { float: none !important; text-align: center; padding-top: 8px; }

  /* Apollo / MSO logo+text: wrap */
  .apollo-layout,
  .dr-card { gap: 24px !important; }
}
