/**
 * Corporate Global Theme - Responsive Styles
 *
 * Breakpoints:
 *   - 1200px: Tablet landscape
 *   - 992px:  Tablet
 *   - 768px:  Mobile landscape
 *   - 576px:  Mobile
 *
 * @package CorporateGlobal
 */

/* ==========================================================================
   Tablet Landscape (max-width: 1200px)
   ========================================================================== */

@media (max-width: 1200px) {

    /* Grid: 4-col becomes 3-col */
    .cgt-grid--4 {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer: 4-col to 2-col */
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--cgt-space-xl);
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }

    /* Product detail: tighten gap */
    .cgt-product-detail__layout {
        gap: var(--cgt-space-xl);
    }

    /* Mega menu constrain */
    .site-nav__list > li.mega-menu > .sub-menu {
        min-width: 500px;
    }

    /* Container padding increase for edge comfort */
    .cgt-container {
        padding-left: var(--cgt-space-xl);
        padding-right: var(--cgt-space-xl);
    }
}


/* ==========================================================================
   Tablet (max-width: 992px)
   ========================================================================== */

@media (max-width: 992px) {

    /* Typography scale-down */
    h1, .cgt-hero__title { font-size: var(--cgt-text-4xl); }
    h2 { font-size: var(--cgt-text-3xl); }
    h3 { font-size: var(--cgt-text-2xl); }

    /* Grid: 3-col becomes 2-col */
    .cgt-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Section padding reduce */
    .cgt-section {
        padding-top: var(--cgt-space-3xl);
        padding-bottom: var(--cgt-space-3xl);
    }

    /* Header: hide desktop nav, show mobile toggle */
    .site-nav {
        display: none;
    }

    .site-header__mobile-toggle {
        display: flex;
    }

    /* Product detail: stack layout */
    .cgt-product-detail__layout {
        grid-template-columns: 1fr;
    }

    .cgt-product-gallery {
        position: static;
    }

    /* Job detail: stack layout */
    .cgt-job-detail__layout {
        grid-template-columns: 1fr;
    }

    .cgt-job-detail__sidebar {
        position: static;
    }

    /* Hero */
    .cgt-hero {
        min-height: 260px;
    }

    .cgt-hero__content {
        padding: var(--cgt-space-2xl) 0;
    }

    /* News detail title */
    .cgt-news-detail__title {
        font-size: var(--cgt-text-3xl);
    }

    /* Product info title */
    .cgt-product-info__title {
        font-size: var(--cgt-text-2xl);
    }

    /* Footer bottom stack */
    .site-footer__bottom-inner {
        flex-direction: column;
        text-align: center;
    }
}


/* ==========================================================================
   Mobile Landscape (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {

    /* Typography */
    h1, .cgt-hero__title { font-size: var(--cgt-text-3xl); }
    h2 { font-size: var(--cgt-text-2xl); }
    h3 { font-size: var(--cgt-text-xl); }

    /* Hero */
    .cgt-hero {
        min-height: 200px;
    }

    .cgt-hero--archive {
        min-height: 160px;
    }

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

    /* Grids: 2-col stays or becomes 1-col */
    .cgt-grid--2 {
        grid-template-columns: 1fr;
    }

    /* Footer: single column */
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: var(--cgt-space-xl);
    }

    .site-footer__brand {
        grid-column: auto;
    }

    /* Cards */
    .cgt-product-card__content,
    .cgt-news-card__content {
        padding: var(--cgt-space-md);
    }

    .cgt-job-card {
        padding: var(--cgt-space-lg);
    }

    .cgt-job-card__header {
        flex-direction: column;
        gap: var(--cgt-space-sm);
    }

    /* Filter tabs: horizontal scroll */
    .cgt-filter-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: var(--cgt-space-sm);
    }

    .cgt-filter-tabs::-webkit-scrollbar {
        display: none;
    }

    /* Job filters: stack */
    .cgt-job-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .cgt-job-filters__select {
        min-width: 0;
        width: 100%;
    }

    /* Form row: stack */
    .cgt-form-row {
        grid-template-columns: 1fr;
    }

    /* Specs table: compact */
    .cgt-specs-table th,
    .cgt-specs-table td {
        padding: var(--cgt-space-sm) var(--cgt-space-md);
    }

    /* Breadcrumbs */
    .cgt-breadcrumbs {
        font-size: var(--cgt-text-xs);
    }

    /* Pagination */
    .cgt-pagination a,
    .cgt-pagination span {
        min-width: 36px;
        height: 36px;
    }

    /* News detail */
    .cgt-news-detail__meta {
        flex-direction: column;
        gap: var(--cgt-space-sm);
    }

    /* Related products: 2-col */
    .cgt-related-products .cgt-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Back to top: smaller offset */
    .cgt-back-to-top {
        bottom: var(--cgt-space-lg);
        right: var(--cgt-space-lg);
    }

    /* Top bar: hide contact on small tablets */
    .site-header__top-contact {
        display: none;
    }
}


/* ==========================================================================
   Mobile (max-width: 576px)
   ========================================================================== */

@media (max-width: 576px) {

    /* Typography */
    h1, .cgt-hero__title { font-size: var(--cgt-text-2xl); }
    h2 { font-size: var(--cgt-text-xl); }
    h3 { font-size: var(--cgt-text-lg); }

    body {
        font-size: var(--cgt-text-sm);
    }

    /* Container tighter padding */
    .cgt-container {
        padding-left: var(--cgt-space-md);
        padding-right: var(--cgt-space-md);
    }

    /* Section spacing */
    .cgt-section {
        padding-top: var(--cgt-space-2xl);
        padding-bottom: var(--cgt-space-2xl);
    }

    /* Hero minimal */
    .cgt-hero {
        min-height: 160px;
    }

    .cgt-hero__content {
        padding: var(--cgt-space-xl) 0;
    }

    /* All grids: single column */
    .cgt-grid--3,
    .cgt-grid--4 {
        grid-template-columns: 1fr;
    }

    /* Related products: single column */
    .cgt-related-products .cgt-grid--3 {
        grid-template-columns: 1fr;
    }

    /* Cards: reduce image height */
    .cgt-product-card__image {
        aspect-ratio: 16 / 10;
    }

    /* Buttons: full width on mobile */
    .cgt-job-card__actions {
        flex-direction: column;
    }

    .cgt-job-card__actions .cgt-btn {
        width: 100%;
    }

    /* Gallery thumbs: smaller grid */
    .cgt-product-gallery__thumbs {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    /* Product detail title */
    .cgt-product-info__title {
        font-size: var(--cgt-text-xl);
    }

    /* Specs table: block layout for narrow screens */
    .cgt-specs-table,
    .cgt-specs-table thead,
    .cgt-specs-table tbody,
    .cgt-specs-table th,
    .cgt-specs-table td,
    .cgt-specs-table tr {
        display: block;
    }

    .cgt-specs-table thead {
        display: none;
    }

    .cgt-specs-table tr {
        margin-bottom: var(--cgt-space-sm);
        border: 1px solid var(--cgt-gray-200);
        border-radius: var(--cgt-radius-sm);
        overflow: hidden;
    }

    .cgt-specs-table th {
        width: 100%;
        background-color: var(--cgt-gray-100);
        font-weight: 600;
    }

    .cgt-specs-table td {
        padding-left: var(--cgt-space-md);
    }

    /* News detail */
    .cgt-news-detail__title {
        font-size: var(--cgt-text-2xl);
    }

    .cgt-news-detail__featured-image {
        max-height: 250px;
    }

    /* Footer */
    .site-footer__main {
        padding: var(--cgt-space-2xl) 0;
    }

    .site-footer__nav-list {
        flex-direction: column;
        align-items: center;
        gap: var(--cgt-space-sm);
    }

    /* Mobile nav wider */
    .mobile-nav {
        max-width: 100%;
    }

    /* Load more button */
    .cgt-load-more {
        width: 100%;
    }

    /* Back to top: smaller */
    .cgt-back-to-top {
        width: 38px;
        height: 38px;
        bottom: var(--cgt-space-md);
        right: var(--cgt-space-md);
    }

    /* Social icons in footer */
    .cgt-social-icons {
        justify-content: center;
    }

    /* Contact form */
    .cgt-contact-form {
        padding: 0 var(--cgt-space-sm);
    }
}


/* ==========================================================================
   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;
    }
}


/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .cgt-back-to-top,
    .mobile-nav,
    .mobile-nav-overlay,
    .cgt-filter-tabs,
    .cgt-load-more-wrap,
    .cgt-pagination,
    .lang-switcher {
        display: none !important;
    }

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

    .cgt-container {
        max-width: 100%;
        padding: 0;
    }

    .cgt-hero {
        background-color: #f0f0f0 !important;
        min-height: auto;
        padding: 1rem 0;
    }

    .cgt-hero__overlay {
        display: none;
    }

    .cgt-hero__title {
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
