/* ========================================
   RESPONSIVE STYLES - Complete Mobile Fix
   ======================================== */

/* ============================================
   BREAKPOINTS
   ============================================ */
/* 
   Mobile: 320px - 767px
   Tablet: 768px - 1023px
   Desktop: 1024px - 1279px
   Wide: 1280px+
*/

/* ============================================
   BASE MOBILE FIXES (Mobile First)
   ============================================ */

/* Fix viewport and overflow */
html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

* {
    max-width: 100%;
    box-sizing: border-box;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* ============================================
   CONTAINER FIXES
   ============================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================
   TYPOGRAPHY - Mobile
   ============================================ */

@media (max-width: 767px) {
    :root {
        --font-h1: 2rem;
        --font-h2: 1.6rem;
        --font-h3: 1.3rem;
        --font-h4: 1.1rem;
        --font-h5: 1rem;
        --font-body-large: 1rem;
        --font-body: 0.95rem;
        --font-small: 0.85rem;
        --font-caption: 0.75rem;
        --spacing-xl: 40px;
        --spacing-xxl: 60px;
        --container-padding: 15px;
    }
}

@media (max-width: 480px) {
    :root {
        --font-h1: 1.8rem;
        --font-h2: 1.4rem;
        --font-h3: 1.2rem;
        --font-h4: 1rem;
        --container-padding: 12px;
    }
}

/* ============================================
   SECTIONS - Mobile
   ============================================ */

@media (max-width: 767px) {
    .section {
        padding: 40px 0;
    }
    
    .section__subtitle {
        font-size: var(--font-body);
        padding: 0 10px;
    }
}

/* ============================================
   GRID SYSTEM - Mobile
   ============================================ */

@media (max-width: 1023px) {
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Special case for team grid */
    .team-grid {
        grid-template-columns: 1fr !important;
        max-width: 100%;
        padding: 0;
    }
}

/* ============================================
   HERO SECTION - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .hero {
        min-height: auto;
        padding: 60px 0;
        background-attachment: scroll !important;
    }
    
    .hero--split {
        padding: 40px 0;
    }
    
    .hero__title {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero__subtitle {
        font-size: var(--font-body);
    }
    
    .hero__description {
        font-size: var(--font-body);
        padding: 0;
    }
    
    .hero__badges {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .hero__badge {
        font-size: var(--font-caption);
        padding: 4px 12px;
    }
    
    .hero__buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .hero__buttons .button {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: var(--font-body);
    }
    
    .hero__stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        padding-top: 20px;
    }
    
    .hero__stat {
        flex: 0 0 calc(50% - 10px);
        min-width: auto;
    }
    
    .hero__stat-number {
        font-size: 2rem;
    }
    
    .hero__stat-label {
        font-size: var(--font-caption);
    }
    
    .hero__video-wrapper {
        margin-top: 20px;
    }
    
    .hero__video-btn {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero__title {
        font-size: 1.6rem !important;
    }
    
    .hero__badges {
        gap: 6px;
    }
    
    .hero__badge {
        font-size: 0.65rem;
        padding: 3px 10px;
    }
    
    .hero__stat {
        flex: 0 0 100%;
    }
}

/* ============================================
   NAVIGATION - Mobile Fix
   ============================================ */

@media (max-width: 1023px) {
    .navbar__toggle {
        display: flex !important;
    }
    
    .navbar__menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: var(--white);
        flex-direction: column;
        padding: 80px 20px 40px;
        gap: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 999;
        border-top: none;
        box-shadow: none;
    }
    
    .navbar__menu.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
    
    .navbar__item {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .navbar__item:last-child {
        border-bottom: none;
    }
    
    .navbar__link {
        width: 100%;
        padding: 14px 16px;
        font-size: 1rem;
        justify-content: flex-start;
        white-space: normal;
        border-radius: 0;
    }
    
    .navbar__link i {
        width: 24px;
        text-align: center;
    }
    
    .navbar__link--dropdown {
        justify-content: space-between;
    }
    
    .navbar__dropdown {
        position: static;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        padding-left: 20px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        opacity: 1;
        visibility: visible;
        border: none;
        background: transparent;
        min-width: auto;
        width: 100%;
    }
    
    .navbar__dropdown::before {
        display: none;
    }
    
    .navbar__item--has-dropdown.is-open .navbar__dropdown {
        max-height: 500px;
        padding: 8px 0;
    }
    
    .navbar__dropdown-link {
        padding: 10px 16px;
        font-size: 0.9rem;
        border-left: 2px solid transparent;
        border-radius: 0;
    }
    
    .navbar__dropdown-link:hover {
        padding-left: 20px;
        border-left-color: var(--accent-color);
    }
    
    .navbar__item--cta {
        margin-left: 0;
        margin-top: 8px;
        border-bottom: none;
    }
    
    .navbar__cta-button {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
    
    .navbar__link--highlight {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile close button */
    .navbar__menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary-color);
        cursor: pointer;
        padding: 8px;
        z-index: 1000;
        display: none;
    }
    
    .navbar__menu.is-open .navbar__menu-close {
        display: block;
    }
}

/* Mobile overlay */
@media (max-width: 1023px) {
    .navbar__overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .navbar__overlay.is-open {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================================
   ABOUT PAGE - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .about-features {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .about-feature {
        padding: 10px;
        font-size: var(--font-caption);
    }
    
    .about-feature i {
        font-size: 1rem;
    }
    
    .about-preview__stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .about-preview__stat {
        flex: 0 0 calc(50% - 7px);
        text-align: center;
    }
    
    .about-preview__stat-number {
        font-size: 1.5rem;
    }
    
    .vision-card {
        padding: 20px;
    }
    
    .vision-card__icon img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .about-features {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SERVICES PAGE - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .service-detail {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 30px 0;
    }
    
    .service-detail--reverse .service-detail__image {
        order: 0;
    }
    
    .service-detail__header {
        flex-wrap: wrap;
    }
    
    .service-detail__icon {
        font-size: 2rem;
    }
    
    .service-detail__list {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .service-detail__list li {
        font-size: var(--font-small);
        padding: 6px 0;
    }
    
    .service-detail__image img {
        height: 200px;
    }
    
    .comparison-table {
        font-size: var(--font-caption);
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 8px 12px;
        white-space: nowrap;
    }
}

/* ============================================
   TEAM PAGE - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .team-card--full {
        grid-template-columns: 1fr;
        gap: 0;
        border-radius: var(--radius-medium);
        overflow: hidden;
    }
    
    .team-card__image-wrapper {
        padding-top: 100%;
    }
    
    .team-card__image-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    .team-card__image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .team-card__content {
        padding: 20px;
    }
    
    .team-card__name {
        font-size: var(--font-h4);
    }
    
    .team-card__position {
        font-size: var(--font-small);
    }
    
    .team-card__bio {
        font-size: var(--font-small);
    }
    
    .team-card__social-overlay {
        opacity: 1;
        background: rgba(27, 27, 27, 0.4);
    }
    
    .team-card__social {
        transform: none;
        gap: 10px;
    }
    
    .team-card__social-link {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .team-card__experience-badge {
        font-size: 0.6rem;
        padding: 4px 10px;
        bottom: 10px;
        right: 10px;
    }
    
    .team-card__expertise {
        gap: 6px;
    }
    
    .team-card__skill {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
    
    .team-card__actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .team-card__actions .button {
        width: 100%;
        justify-content: center;
    }
    
    .team-card__qualifications-toggle {
        font-size: var(--font-small);
    }
}

/* ============================================
   TESTIMONIALS PAGE - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .testimonial-card__header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .testimonial-card__photo {
        width: 50px;
        height: 50px;
    }
    
    .testimonial-card__text {
        font-size: var(--font-body);
        padding-left: 12px;
    }
    
    .testimonial-card__footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .testimonial-carousel__controls {
        bottom: -40px;
    }
    
    .testimonial-carousel__prev,
    .testimonial-carousel__next {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .stat-mini {
        padding: 15px;
    }
    
    .stat-mini__number {
        font-size: 1.8rem;
    }
}

/* ============================================
   FAQ PAGE - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .faq-category__header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .faq-category__icon {
        font-size: 1.5rem;
    }
    
    .faq-category__title {
        font-size: var(--font-h3);
    }
    
    .faq-item__question {
        font-size: var(--font-body);
        padding: 12px 0;
    }
    
    .faq-item__question i {
        font-size: 0.8rem;
        flex-shrink: 0;
    }
    
    .faq-item__answer p {
        font-size: var(--font-small);
    }
}

/* ============================================
   CONTACT PAGE - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .contact-form-wrapper,
    .contact-info-wrapper {
        padding: 20px;
    }
    
    .contact-form .form-group {
        margin-bottom: 15px;
    }
    
    .contact-form input,
    .contact-form select,
    .contact-form textarea {
        padding: 10px 14px;
        font-size: var(--font-body);
    }
    
    .contact-info__item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 0;
    }
    
    .contact-info__icon {
        font-size: 1.2rem;
        min-width: auto;
    }
    
    .office-hours__list li {
        flex-direction: column;
        gap: 4px;
        padding: 8px 0;
    }
    
    .office-hours__day {
        font-weight: 600;
    }
    
    .map-container iframe {
        height: 250px;
    }
    
    /* WhatsApp widget mobile fix */
    .whatsapp-chat {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .contact-form-wrapper,
    .contact-info-wrapper {
        padding: 15px;
    }
}

/* ============================================
   LEGAL PAGES - Mobile Fix
   ============================================ */

@media (max-width: 1023px) {
    .legal-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .legal-content__sidebar {
        position: static;
    }
    
    .legal-nav {
        padding: 15px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }
    
    .legal-nav h3 {
        margin: 0;
        padding: 0;
        border: none;
        font-size: var(--font-h5);
        width: 100%;
    }
    
    .legal-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        width: 100%;
    }
    
    .legal-nav ul li {
        margin: 0;
        flex: 0 0 auto;
    }
    
    .legal-nav ul li a {
        padding: 6px 12px;
        font-size: var(--font-caption);
        border-left: none;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
    }
    
    .legal-nav ul li a.active {
        border-left: none;
        border-bottom-color: var(--accent-color);
    }
}

@media (max-width: 767px) {
    .legal-content__main {
        padding: 20px;
    }
    
    .legal-content__main h2 {
        font-size: var(--font-h3);
    }
    
    .legal-content__main h3 {
        font-size: var(--font-h4);
    }
    
    .legal-content__main ul {
        padding-left: 20px;
    }
    
    .legal-content__main ul li {
        font-size: var(--font-small);
    }
    
    .cookie-table {
        font-size: var(--font-caption);
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: 6px 10px;
        white-space: nowrap;
    }
    
    .legal-nav ul li a {
        white-space: normal;
        font-size: var(--font-small);
    }
}

/* ============================================
   FOOTER - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .footer {
        padding: 40px 0 0;
    }
    
    .footer__grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-bottom: 30px;
    }
    
    .footer__heading {
        font-size: var(--font-h4);
    }
    
    .footer__about {
        font-size: var(--font-small);
    }
    
    .footer__links li a {
        font-size: var(--font-small);
    }
    
    .footer__contact li {
        font-size: var(--font-small);
    }
    
    .footer__newsletter-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer__newsletter-form input {
        width: 100%;
        padding: 10px 14px;
    }
    
    .footer__newsletter-form .button {
        width: 100%;
        justify-content: center;
    }
    
    .footer__social {
        padding: 30px 0 20px;
    }
    
    .footer__social-links {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .footer__social-link {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .footer__legal {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px 0;
    }
    
    .footer__legal-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .footer__legal-links li a {
        font-size: var(--font-caption);
    }
    
    .footer__copyright,
    .footer__credit {
        font-size: var(--font-caption);
    }
    
    .footer__back-to-top {
        bottom: 80px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ============================================
   CTA SECTION - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .section--cta {
        padding: 40px 0;
    }
    
    .section--cta h2 {
        font-size: var(--font-h2);
    }
    
    .section--cta p {
        font-size: var(--font-body);
        padding: 0 10px;
    }
    
    .cta__buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        padding: 0 10px;
    }
    
    .cta__buttons .button {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: var(--font-body);
    }
    
    .cta__badges {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .cta__badge {
        font-size: var(--font-small);
    }
}

/* ============================================
   FEATURE CARDS - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .feature-card {
        padding: 20px;
    }
    
    .feature-card__icon {
        font-size: 2rem;
    }
    
    .feature-card__title {
        font-size: var(--font-h4);
    }
    
    .feature-card__description {
        font-size: var(--font-small);
    }
}

/* ============================================
   SERVICE CARDS - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .service-card {
        padding: 20px;
    }
    
    .service-card__icon {
        font-size: 1.8rem;
    }
    
    .service-card__title {
        font-size: var(--font-h4);
    }
    
    .service-card__description {
        font-size: var(--font-small);
    }
    
    .service-card .button {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   GALLERY - Mobile Fix
   ============================================ */

@media (max-width: 1023px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .gallery-item__caption {
        transform: translateY(0);
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
        padding: 12px;
    }
    
    .gallery-item__caption p {
        font-size: var(--font-caption);
    }
}

/* ============================================
   STATISTICS - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .section--statistics {
        padding: 40px 0;
        background-attachment: scroll !important;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card__icon {
        font-size: 2rem;
    }
    
    .stat-card__number {
        font-size: 2.2rem;
    }
    
    .stat-card__label {
        font-size: var(--font-small);
    }
}

/* ============================================
   BREADCRUMBS - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .breadcrumbs {
        padding: 10px 0;
    }
    
    .breadcrumbs__list {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .breadcrumbs__item {
        font-size: var(--font-caption);
    }
    
    .breadcrumbs__item--separator {
        padding: 0 4px;
    }
}

/* ============================================
   HEADER PROMO - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .header__promo {
        padding: 6px 0;
    }
    
    .header__promo-text {
        font-size: 0.7rem;
    }
    
    .header__promo-text i {
        font-size: 0.8rem;
    }
    
    .header__promo .container {
        padding: 0 10px;
    }
}

/* ============================================
   BUTTONS - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .button {
        padding: 12px 24px;
        font-size: var(--font-body);
        width: 100%;
        justify-content: center;
    }
    
    .button--small {
        padding: 8px 16px;
        font-size: var(--font-small);
        width: auto;
    }
    
    .button--large {
        padding: 14px 28px;
        font-size: var(--font-body-large);
        width: 100%;
    }
}

/* ============================================
   TABLES - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .table-responsive {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .table-responsive table {
        width: 100%;
        min-width: 600px;
        font-size: var(--font-caption);
    }
}

/* ============================================
   IMAGES - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .grid__image img {
        width: 100%;
        height: auto;
    }
}

/* ============================================
   FORMS - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    input[type="file"] {
        padding: 8px;
        font-size: var(--font-caption);
    }
    
    .form-checkbox {
        align-items: flex-start;
    }
    
    .form-checkbox input[type="checkbox"] {
        margin-top: 2px;
        flex-shrink: 0;
    }
}

/* ============================================
   VIDEO - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .video-card__wrapper {
        padding-bottom: 56.25%;
        position: relative;
        height: 0;
        overflow: hidden;
    }
    
    .video-card__wrapper img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .video-card__play {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* ============================================
   UTILITY - Mobile Fix
   ============================================ */

@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center !important;
    }
    
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .mb-sm-mobile {
        margin-bottom: 8px !important;
    }
    
    .mb-md-mobile {
        margin-bottom: 16px !important;
    }
    
    .mb-lg-mobile {
        margin-bottom: 24px !important;
    }
}

/* ============================================
   ANIMATIONS - Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero__badge {
        animation: none !important;
    }
    
    .stat-card__number {
        animation: none !important;
    }
    
    .navbar__dropdown {
        animation: none !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .navbar,
    .footer,
    .header__promo,
    .whatsapp-chat,
    .footer__back-to-top,
    .hero__video-btn,
    .cta__buttons .button {
        display: none !important;
    }
    
    .hero {
        min-height: auto !important;
        padding: 20px 0 !important;
    }
    
    .section {
        padding: 20px 0 !important;
        page-break-inside: avoid;
    }
    
    .grid {
        display: block !important;
    }
    
    .grid > * {
        margin-bottom: 20px !important;
    }
}