/* =============================================
   UBQ - Responsive Stylesheet
   Mobile-first responsive breakpoints
   ============================================= */

/* =============================================
   Extra Large Devices (1400px and up)
   ============================================= */
@media (min-width: 1400px) {
    :root {
        --container-max: 1320px;
    }

    .hero-title {
        font-size: var(--text-7xl);
    }
}

/* =============================================
   Large Devices / Desktops (1200px and up)
   ============================================= */
@media (max-width: 1199px) {
    :root {
        --container-max: 1140px;
    }

    .hero .container {
        gap: var(--spacing-10);
    }

    .hero-title {
        font-size: var(--text-5xl);
    }

    .hero-float-card-1 {
        left: -5%;
    }

    .value-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-6);
    }

    .clients-logos {
        grid-template-columns: repeat(4, 1fr);
    }

    .awards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
        gap: var(--spacing-8);
    }
}

/* =============================================
   Medium Devices / Tablets (992px and up)
   ============================================= */
@media (max-width: 991px) {
    :root {
        --container-max: 960px;
        --header-height: 70px;
    }

    /* Header Mobile */
    .header .container {
        position: relative;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: rgba(10, 15, 26, 0.98);
        backdrop-filter: blur(20px);
        box-shadow: var(--shadow-2xl);
        padding: calc(var(--header-height) + var(--spacing-8)) var(--spacing-8) var(--spacing-8);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: var(--z-fixed);
        overflow-y: auto;
    }

    .nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link {
        display: block;
        padding: var(--spacing-4) 0;
        font-size: var(--text-lg);
        color: rgba(255, 255, 255, 0.8);
    }

    .nav-link:hover,
    .nav-link.active {
        color: var(--color-white);
    }

    .nav-link::after {
        display: none;
    }

    .header-actions {
        gap: var(--spacing-4);
    }

    .btn-header {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    /* Mobile menu overlay */
    .nav::before {
        content: '';
        position: fixed;
        top: 0;
        left: -100vw;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .nav.active::before {
        left: -100%;
        opacity: 1;
        pointer-events: auto;
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--spacing-12)) 0 var(--spacing-16);
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
        order: 1;
    }

    .hero-badge {
        justify-content: center;
    }

    .hero-trust {
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--spacing-8);
    }

    .hero-visual {
        order: 2;
        max-width: 500px;
        margin: 0 auto;
    }

    .hero-dashboard {
        transform: none;
    }

    .hero-dashboard-content {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-2);
    }

    .hero-title {
        font-size: var(--text-4xl);
    }

    .hero-subtitle {
        font-size: var(--text-lg);
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-float-card-1 {
        left: 5%;
        top: 5%;
    }

    .hero-float-card-2 {
        right: 5%;
        bottom: 10%;
    }

    .hero-orb-1 {
        width: 400px;
        height: 400px;
    }

    .hero-orb-2 {
        width: 300px;
        height: 300px;
    }

    .hero-orb-3 {
        display: none;
    }

    .hero-scroll-indicator {
        display: none;
    }

    /* Sections */
    .section {
        padding: var(--spacing-16) 0;
    }

    .section-title {
        font-size: var(--text-3xl);
    }

    .section-header {
        margin-bottom: var(--spacing-12);
    }

    /* Bento Grid */
    .bento-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bento-card-large {
        grid-column: span 2;
        grid-row: span 1;
    }

    .bento-card-wide {
        grid-column: span 2;
    }

    .bento-flow {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Services Showcase */
    .showcase-grid {
        grid-template-columns: 1fr;
    }

    .showcase-featured {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }

    .showcase-visual {
        order: -1;
        margin-bottom: var(--spacing-6);
    }

    /* Stats Modern */
    .stats-numbers {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-num {
        font-size: var(--text-4xl);
    }

    /* Legacy Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card-featured {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }

    .service-card-image {
        min-height: 250px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-number {
        font-size: var(--text-4xl);
    }

    /* Clients */
    .clients-logos {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-6);
    }

    .awards-grid {
        grid-template-columns: 1fr;
    }

    /* CTA */
    .cta-title {
        font-size: var(--text-3xl);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-10);
    }

    .footer-brand {
        grid-column: span 2;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-4);
        text-align: center;
    }
}

/* =============================================
   Small Devices / Large Phones (768px and up)
   ============================================= */
@media (max-width: 767px) {
    :root {
        --container-padding: 1rem;
    }

    /* Typography */
    h1, .hero-title {
        font-size: var(--text-3xl);
    }

    h2, .section-title {
        font-size: var(--text-2xl);
    }

    h3 {
        font-size: var(--text-xl);
    }

    /* Header */
    .logo-img {
        height: 32px;
    }

    .lang-switcher {
        font-size: var(--text-xs);
    }

    /* Hero */
    .hero {
        padding: calc(var(--header-height) + var(--spacing-8)) 0 var(--spacing-12);
    }

    .hero-title {
        font-size: var(--text-3xl);
        margin-bottom: var(--spacing-4);
    }

    .hero-subtitle {
        font-size: var(--text-base);
        margin-bottom: var(--spacing-6);
    }

    .hero-cta {
        flex-direction: column;
        gap: var(--spacing-3);
        margin-bottom: var(--spacing-8);
    }

    .hero-cta .btn {
        width: 100%;
    }

    .hero-trust {
        flex-direction: row;
        justify-content: space-around;
        gap: var(--spacing-4);
    }

    .hero-trust-number {
        font-size: var(--text-2xl);
    }

    .hero-trust-label {
        font-size: var(--text-xs);
    }

    .hero-dashboard-main {
        padding: var(--spacing-4);
    }

    .hero-stat-card {
        padding: var(--spacing-3);
    }

    .hero-stat-value {
        font-size: var(--text-lg);
    }

    .hero-stat-label {
        font-size: 0.65rem;
    }

    .hero-float-card {
        padding: var(--spacing-3) var(--spacing-4);
    }

    .float-card-icon {
        width: 40px;
        height: 40px;
    }

    .float-card-icon svg {
        width: 20px;
        height: 20px;
    }

    .float-card-number {
        font-size: var(--text-lg);
    }

    .float-card-label {
        font-size: var(--text-xs);
    }

    /* Section */
    .section {
        padding: var(--spacing-12) 0;
    }

    .section-description {
        font-size: var(--text-base);
    }

    /* Bento Grid Mobile */
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-card-large,
    .bento-card-medium,
    .bento-card-wide {
        grid-column: span 1;
    }

    .bento-card {
        padding: var(--spacing-6);
    }

    .bento-metric {
        font-size: var(--text-3xl);
    }

    .bento-chart {
        height: 80px;
    }

    .bento-flow {
        gap: var(--spacing-3);
    }

    .flow-num {
        width: 28px;
        height: 28px;
        font-size: var(--text-xs);
    }

    .flow-label {
        font-size: 0.65rem;
    }

    /* Services Showcase Mobile */
    .showcase-featured {
        padding: var(--spacing-6);
    }

    .showcase-icon-large {
        width: 60px;
        height: 60px;
    }

    .showcase-icon-large svg {
        width: 28px;
        height: 28px;
    }

    .showcase-featured .showcase-title {
        font-size: var(--text-2xl);
    }

    .mockup-num {
        font-size: var(--text-4xl);
    }

    /* Stats Modern Mobile */
    .stats-modern {
        padding: var(--spacing-16) 0;
    }

    .stats-numbers {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-4);
    }

    .stat-block {
        padding: var(--spacing-6);
    }

    .stat-num {
        font-size: var(--text-3xl);
    }

    .stat-plus {
        font-size: var(--text-xl);
    }

    .stat-title {
        font-size: var(--text-base);
    }

    .stat-desc {
        font-size: var(--text-xs);
    }

    /* Value Props */
    .value-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-6);
    }

    .value-card {
        padding: var(--spacing-6);
    }

    .value-card-icon {
        width: 60px;
        height: 60px;
        margin-bottom: var(--spacing-4);
    }

    .value-card-title {
        font-size: var(--text-lg);
    }

    /* Services */
    .service-card-content {
        padding: var(--spacing-6);
    }

    .service-card-icon {
        width: 48px;
        height: 48px;
        margin-bottom: var(--spacing-4);
    }

    .service-card-icon svg {
        width: 24px;
        height: 24px;
    }

    .service-card-title {
        font-size: var(--text-xl);
    }

    /* Stats */
    .stats {
        padding: var(--spacing-12) 0;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-4);
    }

    .stat-item {
        padding: var(--spacing-4);
    }

    .stat-number {
        font-size: var(--text-3xl);
    }

    .stat-suffix {
        font-size: var(--text-xl);
    }

    .stat-label {
        font-size: var(--text-sm);
    }

    /* Clients */
    .clients-logos {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-4);
    }

    .client-logo {
        padding: var(--spacing-3);
    }

    .client-logo img {
        max-height: 40px;
    }

    .awards-section {
        padding: var(--spacing-6);
    }

    .awards-title {
        font-size: var(--text-lg);
        margin-bottom: var(--spacing-6);
    }

    .award-item {
        padding: var(--spacing-3);
    }

    .award-icon {
        width: 40px;
        height: 40px;
    }

    .award-icon svg {
        width: 20px;
        height: 20px;
    }

    .award-content strong {
        font-size: var(--text-sm);
    }

    .award-content span {
        font-size: var(--text-xs);
    }

    /* CTA */
    .cta-section {
        padding: var(--spacing-12) 0;
    }

    .cta-title {
        font-size: var(--text-2xl);
    }

    .cta-text {
        font-size: var(--text-base);
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-12) 0 var(--spacing-6);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-8);
    }

    .footer-brand {
        grid-column: span 1;
        text-align: center;
    }

    .footer-certifications {
        justify-content: center;
    }

    .footer-nav,
    .footer-contact {
        text-align: center;
    }

    .footer-contact-list li {
        justify-content: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-title {
        margin-bottom: var(--spacing-4);
    }

    /* Buttons */
    .btn-lg {
        padding: var(--spacing-3) var(--spacing-6);
        font-size: var(--text-base);
    }
}

/* =============================================
   Extra Small Devices / Phones (576px and below)
   ============================================= */
@media (max-width: 575px) {
    :root {
        --container-padding: 0.75rem;
    }

    /* Hero */
    .hero-title {
        font-size: var(--text-2xl);
    }

    .hero-float-card-1,
    .hero-float-card-2 {
        display: none;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: var(--text-4xl);
    }

    /* Form on mobile */
    .form-group {
        margin-bottom: var(--spacing-4);
    }
}

/* =============================================
   Landscape Phone Orientation
   ============================================= */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--spacing-4)) 0 var(--spacing-8);
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    .hero-subtitle {
        display: none;
    }

    .hero-visual {
        display: none;
    }
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
    .header,
    .footer,
    .hero-scroll-indicator,
    .btn,
    .mobile-toggle {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .section {
        padding: 20pt 0;
        page-break-inside: avoid;
    }

    .hero {
        min-height: auto;
        padding: 40pt 0;
    }

    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
    }
}

/* =============================================
   High DPI / Retina Displays
   ============================================= */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image,
    .service-card-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* =============================================
   Dark Mode Support (Optional)
   ============================================= */
@media (prefers-color-scheme: dark) {
    /*
    Uncomment to enable dark mode:

    :root {
        --color-gray-50: #111827;
        --color-gray-100: #1F2937;
        --color-gray-200: #374151;
        --color-gray-300: #4B5563;
        --color-gray-400: #6B7280;
        --color-gray-500: #9CA3AF;
        --color-gray-600: #D1D5DB;
        --color-gray-700: #E5E7EB;
        --color-gray-800: #F3F4F6;
        --color-gray-900: #F9FAFB;
        --color-white: #111827;
    }
    */
}

/* =============================================
   Touch Device Optimizations
   ============================================= */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .btn:hover {
        transform: none;
    }

    .value-card:hover {
        transform: none;
    }

    .service-card:hover {
        transform: none;
    }

    .nav-link::after {
        display: none;
    }

    /* Increase touch targets */
    .nav-link {
        padding: var(--spacing-4) var(--spacing-2);
    }

    .btn {
        min-height: 48px;
    }

    .social-link {
        width: 48px;
        height: 48px;
    }
}

/* =============================================
   Accessibility - Focus Visible
   ============================================= */
@media (prefers-reduced-motion: no-preference) {
    :focus-visible {
        outline: 2px solid var(--color-primary);
        outline-offset: 2px;
    }
}

/* =============================================
   Container Queries (Future-proofing)
   ============================================= */
@supports (container-type: inline-size) {
    .services-grid {
        container-type: inline-size;
    }

    @container (max-width: 600px) {
        .service-card-featured {
            grid-template-columns: 1fr;
        }
    }
}

/* =============================================
   Services Page Visual - Responsive
   ============================================= */

/* Large Devices */
@media (max-width: 1199px) {
    .service-split {
        gap: var(--spacing-10);
    }

    .hardware-gallery {
        gap: var(--spacing-6);
    }

    .retail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .retail-card.large {
        grid-column: span 2;
    }
}

/* Medium Devices / Tablets */
@media (max-width: 991px) {
    .page-hero-visual .page-hero-title {
        font-size: var(--text-4xl);
    }

    .service-split {
        grid-template-columns: 1fr;
        gap: var(--spacing-10);
    }

    .service-split.reverse {
        direction: ltr;
    }

    .service-content {
        max-width: 100%;
    }

    .service-title-large {
        font-size: var(--text-3xl);
    }

    .features-visual-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tech-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hardware-gallery {
        grid-template-columns: 1fr;
    }

    .hardware-card.featured {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }

    .hardware-card.featured .hardware-image {
        min-height: 300px;
    }

    .signage-showcase {
        grid-template-columns: 1fr;
    }

    .retail-grid {
        grid-template-columns: 1fr;
    }

    .retail-card.large {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }

    .retail-card.large .retail-image {
        min-height: 250px;
    }

    .complementary-visual-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title-large {
        font-size: var(--text-3xl);
    }

    .service-image-card.small {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        margin-top: var(--spacing-4);
    }
}

/* Small Devices / Landscape Phones */
@media (max-width: 767px) {
    .page-hero-visual {
        min-height: 50vh;
        padding: calc(var(--header-height) + var(--spacing-10)) 0 var(--spacing-10);
    }

    .page-hero-visual .page-hero-title {
        font-size: var(--text-3xl);
    }

    .page-hero-visual .page-hero-description {
        font-size: var(--text-base);
    }

    .services-nav-list {
        gap: var(--spacing-2);
        padding: var(--spacing-3) 0;
    }

    .services-nav-link {
        padding: var(--spacing-2) var(--spacing-3);
        font-size: var(--text-xs);
    }

    .service-section-visual {
        padding: var(--spacing-12) 0;
    }

    .service-title-large {
        font-size: var(--text-2xl);
    }

    .service-stats-row {
        flex-direction: column;
        gap: var(--spacing-4);
        text-align: center;
    }

    .service-stats-row .service-stat {
        padding: var(--spacing-3) 0;
        border-bottom: 1px solid var(--color-gray-100);
    }

    .service-stats-row .service-stat:last-child {
        border-bottom: none;
    }

    .features-visual-grid {
        grid-template-columns: 1fr;
    }

    .feature-visual-image {
        height: 180px;
    }

    .tech-features-box {
        padding: var(--spacing-6);
    }

    .tech-features-box h3 {
        font-size: var(--text-xl);
    }

    .tech-features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-4);
    }

    .section-header-visual {
        margin-bottom: var(--spacing-8);
    }

    .section-title-large {
        font-size: var(--text-2xl);
    }

    .hardware-image {
        height: 220px;
    }

    .metrics-showcase {
        gap: var(--spacing-2);
    }

    .metric-pill {
        font-size: var(--text-xs);
        padding: var(--spacing-1) var(--spacing-3);
    }

    .complementary-visual-grid {
        grid-template-columns: 1fr;
    }

    .complementary-visual-card {
        padding: var(--spacing-6);
    }

    .cta-section-visual {
        padding: var(--spacing-16) 0;
    }

    .cta-visual-content h2 {
        font-size: var(--text-2xl);
    }

    .cta-visual-content p {
        font-size: var(--text-base);
    }

    .cta-visual-content .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .service-image-card.large img {
        min-height: 300px;
    }
}

/* Extra Small Devices */
@media (max-width: 479px) {
    .page-hero-visual .page-hero-title {
        font-size: var(--text-2xl);
    }

    .service-title-large {
        font-size: var(--text-xl);
    }

    .service-intro {
        font-size: var(--text-base);
    }

    .stat-number {
        font-size: var(--text-2xl);
    }

    .feature-visual-content {
        padding: var(--spacing-4);
    }

    .hardware-content {
        padding: var(--spacing-4);
    }

    .retail-content {
        padding: var(--spacing-4);
    }
}
