/* ============================================
   RESPONSIVE DESIGN
   Mobile-first approach
   ============================================ */

/* ============================================
   MOBILE STYLES (Base - up to 767px)
   ============================================ */

/* Already handled in main.css - mobile first */

/* ============================================
   TABLET STYLES (768px - 1023px)
   ============================================ */
@media (max-width: 1023px) {
    /* Typography */
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }

    /* Hero */
    .hero-logo img {
        width: 92vw;
        max-width: 1400px;
    }

    .hero-slogan {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .tap-slogan {
        font-size: 2rem;
    }

    .sustainability-badge {
        flex-direction: row;
        text-align: left;
        padding: var(--spacing-sm) var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .badge-icon {
        font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    }

    .badge-text {
        font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    }

    /* Split Layouts */
    .split-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* What We Do */
    .features-grid {
        grid-template-columns: 1fr;
    }

    .features-grid .feature-item:nth-child(3) {
        grid-column: span 1;
    }

    /* Timeline */
    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        grid-template-columns: 60px 1fr;
        gap: var(--spacing-md);
    }

    .timeline-icon {
        grid-column: 1;
        width: 60px;
        height: 60px;
    }

    .timeline-icon img {
        width: 40px;
        height: 40px;
    }

    .timeline-icon .step-number {
        font-size: 1.75rem;
    }

    .timeline-content {
        grid-column: 2 !important;
    }

    .timeline-item:nth-child(even) .timeline-content {
        grid-column: 2;
    }

    /* Projects Grid */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    /* Products Grid */
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Market Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

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

    .stat-number {
        font-size: clamp(3rem, 8vw, 4rem);
    }

    .stats-tagline {
        padding: var(--spacing-md);
    }

    /* Forms */
    .forms-container {
        grid-template-columns: 1fr;
    }

    /* Case Study Modal */
    .case-study-layout {
        grid-template-columns: 1fr;
    }

    .case-study-media {
        max-height: 400px;
    }
}

/* ============================================
   MOBILE STYLES (up to 767px)
   ============================================ */
@media (max-width: 767px) {
    /* General */
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
    }

    section {
        padding: var(--spacing-lg) 0;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.375rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .btn-large {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    /* Hero */
    .hero-section {
        min-height: 100svh;
        gap: 15px;
        padding: clamp(1rem, 2.5vh, 1.5rem) clamp(0.5rem, 1.5vw, 0.75rem) clamp(3.5rem, 7vh, 5rem) clamp(0.5rem, 1.5vw, 0.75rem);
    }

    .hero-logo img {
        width: min(92vw, 100%);
        max-width: min(46.875rem, 100%);
    }

    .hero-slogan {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .tap-slogan {
        font-size: 1.6rem;
    }

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

    .sustainability-badge {
        padding: var(--spacing-xs) var(--spacing-sm);
        gap: var(--spacing-xs);
        flex-direction: row;
    }

    .badge-icon {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }

    .badge-text {
        font-size: clamp(0.7rem, 2vw, 0.85rem);
        line-height: 1.4;
    }

    .scroll-indicator {
        bottom: var(--spacing-sm);
    }

    .scroll-indicator span {
        font-size: 0.75rem;
    }

    .scroll-arrow {
        width: 20px;
        height: 20px;
    }

    /* What We Do */
    .intro-text {
        font-size: 1.125rem;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
    }

    .feature-item h3 {
        font-size: 1.125rem;
    }

    .interactive-gadget-container {
        padding: var(--spacing-md);
    }

    /* Timeline */
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        grid-template-columns: 40px 1fr;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }

    .timeline-icon {
        width: 40px;
        height: 40px;
        box-shadow: 0 0 0 5px var(--color-black);
    }

    .timeline-icon img {
        width: 24px;
        height: 24px;
    }

    .timeline-icon .step-number {
        font-size: 1.25rem;
    }

    .timeline-content {
        padding: var(--spacing-sm);
    }

    .timeline-content h3 {
        font-size: 1.125rem;
    }

    .timeline-content p {
        font-size: 0.9rem;
    }

    /* CTA */
    .cta-title {
        font-size: 1.5rem;
    }

    /* Clients */
    .client-logo {
        width: 150px;
        height: 80px;
    }

    .client-logo img {
        filter: grayscale(0%) !important;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .project-image {
        height: 250px;
    }

    .project-title {
        font-size: 1.125rem;
    }

    .project-sector {
        font-size: 0.85rem;
    }

    /* Products */
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-image {
        height: 250px;
    }

    .product-title {
        font-size: 1.25rem;
    }

    .product-subtitle {
        font-size: 0.95rem;
    }

    .product-description {
        font-size: 0.9rem;
    }

    /* Market Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        margin: var(--spacing-md) 0;
    }

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

    .stat-number {
        font-size: clamp(2.5rem, 10vw, 3.5rem);
        margin-bottom: var(--spacing-xs);
    }

    .stat-title {
        font-size: 1rem;
        min-height: auto;
    }

    .stat-subtitle {
        font-size: 0.875rem;
    }

    .stats-tagline {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .stats-tagline p {
        font-size: 1rem;
    }

    /* Contact */
    .form-progress {
        margin-bottom: var(--spacing-md);
    }

    .progress-circle {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .progress-label {
        font-size: 0.7rem;
        bottom: -22px;
    }

    .form-box {
        padding: var(--spacing-md);
    }

    .form-title {
        font-size: 1.5rem;
    }

    .form-description {
        font-size: 0.875rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

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

    .btn-prev,
    .btn-next {
        width: 100%;
    }

    /* Footer */
    .footer-logo img {
        max-width: 280px;
    }

    .footer-text p {
        font-size: 0.875rem;
    }

    .footer-links {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    /* Modals */
    .modal {
        padding: var(--spacing-xs);
    }

    .modal.active {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .modal-content {
        padding: var(--spacing-md);
        max-width: 100%;
        max-height: min(calc(100vh - 2.5rem), 80rem);
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.25rem;
    }

    /* Case Study Modal - Mobile */
    .case-study-modal .modal-content {
        padding: var(--spacing-md);
    }

    /* Digital Hub Modal - Mobile */
    .product-modal .modal-content {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .product-modal .product-slider {
        height: clamp(18rem, 30vh, 25rem);
        margin-bottom: var(--spacing-sm);
    }

    .product-modal .product-section {
        margin-bottom: 16px;
    }

    .case-study-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .case-study-media {
        position: relative;
    }

    .case-video,
    .case-image {
        max-height: 40vh;
    }

    .case-study-modal h2 {
        font-size: 1.5rem;
    }

    .case-section h3 {
        font-size: 1.125rem;
    }

    /* Photo Gallery - Mobile */
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .gallery-prev {
        left: 5px;
    }

    .gallery-next {
        right: 5px;
    }

    .gallery-counter {
        font-size: 0.75rem;
        padding: 6px 12px;
        bottom: 10px;
    }

    /* Mini Hub Modal */
    .phone-mockup {
        padding: 15px;
        border-radius: 25px;
    }

    .phone-screen {
        padding: var(--spacing-md);
    }

    .hub-logo img {
        max-width: 100px;
    }

    .phone-screen h3 {
        font-size: 1.125rem;
    }

    .hub-sound-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.9rem;
    }

    .hub-link {
        padding: var(--spacing-xs);
        font-size: 0.9rem;
    }

    /* Case Study Modal */
    .case-study-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .case-study-media {
        max-height: 300px;
    }

    .case-study-content h2 {
        font-size: 1.5rem;
    }

    .case-section h3 {
        font-size: 1.125rem;
    }

    .case-section p,
    .case-section li {
        font-size: 0.9rem;
    }

    /* Product Detail Modal */
    .product-detail h2 {
        font-size: 1.5rem;
    }

    .product-tagline {
        font-size: 1rem;
    }

    .product-section h3 {
        font-size: 1rem;
    }

    .product-section li {
        font-size: 0.9rem;
    }

    /* Success Modal */
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .success-message h3 {
        font-size: 1.375rem;
    }
}

/* ============================================
   SMALL MOBILE (up to 374px)
   ============================================ */
@media (max-width: 374px) {
    .hero-section {
        gap: 10px;
        padding: 15px 8px 70px 8px;
    }

    .hero-logo img {
        width: min(93vw, 100%);
    }

    .hero-slogan {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .tap-slogan {
        font-size: 1.4rem;
    }

    .sustainability-badge {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-xs);
        gap: var(--spacing-xs);
    }

    .badge-text {
        text-align: center;
        font-size: clamp(0.65rem, 1.8vw, 0.8rem);
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .timeline-icon {
        margin: 0 auto var(--spacing-xs);
    }

    .timeline::before {
        display: none;
    }

    .progress-circle {
        width: 45px;
        height: 45px;
        font-size: 0.9rem;
    }

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

/* ============================================
   MEDIUM DESKTOP (1024px - 1439px)
   ============================================ */
@media (min-width: 1024px) and (max-width: 1439px) {
    .hero-logo img {
        width: min(89vw, 100%);
        max-width: min(100rem, 100%);
    }

    .hero-slogan {
        font-size: 3.5rem;
    }
}

/* ============================================
   LARGE DESKTOP (1440px and up)
   ============================================ */
@media (min-width: 1440px) {
    .container {
        max-width: 1600px;
    }

    section {
        padding: var(--spacing-xl) 0;
    }

    .hero-logo img {
        width: min(87vw, 100%);
        max-width: min(112.5rem, 100%);
    }

    .hero-slogan {
        font-size: 4rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .tap-slogan {
        font-size: 2.8rem;
    }

    .project-image {
        height: 350px;
    }

    .product-image {
        height: 350px;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION (Mobile/Tablet)
   ============================================ */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        gap: 10px;
        padding: 15px 10px 70px 10px;
    }

    .hero-logo img {
        width: 80vw;
        max-width: 1100px;
    }

    .hero-slogan {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .tap-slogan {
        font-size: 1.5rem;
    }

    .sustainability-badge {
        padding: var(--spacing-xs) var(--spacing-sm);
        gap: var(--spacing-xs);
        flex-direction: row;
    }

    .badge-icon {
        font-size: clamp(1.25rem, 3vw, 1.75rem);
    }

    .badge-text {
        font-size: clamp(0.65rem, 1.5vw, 0.8rem);
        line-height: 1.3;
    }

    .scroll-indicator {
        display: none;
    }
}

/* Extra small height landscape (very tight vertical space) */
@media (max-height: 450px) and (orientation: landscape) {
    .hero-section {
        gap: 8px;
        padding: 10px 8px 60px 8px;
    }

    .hero-logo img {
        width: 70vw;
        max-width: 850px;
    }

    .hero-slogan {
        font-size: 1.4rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .tap-slogan {
        font-size: 1.2rem;
    }

    .sustainability-badge {
        padding: 0.25rem 0.5rem;
    }

    .badge-icon {
        font-size: 1.25rem;
    }

    .badge-text {
        font-size: 0.65rem;
        line-height: 1.25;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .hero-video-container,
    .scroll-indicator,
    .modal,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }

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

    section {
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    .project-overlay,
    .hero-overlay {
        background: rgba(0, 0, 0, 0.85);
    }

    .btn-primary,
    .btn-secondary {
        border-width: 3px;
    }
}

/* ============================================
   DARK MODE SUPPORT (if needed in future)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* So-Synergy design is already dark-focused,
       but this can be expanded if needed */
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap target sizes */
    .btn-primary,
    .btn-secondary,
    .hub-link,
    .project-card,
    .client-logo {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .project-card:hover,
    .product-card:hover,
    .feature-item:hover {
        transform: none;
    }

    /* Keep box-shadow on touch for better UX */
    .project-card:active {
        transform: scale(0.98);
    }
}
