/*=====================================================================
                RESPONSIVE CSS
                PART 1
        Desktop • Laptop • Large Tablet
======================================================================*/


/*==========================================================
EXTRA LARGE DESKTOP
1600px+
==========================================================*/

@media (min-width:1600px){

.container{

max-width:1450px;

}

.hero{

min-height:100vh;

}

.hero-title{

font-size:6rem;

}

.section{

padding:140px 0;

}

.gallery-grid{

grid-template-columns:
repeat(4,1fr);

}

}


/*==========================================================
LARGE DESKTOP
1400px
==========================================================*/

@media (max-width:1400px){

.container{

max-width:1240px;

}

.hero{

padding:150px 0 100px;

}

.hero-title{

font-size:5rem;

}

.hero-text{

max-width:650px;

}

.hero-image img{

max-width:520px;

}

.section{

padding:110px 0;

}

.gallery-grid{

grid-template-columns:
repeat(3,1fr);

gap:28px;

}

.card{

padding:28px;

}

.footer{

padding:90px 0 30px;

}

}


/*==========================================================
LAPTOP
1200px
==========================================================*/

@media (max-width:1200px){

.container{

max-width:1140px;

}

.navbar{

padding:16px 0;

}

.navbar-brand{

font-size:1.8rem;

}

.navbar-nav .nav-link{

padding:10px 14px!important;

font-size:14px;

}

.hero{

padding:140px 0 90px;

}

.hero-title{

font-size:4.3rem;

}

.hero-text{

font-size:1rem;

}

.hero-image img{

max-width:470px;

}

.hero-stats{

gap:18px;

}

.hero-stat{

min-width:135px;

padding:18px;

}

.section{

padding:100px 0;

}

.section-heading{

font-size:3rem;

}

.gallery-grid{

grid-template-columns:
repeat(3,1fr);

gap:22px;

}

.gallery-item img{

height:300px;

}

.card{

padding:25px;

}

.footer-logo{

font-size:2rem;

}

}


/*==========================================================
SMALL LAPTOP
992px
==========================================================*/

@media (max-width:992px){

.container{

max-width:960px;

}

section{

padding:90px 0;

}

/* Hero */

.hero{

text-align:center;

padding:130px 0 90px;

}

.hero-content{

margin:auto;

}

.hero-title{

font-size:3.8rem;

}

.hero-text{

margin-left:auto;

margin-right:auto;

}

.hero-btns{

justify-content:center;

}

.hero-stats{

justify-content:center;

margin-top:40px;

}

.hero-image{

margin-top:60px;

text-align:center;

}

.hero-image img{

max-width:420px;

margin:auto;

}

/* Navbar */

.navbar-collapse{

margin-top:18px;

padding:25px;

border-radius:20px;

}

.navbar-nav{

gap:8px;

}

.navbar-nav .nav-link{

text-align:center;

padding:15px!important;

}

/* Section */

.section-heading{

font-size:2.7rem;

}

.section-title{

font-size:.85rem;

}

/* Cards */

.card{

padding:25px;

margin-bottom:25px;

}

.card h3{

font-size:1.5rem;

}

/* Gallery */

.gallery-grid{

grid-template-columns:
repeat(2,1fr);

gap:22px;

}

.gallery-item img{

height:280px;

}

/* Footer */

.footer{

text-align:center;

}

.footer-about{

margin:auto auto 30px;

}

.footer-social{

justify-content:center;

}

.footer-bottom{

justify-content:center;

text-align:center;

gap:15px;

}

.footer-contact{

justify-content:center;

}

}
/*=====================================================================
                RESPONSIVE CSS
                    PART 2
                TABLET DEVICES
======================================================================*/


/*==========================================================
TABLETS
991px → 768px
==========================================================*/

@media (max-width:991px){

/*==================================
GENERAL
==================================*/

html{

font-size:15px;

}

section{

padding:80px 0;

}

.container{

padding-left:25px;

padding-right:25px;

}


/*==================================
NAVBAR
==================================*/

.navbar{

padding:14px 0;

}

.navbar-brand{

font-size:1.7rem;

}

.navbar-collapse{

margin-top:20px;

padding:22px;

border-radius:22px;

background:rgba(10,15,25,.96);

backdrop-filter:blur(18px);

}

.navbar-nav{

gap:8px;

}

.navbar-nav .nav-link{

display:block;

padding:15px 18px !important;

text-align:center;

border-radius:12px;

}

.navbar-nav .nav-link:hover{

background:rgba(255,255,255,.05);

}

.btn-join{

width:100%;

margin-top:18px;

}


/*==================================
HERO
==================================*/

.hero{

padding-top:140px;

padding-bottom:80px;

text-align:center;

min-height:auto;

}

.hero-content{

max-width:100%;

margin:auto;

}

.hero-title{

font-size:3.4rem;

line-height:1.15;

}

.hero-subtitle{

margin:auto auto 20px;

}

.hero-text{

max-width:650px;

margin:0 auto 35px;

}

.hero-btns{

justify-content:center;

}

.hero-image{

margin-top:60px;

}

.hero-image img{

width:80%;

max-width:420px;

margin:auto;

}

.hero-stats{

justify-content:center;

gap:18px;

margin-top:45px;

}

.hero-stat{

width:180px;

}


/*==================================
SECTION
==================================*/

.section-heading{

font-size:2.6rem;

text-align:center;

}

.section-title{

display:block;

text-align:center;

}

.section-text{

margin:auto;

text-align:center;

}


/*==================================
CARDS
==================================*/

.card,
.facility-card,
.membership-card,
.review-card,
.branch-card,
.nutrition-card,
.trainer-card{

padding:28px;

margin-bottom:28px;

}

.card h3{

font-size:1.45rem;

}


/*==================================
MEMBERSHIP
==================================*/

.membership-price{

font-size:2.2rem;

}


/*==================================
TRAINERS
==================================*/

.trainer-card img{

height:340px;

object-fit:cover;

}


/*==================================
GALLERY
==================================*/

.gallery-grid{

grid-template-columns:

repeat(2,1fr);

gap:22px;

}

.gallery-item img{

height:260px;

}

.gallery-filter{

gap:12px;

}

.gallery-filter button{

padding:12px 22px;

font-size:14px;

}


/*==================================
FORMS
==================================*/

form{

padding:0;

}

input,
textarea,
select{

font-size:15px;

padding:14px 16px;

}


/*==================================
BUTTONS
==================================*/

.btn{

padding:15px 30px;

font-size:15px;

}


/*==================================
FOOTER
==================================*/

.footer{

text-align:center;

}

.footer-logo{

font-size:2rem;

}

.footer-about{

margin:auto auto 30px;

}

.footer h4::after{

left:50%;

transform:translateX(-50%);

}

.footer-links{

margin-bottom:35px;

}

.footer-contact{

justify-content:center;

text-align:left;

}

.footer-social{

justify-content:center;

}

.footer-newsletter form{

justify-content:center;

}

.footer-bottom{

flex-direction:column;

gap:15px;

text-align:center;

}


/*==================================
SPACING
==================================*/

.mt-5{

margin-top:2.5rem !important;

}

.mb-5{

margin-bottom:2.5rem !important;

}

.py-5{

padding-top:3rem !important;

padding-bottom:3rem !important;

}

}


/*==========================================================
TABLETS
850px
==========================================================*/

@media (max-width:850px){

.hero-title{

font-size:3rem;

}

.gallery-grid{

grid-template-columns:1fr 1fr;

gap:18px;

}

.hero-image img{

width:90%;

}

.section-heading{

font-size:2.3rem;

}

}


/*==========================================================
LARGE MOBILE / SMALL TABLET
768px
==========================================================*/

@media (max-width:768px){

.hero-title{

font-size:2.7rem;

}

.hero-text{

font-size:1rem;

}

.hero-image{

margin-top:45px;

}

.hero-image img{

max-width:350px;

}

.gallery-grid{

grid-template-columns:1fr;

}

.card{

padding:24px;

}

.section-heading{

font-size:2.2rem;

}

.section{

padding:70px 0;

}

}
/*=====================================================================
                RESPONSIVE CSS
                    PART 3
            MOBILE DEVICES (767px - 320px)
======================================================================*/


/*==========================================================
MOBILE
767px
==========================================================*/

@media (max-width:767px){

html{
font-size:15px;
scroll-padding-top:80px;
}

/* Container */

.container{
padding-left:18px;
padding-right:18px;
}

/* Sections */

section{
padding:70px 0;
}

/* Navbar */

.navbar{
padding:12px 0;
}

.navbar-brand{
font-size:1.5rem;
letter-spacing:1px;
}

.navbar-collapse{
padding:18px;
border-radius:18px;
margin-top:15px;
}

.navbar-nav .nav-link{
padding:14px!important;
font-size:15px;
text-align:center;
}

.btn-join{
width:100%;
margin-top:15px;
}

/* Hero */

.hero{
padding-top:120px;
padding-bottom:70px;
min-height:auto;
text-align:center;
}

.hero-content{
max-width:100%;
}

.hero-subtitle{
font-size:.8rem;
padding:8px 18px;
margin-bottom:18px;
}

.hero-title{
font-size:2.5rem;
line-height:1.2;
margin-bottom:20px;
}

.hero-text{
font-size:.95rem;
line-height:1.8;
margin-bottom:30px;
}

.hero-btns{
flex-direction:column;
gap:15px;
}

.hero-btn-primary,
.hero-btn-outline{
width:100%;
justify-content:center;
}

.hero-image{
margin-top:40px;
}

.hero-image img{
width:100%;
max-width:320px;
margin:auto;
}

/* Hero Stats */

.hero-stats{
display:grid;
grid-template-columns:1fr;
gap:15px;
margin-top:35px;
}

.hero-stat{
width:100%;
}

/* Headings */

.section-title{
font-size:.8rem;
letter-spacing:3px;
text-align:center;
display:block;
}

.section-heading{
font-size:2rem;
text-align:center;
margin-bottom:18px;
}

.section-text{
text-align:center;
font-size:.95rem;
}

/* Cards */

.card,
.facility-card,
.membership-card,
.review-card,
.branch-card,
.trainer-card,
.nutrition-card,
.transformation-card{

padding:22px;

margin-bottom:20px;

border-radius:20px;

}

.card img,
.gallery-item img{
border-radius:16px;
}

/* Gallery */

.gallery-grid{
grid-template-columns:1fr;
gap:18px;
}

.gallery-item img{
height:240px;
}

.gallery-filter{
gap:10px;
}

.gallery-filter button{
width:100%;
padding:12px;
}

/* Buttons */

.btn{
width:100%;
padding:15px 22px;
font-size:15px;
}

/* Forms */

input,
textarea,
select{
font-size:15px;
padding:14px;
}

/* Footer */

.footer{
padding:70px 0 25px;
text-align:center;
}

.footer-logo{
font-size:1.8rem;
}

.footer-about{
margin:auto auto 25px;
}

.footer-contact{
justify-content:center;
text-align:left;
}

.footer-social{
justify-content:center;
flex-wrap:wrap;
}

.footer-newsletter form{
flex-direction:column;
}

.footer-newsletter input,
.footer-newsletter button{
width:100%;
}

.footer-bottom{
flex-direction:column;
gap:12px;
text-align:center;
}

.footer-badges{
justify-content:center;
}

}


/*==========================================================
SMALL MOBILE
576px
==========================================================*/

@media (max-width:576px){

html{
font-size:14px;
}

.container{
padding-left:15px;
padding-right:15px;
}

.hero{
padding-top:105px;
}

.hero-title{
font-size:2.1rem;
}

.hero-text{
font-size:.92rem;
}

.hero-image img{
max-width:280px;
}

.hero-stat h3{
font-size:1.6rem;
}

.section-heading{
font-size:1.8rem;
}

.gallery-item img{
height:220px;
}

.card{
padding:18px;
}

.footer-logo{
font-size:1.6rem;
}

.footer h4{
font-size:1.15rem;
}

.btn{
padding:14px 20px;
}

}


/*==========================================================
EXTRA SMALL DEVICES
400px
==========================================================*/

@media (max-width:400px){

.hero-title{
font-size:1.9rem;
}

.hero-subtitle{
font-size:.72rem;
padding:7px 15px;
}

.hero-text{
font-size:.88rem;
}

.hero-image img{
max-width:240px;
}

.section-heading{
font-size:1.6rem;
}

.gallery-item img{
height:200px;
}

.navbar-brand{
font-size:1.3rem;
}

.card{
padding:16px;
}

.footer-logo{
font-size:1.4rem;
}

}


/*==========================================================
IPHONE SE / VERY SMALL DEVICES
320px
==========================================================*/

@media (max-width:320px){

html{
font-size:13px;
}

.hero-title{
font-size:1.6rem;
}

.hero-image img{
max-width:210px;
}

.section-heading{
font-size:1.45rem;
}

.btn{
padding:12px 18px;
font-size:14px;
}

.navbar-brand{
font-size:1.2rem;
}

.footer-logo{
font-size:1.2rem;
}

.gallery-item img{
height:180px;
}

}
/*=====================================================================
                RESPONSIVE CSS
                    PART 4
        FINAL POLISH & PRODUCTION FIXES
======================================================================*/


/*==========================================================
UNIVERSAL IMAGE FIXES
==========================================================*/

img{

max-width:100%;

height:auto;

display:block;

object-fit:cover;

}


/*==========================================================
MEDIA ELEMENTS
==========================================================*/

video,
iframe{

max-width:100%;

border-radius:20px;

display:block;

}


/*==========================================================
PREVENT OVERFLOW
==========================================================*/

body{

overflow-x:hidden;

}

section{

overflow:hidden;

}

.container,
.container-fluid,
.row{

max-width:100%;

}


/*==========================================================
LONG WORDS
==========================================================*/

h1,
h2,
h3,
h4,
h5,
h6,
p,
a{

word-wrap:break-word;

overflow-wrap:break-word;

}


/*==========================================================
FLEX UTILITIES
==========================================================*/

.flex-center{

display:flex;

align-items:center;

justify-content:center;

}

.flex-between{

display:flex;

align-items:center;

justify-content:space-between;

}

.flex-column{

display:flex;

flex-direction:column;

}


/*==========================================================
GRID UTILITIES
==========================================================*/

.grid-2{

display:grid;

grid-template-columns:repeat(2,1fr);

gap:30px;

}

.grid-3{

display:grid;

grid-template-columns:repeat(3,1fr);

gap:30px;

}

.grid-4{

display:grid;

grid-template-columns:repeat(4,1fr);

gap:30px;

}


/*==========================================================
SPACING UTILITIES
==========================================================*/

.mt-auto{

margin-top:auto;

}

.mb-auto{

margin-bottom:auto;

}

.py-section{

padding:100px 0;

}


/*==========================================================
IMAGE HOVER SAFETY
==========================================================*/

.gallery-item img,
.card img,
.hero-image img{

backface-visibility:hidden;

-webkit-backface-visibility:hidden;

}


/*==========================================================
BUTTON TOUCH TARGET
==========================================================*/

button,
.btn,
a{

min-height:44px;

}


/*==========================================================
INPUT FIX
==========================================================*/

input,
textarea,
select{

width:100%;

font-family:inherit;

appearance:none;

-webkit-appearance:none;

}


/*==========================================================
TABLE RESPONSIVE
==========================================================*/

table{

width:100%;

display:block;

overflow-x:auto;

white-space:nowrap;

}


/*==========================================================
SMOOTH SCROLL OFFSET
==========================================================*/

html{

scroll-padding-top:90px;

}


/*==========================================================
FOCUS STATES
==========================================================*/

a:focus,
button:focus,
input:focus,
textarea:focus{

outline:none;

box-shadow:

0 0 0 3px rgba(0,217,255,.18);

}


/*==========================================================
LANDSCAPE PHONES
==========================================================*/

@media (max-height:600px) and (orientation:landscape){

.hero{

min-height:auto;

padding:100px 0 60px;

}

.hero-title{

font-size:2.8rem;

}

.hero-image{

margin-top:20px;

}

}


/*==========================================================
GRID COLLAPSE
==========================================================*/

@media(max-width:992px){

.grid-4{

grid-template-columns:repeat(2,1fr);

}

.grid-3{

grid-template-columns:repeat(2,1fr);

}

}


/*==========================================================
MOBILE GRID
==========================================================*/

@media(max-width:768px){

.grid-2,
.grid-3,
.grid-4{

grid-template-columns:1fr;

}

.py-section{

padding:70px 0;

}

}


/*==========================================================
SMALL DEVICES
==========================================================*/

@media(max-width:576px){

.hide-mobile{

display:none!important;

}

.text-center-mobile{

text-align:center!important;

}

.w-100-mobile{

width:100%!important;

}

}


/*==========================================================
PRINT
==========================================================*/

@media print{

.navbar,
.footer,
.btn,
.scroll-indicator{

display:none!important;

}

body{

background:#fff;

color:#000;

}

section{

padding:20px 0;

page-break-inside:avoid;

}

}


/*==========================================================
REDUCED MOTION
==========================================================*/

@media (prefers-reduced-motion:reduce){

*{

animation:none!important;

transition:none!important;

scroll-behavior:auto!important;

}

}


/*==========================================================
HIGH DPI DISPLAYS
==========================================================*/

@media (-webkit-min-device-pixel-ratio:2),
(min-resolution:192dpi){

img{

image-rendering:auto;

}

}


/*==========================================================
SAFE AREA SUPPORT (iPhone)
==========================================================*/

@supports(padding:max(0px)){

.navbar{

padding-left:max(15px,env(safe-area-inset-left));

padding-right:max(15px,env(safe-area-inset-right));

}

.footer{

padding-bottom:max(30px,env(safe-area-inset-bottom));

}

}


/*==========================================================
FINAL PERFORMANCE
==========================================================*/

.hero,
.card,
.gallery-item,
.btn{

will-change:transform;

}

.gallery-item img,
.hero-image img{

transform:translateZ(0);

}


/*==========================================================
END OF RESPONSIVE CSS
==========================================================*/

/*=====================================================================
                THE ROYAL GYM
        CROSS-DEVICE / PRODUCTION RESPONSIVE PATCH
        iOS • iPadOS • Android • macOS • Windows • Tablets
======================================================================*/

/* ---------- Modern viewport + iOS text rendering ---------- */

html {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100%;
    margin: 0;
    overflow-x: clip;
    overflow-wrap: break-word;
}

/* Safari fallback for overflow:clip */
@supports not (overflow: clip) {
    body {
        overflow-x: hidden;
    }
}

/* ---------- Safe-area support for notches / Dynamic Island / home bar ---------- */

.navbar {
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
    padding-top: max(12px, env(safe-area-inset-top));
}

.footer {
    padding-bottom: max(30px, env(safe-area-inset-bottom));
}

.scroll-top {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
}

/* ---------- Never let flex/grid children create horizontal overflow ---------- */

.container,
.container-fluid,
.row,
[class*="col-"],
.card,
.facility-card,
.membership-card,
.trainer-card,
.review-card,
.branch-card,
.nutrition-card,
.transformation-card,
.gallery-item,
.hero-content,
.hero-image {
    min-width: 0;
}

.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.card-grid > * {
    min-width: 0;
}

/* ---------- Responsive media ---------- */

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

video {
    height: auto;
}

iframe {
    width: 100%;
    border: 0;
}

/* ---------- Forms: prevents iPhone Safari input zoom ---------- */

input,
textarea,
select,
button {
    font: inherit;
}

input,
textarea,
select {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 767px) {
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ---------- Touch-friendly controls ---------- */

button,
.btn,
.btn-join,
.navbar-toggler,
.gallery-filter button,
.gallery-view,
.footer-social a,
.trainer-social a,
.scroll-top {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button,
.btn,
.btn-join,
.navbar-toggler,
.gallery-filter button,
.gallery-view {
    min-height: 44px;
}

/* ---------- Remove desktop-only hover behaviour on touch devices ---------- */

@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .facility-card:hover,
    .membership-card:hover,
    .trainer-card:hover,
    .review-card:hover,
    .branch-card:hover,
    .nutrition-card:hover,
    .transformation-card:hover,
    .gallery-item:hover,
    .hero-image:hover img,
    .footer-social a:hover,
    .trainer-social a:hover,
    .scroll-top:hover,
    .btn:hover,
    .btn-primary:hover,
    .btn-gold:hover,
    .btn-warning:hover,
    .btn-info:hover,
    .btn-join:hover {
        transform: none;
    }

    .gallery-item:hover img,
    .card:hover img,
    .facility-card:hover img,
    .membership-card:hover img,
    .trainer-card:hover img,
    .review-card:hover img,
    .branch-card:hover img,
    .nutrition-card:hover img,
    .transformation-card:hover img {
        transform: none;
    }

    .gallery-item:hover .gallery-overlay {
        opacity: 0;
    }

    .gallery-item:hover .gallery-icon {
        opacity: 0;
    }

    .gallery-item:hover::before,
    .card:hover::before,
    .facility-card:hover::before,
    .membership-card:hover::before,
    .trainer-card:hover::before,
    .review-card:hover::before,
    .branch-card:hover::before,
    .nutrition-card:hover::before,
    .transformation-card:hover::before {
        transform: scaleX(0);
    }
}

/* Keep hover effects for real mouse/trackpad devices only. */
@media (hover: hover) and (pointer: fine) {
    a:hover,
    button:hover,
    .btn:hover {
        cursor: pointer;
    }
}

/* ---------- iOS Safari: fixed background images can be expensive / buggy ---------- */

.hero,
.hero-section {
    background-attachment: scroll;
}

@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
    .hero,
    .hero-section {
        background-attachment: fixed;
    }
}

/* ---------- Hero viewport sizing ---------- */

.hero,
.hero-section {
    min-height: 100svh;
    min-height: 100dvh;
}

@supports not (height: 100dvh) {
    .hero,
    .hero-section {
        min-height: 100vh;
    }
}

@media (max-width: 991px) {
    .hero,
    .hero-section {
        min-height: auto;
    }
}

/* ---------- Fluid typography: prevents oversized headings on tablets ---------- */

.hero-title {
    font-size: clamp(2rem, 7vw, 6rem);
    max-width: 100%;
    overflow-wrap: anywhere;
}

.section-heading {
    font-size: clamp(1.8rem, 5vw, 4rem);
    max-width: 100%;
    overflow-wrap: anywhere;
}

p,
.section-text,
.hero-text {
    max-width: 100%;
}

/* ---------- Better mobile hero layout ---------- */

@media (max-width: 767px) {
    .hero,
    .hero-section {
        padding-top: calc(105px + env(safe-area-inset-top));
        padding-bottom: max(65px, env(safe-area-inset-bottom));
        background-attachment: scroll;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 2.8rem);
        line-height: 1.12;
    }

    .hero-subtitle {
        max-width: 100%;
        width: fit-content;
        max-width: 100%;
    }

    .hero-text {
        font-size: 1rem;
        line-height: 1.75;
    }

    .hero-btns {
        width: 100%;
    }

    .hero-btn-primary,
    .hero-btn-outline {
        width: 100%;
        min-height: 48px;
    }

    .hero-image img {
        width: min(100%, 320px);
        height: auto;
    }
}

/* ---------- Very small phones ---------- */

@media (max-width: 380px) {
    .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .navbar-brand {
        font-size: clamp(1.05rem, 6vw, 1.3rem);
        letter-spacing: .5px;
    }

    .hero-title {
        font-size: clamp(1.75rem, 9vw, 2.2rem);
    }

    .section-heading {
        font-size: clamp(1.55rem, 8vw, 1.9rem);
    }

    .card,
    .facility-card,
    .membership-card,
    .trainer-card,
    .review-card,
    .branch-card,
    .nutrition-card,
    .transformation-card {
        padding: 16px;
    }
}

/* ---------- Tablet portrait / landscape ---------- */

@media (min-width: 768px) and (max-width: 1199px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 24px;
        padding-right: 24px;
    }

    .hero-title {
        font-size: clamp(2.7rem, 6vw, 4rem);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- Wide desktop ---------- */

@media (min-width: 1200px) {
    .grid-2 > *,
    .grid-3 > *,
    .grid-4 > * {
        min-width: 0;
    }
}

/* ---------- Landscape phones ---------- */

@media (max-height: 600px) and (orientation: landscape) {
    .navbar {
        padding-top: max(8px, env(safe-area-inset-top));
        padding-bottom: 8px;
    }

    .hero,
    .hero-section {
        min-height: auto;
        padding-top: calc(90px + env(safe-area-inset-top));
        padding-bottom: 50px;
    }

    .hero-title {
        font-size: clamp(2rem, 7vw, 3.2rem);
    }

    .hero-image {
        margin-top: 25px;
    }

    .scroll-indicator {
        display: none;
    }
}

/* ---------- Gallery: reliable grids on every width ---------- */

.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.gallery-item {
    min-width: 0;
}

.gallery-item img {
    width: 100%;
    height: clamp(220px, 35vw, 400px);
    object-fit: cover;
}

@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .gallery-item img {
        height: clamp(200px, 65vw, 300px);
    }
}

/* ---------- Cards: stable equal-height layout ---------- */

.card-grid,
.grid-2,
.grid-3,
.grid-4 {
    align-items: stretch;
}

.card,
.facility-card,
.membership-card,
.trainer-card,
.review-card,
.branch-card,
.nutrition-card,
.transformation-card {
    min-width: 0;
    overflow: hidden;
}

.card p,
.facility-card p,
.membership-card p,
.trainer-card p,
.review-card p,
.branch-card p,
.nutrition-card p,
.transformation-card p {
    overflow-wrap: anywhere;
}

/* ---------- Horizontal tables: preserve page width ---------- */

.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

table {
    max-width: none;
}

/* If a table is not wrapped in .table-responsive, retain safe scrolling. */
table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Accessibility / keyboard focus ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(0, 217, 255, .65);
    outline-offset: 3px;
}

/* ---------- Avoid forced animation/GPU work on touch screens ---------- */

@media (hover: none) and (pointer: coarse) {
    .card,
    .gallery-item,
    .btn,
    .hero-image {
        will-change: auto;
    }
}

/* ---------- Reduce motion for users who request it ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- Print ---------- */

@media print {
    html,
    body {
        overflow: visible !important;
    }
}

/*=====================================================================
                    END CROSS-DEVICE PATCH
======================================================================*/
/*=====================================================================
                    END CROSS-DEVICE PATCH
======================================================================*/


/*=====================================================================
        FINAL iOS / SAFARI TEXT COLOR FIX
        Prevent white text on light sections
======================================================================*/

/* ---------- Light / white sections ---------- */

section.bg-light,
.bg-light {
    color: #222 !important;
}

section.bg-light h1,
section.bg-light h2,
section.bg-light h3,
section.bg-light h4,
section.bg-light h5,
section.bg-light h6,
section.bg-light p,
section.bg-light li,
section.bg-light span,
section.bg-light small,
section.bg-light strong {
    color: #222 !important;
}

section.bg-light .text-muted,
.bg-light .text-muted {
    color: #555 !important;
}

section.bg-light .text-warning,
.bg-light .text-warning {
    color: #d4af37 !important;
}

.bg-dark .membership-features {
    color: #ffffff !important;
}

.bg-light .membership-features {
    color: #222222 !important;
}

.bg-light .card,
.bg-light .card-body {
    color: #222 !important;
    background-color: #ffffff;
}

.bg-light .card h1,
.bg-light .card h2,
.bg-light .card h3,
.bg-light .card h4,
.bg-light .card h5,
.bg-light .card h6,
.bg-light .card p,
.bg-light .card small,
.bg-light .card span {
    color: #222 !important;
}

.bg-light .card .text-warning {
    color: #d4af37 !important;
}

section:not(.bg-dark):not(.bg-warning):not(.bg-black) {
    color: #222;
}

.bg-dark,
.bg-black {
    color: #ffffff;
}

.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6,
.bg-dark p,
.bg-dark li,
.bg-dark span,
.bg-black h1,
.bg-black h2,
.bg-black h3,
.bg-black h4,
.bg-black h5,
.bg-black h6,
.bg-black p,
.bg-black li,
.bg-black span {
    color: #ffffff;
}

.text-warning {
    color: #d4af37 !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
