.services-section {
    display: flex;
    justify-content: center;
    margin: 100px 0;
    position: relative;
    padding: 0 20px; /* Add horizontal padding for small screens */
    box-sizing: border-box;
}

.frosted-container {
    width: 100%; /* Use full width of parent */
    max-width: 1140px; /* Set a maximum width */
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.content-wrapper {
    width: 100%; /* Changed from fixed width */
    max-width: 1016px; /* Retain max-width for consistency */
}

/* Tabs row */
.tabs {
    display: flex;
    justify-content: center; /* Center tabs on desktop */
    margin: 0 auto 40px auto;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on medium screens before scrolling */
}

.tab {
    background: transparent;
    border: 1px solid #E3F919;
    border-radius: 10px;
    padding: 15px 25px;
    font-family: 'Mansfield', sans-serif;
    font-size: 18px;
    color: #E3F919;
    cursor: pointer;
    transition: 0.3s;
    flex-shrink: 0; /* Prevent tabs from shrinking */
}

.tab.active {
    background: #E2F919;
    color: #000;
    /* border: none; */ /* Keeping the border (or setting it transparent) prevents layout shift */
    border: 1px solid #E2F919;
}

/* Cards grid */
.cards {
    margin: 0 auto;
    background: linear-gradient(180deg, #202020 0%, rgba(32, 32, 32, 0.1) 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;

    display: grid;
    /* THE RESPONSIVE GRID SOLUTION */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
    max-height: 900px; 
    
    /* Enable vertical scrollbar only when content exceeds max-height */
    overflow-y: auto;
}

.cards.fade-out {
    opacity: 0;
}

.card {
    position: relative;
    width: 100%; /* Let the card fill the available grid space */
    height: 366px;
    background: none;
    box-shadow: none;
    border: none;    
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    color: #fff;
    transition: transform 0.3s ease; /* Added transition for hover */
}

.card:hover {
    transform: translateY(-8px);
}

/* .card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
} */
/* .card {
  position: relative;
  width: 300px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
} */

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}

/* Text overlay */
.overlay-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  text-align: center;
  font-weight: 500;
  transition: background 0.3s ease;
}

.card:hover .overlay-text {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

/* .card p {
    padding: 15px;
    font-size: 16px;
    font-family: 'Mansfield', sans-serif;
} */

/* --- RESPONSIVE ADJUSTMENTS --- */
/* --- Keep all your other styles the same --- */

/* --- RESPONSIVE ADJUSTMENTS --- */
/* --- EXISTING CSS REMAINS HERE --- */

/* NEW: Portrait Card for Mobile Reels */
/* --- EXISTING CSS REMAINS HERE --- */

/* --- RESPONSIVE ADJUSTMENTS (MODIFIED) --- */
@media (max-width: 768px) {
    .services-section {
        margin: 50px 0;
    }

    .frosted-container {
        padding: 20px;
    }

    /* DEFAULT MOBILE GRID: Single column for Creatives/SEO */
    .cards {
        padding: 20px;
        gap: 20px;
        /* Default single column on mobile */
        grid-template-columns: repeat(2, 1fr);
        max-height: none;
        overflow-y: visible;
    }

    /* NEW: Mobile Reels Grid (Two-column "Shorts" layout) */
    .cards[data-tab="reels"] {
        /* Overrides the 1fr rule for reels */
        grid-template-columns: repeat(2, 1fr); /* Two equal columns */
        gap: 10px; /* Reduced gap for a tighter look */
        padding: 10px; /* Reduced padding */
        
        /* Remove max-height and overflow-y to let the grid scroll naturally 
           with the page, like a typical social feed. */
        max-height: none; 
        overflow-y: visible;
    }
    .cards .card:not(.video-card) {
        /* Use a square aspect ratio for static images */
        aspect-ratio: 1 / 1; 
        height: auto;
    }
    /* Specific styles for video cards on mobile */
    .cards[data-tab="reels"] .video-card {
        /* Portrait aspect ratio (taller) for "shorts" look */
        aspect-ratio: 9 / 16; 
        height: auto; /* Let aspect-ratio define height */
    }

    /* Ensure text within the card is visible */
    .cards[data-tab="reels"] .video-card p {
        /* Adjust text position/style for the smaller card view */
        font-size: 12px;
        bottom: 5px;
        left: 5px;
        right: 5px;
    }

    /* Override the hover effect on touch devices */
    .cards[data-tab="reels"] .video-card:hover {
        transform: none; 
        box-shadow: none;
    }
.cards .card:not(.video-card) .overlay-text {
        font-size: 14px; /* Slightly larger text for square cards */
    }
    /* HORIZONTAL SCROLLING TABS (Kept from previous version) */
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
}
/* NEW: Fullscreen Video Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95); /* Nearly black background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* High z-index to cover everything */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.open {
    visibility: visible;
    opacity: 1;
}

.modal-video-wrapper {
    width: 95%;
    max-width: 400px; /* Typical vertical video width */
    height: 95%;
    max-height: 90vh; /* Limit height */
    position: relative;
    background: black;
    border-radius: 12px;
}

.modal-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Important: ensures video is fully visible without crop */
    border-radius: 12px;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    z-index: 1001; /* Above the video */
    display: flex;
    justify-content: center;
    align-items: center;
}
.video-card {
  position: relative;
  aspect-ratio: 16 / 9;  /* perfect for horizontal reels */
  width: 100%;           /* let parent grid decide card size */
  max-width: 300px;      /* limit on desktop */
  background: #222;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(226, 249, 25, 0.6);
}

/* Make both video and image fill the space perfectly */
.video-card video,
.video-card img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* ensures perfect crop/fill */
  border-radius: inherit;
  transition: opacity 0.3s ease;
}

/* optional hover fade effect */
.video-card video {
  opacity: 0;
}
.video-card:hover video {
  opacity: 1;
}

/* Text below the video */
.video-card p {
  position: relative;
  z-index: 2;
  margin: 8px 0 0;
  font-size: 14px;
  color: #fff;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  width: fit-content;
  padding: 4px 8px;
  align-self: center;
}

.testimonial-slider {
  overflow: hidden;
  width: 100%;
  padding: 40px 0;
  position: relative;
}

/* Scrolling track */
.testimonial-track {
  display: flex;
  gap: 40px;
  animation: scroll 25s linear infinite;
  width: max-content;
}

/* Individual card */
.testimonial-card {
  width: 288px;
  border-radius: 25px;
  overflow: hidden;
  background: #202020;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* Image */
.testimonial-image {
  width: 100%;
  height: 171px;
  background: url("<?=base_url('images/blacksweatshirt.jpg')?>") center/cover no-repeat;
  border-radius: 25px 25px 0 0;
}

/* Body */
.testimonial-body {
  padding: 17px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: #202020;
  border-radius: 0 0 25px 25px;
  color: #fff;
}

/* Text styles */
.testimonial-tag {
  font-family: "Montserrat", sans-serif;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.testimonial-title {
  font-family: "Lato", sans-serif;
  font-size: 22px;
  margin: 0;
  color: #fff;
}

.testimonial-subtitle {
  font-family: "Lato", sans-serif;
  font-size: 16px;
  margin: 0;
  color: #E2F919;
}

.testimonial-text {
  font-family: "Montserrat", sans-serif;
  font-size: 9px;
  color: #fff;
  margin: 0;
}
@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}