/* ============================================
   Xiniu Construction Machinery - Responsive
   ============================================ */

/* Tablet: 768px - 1023px */
@media (max-width: 1023px) {
  :root {
    --text-5xl: 36px;
    --text-4xl: 30px;
    --text-3xl: 24px;
  }

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

  .brand-machinery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

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

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

  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-video {
    order: -1;
  }

  .export-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .visit-layout {
    grid-template-columns: 1fr;
  }

  .visit-list-item {
    grid-template-columns: 100px 1fr;
  }

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

  .group-photo-slider {
    grid-template-columns: repeat(3, 1fr);
  }

  .news-slider {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .process-step:not(:last-child)::after {
    display: none;
  }

  .quotation-section {
    padding: 40px 0 0;
  }

  .quotation-layout {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .quotation-form-wrapper {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding: var(--space-xl) var(--space-lg);
  }

  .quotation-image-section {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

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

  .footer-socials {
    justify-content: flex-start;
    margin-top: var(--space-lg);
  }

  /* Hero categories - iPad: don't overlap hero */
  .hero {
    height: auto;
    min-height: 520px;
    padding-bottom: 0;
  }

  .hero-content {
    height: auto;
    min-height: 420px;
  }

  .hero-categories-wrap {
    position: relative;
    bottom: auto;
    margin-top: 26px;
  }

  .hero-categories-wrap .container {
    padding: 0 var(--container-padding);
    max-width: var(--container-max);
  }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
  :root {
    --text-5xl: 28px;
    --text-4xl: 24px;
    --text-3xl: 22px;
    --container-padding: 16px;
  }

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

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

  /* Header Mobile */
  .nav-desktop {
    display: none;
  }

  .header-phone {
    display: none;
  }

  .header-search {
    display: flex;
    padding: 6px;
  }

  .header-search img {
    width: 24px !important;
    height: 24px !important;
  }

  .header-wx {
    display: flex;
    padding: 6px;
  }

  .header-wx img {
    width: 24px !important;
    height: 24px !important;
  }

  .hamburger {
    display: flex;
  }

  /* Mobile submenu adjustments */
  .mobile-submenu a {
    padding: 10px 12px;
    font-size: var(--text-sm);
  }

  /* Hero */
  .hero {
    height: auto;
    min-height: auto;
    padding-bottom: 0;
  }

  .hero-bg {
    display: none;
  }

  .hero-overlay {
    display: none;
  }

  .hero-content {
    position: relative;
    height: auto;
    padding: 200px var(--container-padding) 40px;
    background: url('../images/hero-bg-mobile.jpg') center top/cover no-repeat;
    z-index: 0;
  }

  .hero-content-inner {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }

  .hero-content::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0.85) 100%);
  }

  .hero-content .hero-text {
    position: relative;
    z-index: 1;
  }

  .hero-content .btn-hero {
    position: relative;
    z-index: 2;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-text h1 {
    font-size: var(--text-2xl);
    line-height: 1.2;
    margin-bottom: var(--space-sm);
  }

  .hero-text p {
    font-size: var(--text-sm);
    margin-bottom: var(--space-lg);
  }

  .hero-text .btn {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .hero-categories-wrap {
    display: none;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .category-card,
  .category-card:nth-child(odd),
  .category-card:nth-child(even) {
    padding: 12px 8px;
    border-radius: 4px !important;
    min-height: 180px;
    height: 180px;
    background: linear-gradient(180deg, #E5E5E5 0%, #F8F8F8 100%) !important;
  }

  .category-card:hover,
  .category-card:nth-child(odd):hover,
  .category-card:nth-child(even):hover {
    background: linear-gradient(180deg, #D5D5D5 0%, #E8E8E8 100%) !important;
  }

  .category-card img {
    width: 80px;
    height: 80px;
  }

  .brand-machinery-section {
    padding-top: 80px;
  }

  /* Brand */
  .brand-machinery-grid {
    grid-template-columns: 1fr;
  }

  .brand-logos {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .brand-logos.reveal,
  .brand-logos.reveal.visible {
    display: none;
  }

  .brand-logo-item {
    padding: 12px;
  }

  .brand-machinery-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Products */
  .product-tabs {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .product-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 8px;
    font-size: var(--text-xs);
  }

  .product-sub-categories {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .product-sub-categories span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 8px;
    font-size: var(--text-xs);
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card-img {
    height: 140px;
  }

  .product-card {
    display: flex;
    flex-direction: column;
  }

  .product-card-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }

  .product-card-body h3 {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .btn-product-more {
    margin-top: auto;
  }

  .product-desc,
  .product-stock {
    display: none;
  }

  .btn-product-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    background-color: #C4301A;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
  }

  .btn-product-more:hover {
    background-color: #A32816;
  }

  .btn-product-more svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
  }

  /* About */
  .about-layout {
    gap: var(--space-xl);
  }

  .about-video {
    aspect-ratio: 16/10;
  }

  .about-logo-row {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .about-logo img {
    height: 40px;
  }

  .about-divider {
    display: none;
  }

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

  .about-text p {
    font-size: var(--text-sm);
  }

  /* Features Bar */
  .features-bar {
    display: none;
  }

  /* Export */
  .export-grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 var(--container-padding);
  }

  .export-grid-wrap::-webkit-scrollbar {
    display: none;
  }

  .export-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: max-content;
  }

  .export-item {
    width: 280px;
    flex-shrink: 0;
  }

  .export-dots {
    margin-top: var(--space-md);
  }

  /* Visit */
  .visit-layout {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding: 0 var(--container-padding);
  }

  .visit-main-img {
    aspect-ratio: 16/10;
    border-radius: var(--radius-md);
  }

  .visit-left {
    gap: var(--space-sm);
  }

  .visit-left-text h3 {
    font-size: var(--text-base);
    margin-bottom: 6px;
  }

  .visit-left-text p {
    font-size: var(--text-sm);
  }

  .visit-list {
    gap: var(--space-lg);
  }

  .visit-list-item {
    grid-template-columns: 100px 1fr;
    gap: var(--space-sm);
    background: transparent;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    align-items: start;
  }

  .visit-list-item:hover {
    transform: none;
    box-shadow: none;
  }

  .visit-list-img {
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
  }

  .visit-list-text h4 {
    font-size: var(--text-base);
    margin-bottom: 4px;
    line-height: 1.3;
  }

  .visit-list-text p {
    font-size: var(--text-sm);
  }

  /* Video */
  .video-slider {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 12px;
    padding: 0 var(--container-padding);
  }

  .video-slider::-webkit-scrollbar {
    display: none;
  }

  .video-slide {
    flex: 0 0 85%;
    scroll-snap-align: start;
  }

  /* Group Photo */
  .group-photo-slider {
    grid-template-columns: repeat(2, 1fr);
  }

  /* News */
  .news-slider {
    grid-template-columns: repeat(2, 1fr);
    gap:10px;
  }

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

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

  /* Process */
  .process-steps {
    flex-wrap: wrap;
    gap: 16px;
  }

  .process-arrow {
    display: none;
  }

  .process-step {
    max-width: 140px;
  }

  .process-step-icon {
    width: 80px;
    height: 80px;
    padding: 16px;
  }

  /* Quotation */
  .quotation-section {
    padding: 40px 0;
    background: #F5F5F5;
  }

  .quotation-layout {
    grid-template-columns: 1fr;
    margin: 0;
    max-width: 100%;
  }

  .quotation-form-section {
    box-shadow: none;
  }

  .quotation-form-wrapper {
    grid-template-columns: 1fr;
    padding: var(--space-lg) var(--space-md);
    gap: var(--space-lg);
  }

  .quotation-left h2 {
    font-size: var(--text-2xl);
  }

  .quotation-left h2 br {
    display: none;
  }

  .quotation-image-section {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-socials {
    justify-content: center;
    margin-top: var(--space-xl);
  }

  .footer-bar .container {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }



  /* Floating Contact Bar - Mobile Bottom */
  .floating-contact {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    flex-direction: row;
    justify-content: space-around;
    background-color: #C4301A;
    border-radius: 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    width: 100%;
  }

  /* Prevent floating contact from covering footer bar */
  .footer-bar {
    padding-bottom: calc(12px + 60px);
  }

  .floating-item {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: 8px 4px;
    min-width: auto;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.2);
    color: #fff;
  }

  .floating-item:last-child {
    border-bottom: none;
    border-right: none;
  }

  .floating-item:hover {
    background-color: transparent;
  }

  .floating-item img {
    width: 20px;
    height: 20px;
    margin-bottom: 0;
    filter: brightness(0) invert(1);
  }

  .floating-item svg {
    width: 20px;
    height: 20px;
    margin-bottom: 0;
    color: #fff;
  }

  .floating-item span {
    font-size: 10px;
    color: #fff;
  }

}

/* Mobile: < 768px */
@media (max-width: 767px) {
  .news-date {
    margin-right: 12px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    justify-items: center;
  }

  .footer-info {
    text-align: left;
    align-items: flex-start;
    width: 100%;
    max-width: 340px;
  }

  .footer-info .footer-brand-logo {
    justify-content: flex-start;
  }

  .footer-info .footer-address {
    margin-left: 0;
    margin-right: 0;
  }

  .footer-columns-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 340px;
  }

  .footer-column-pc {
    display: none;
  }

  .footer-column-mobile {
    display: block;
  }

  .footer-column-subtitle {
    margin-top: var(--space-lg);
  }

  .footer-columns-row .footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-columns-row .footer-column h4 {
    font-size: 16px;
    text-align: left;
    width: 100%;
  }

  .footer-columns-row .footer-column ul {
    text-align: left;
    width: 100%;
  }

  .footer-columns-row .footer-column ul li {
    margin-bottom: 8px;
  }

  .footer-columns-row .footer-column ul li a {
    font-size: 13px;
  }

  /* Footer Bar */
  .footer-bar {
    padding: 12px 16px calc(12px + 60px);
  }

  .footer-bar .container {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .footer-bar p {
    font-size: 12px;
  }

  .footer-bar-links a,
  .footer-bar-links span {
    font-size: 12px;
  }

   .footer-column.footer-column-pc {
        display: none;
   }

}

/* Small Mobile: < 480px */
@media (max-width: 479px) {
  /* Product card button - prevent text wrapping */
  .btn-product-more {
    font-size: 10px;
    padding: 8px 2px;
    white-space: nowrap;
    gap: 2px;
  }

  .btn-product-more svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
  }

  .product-card-body h3 {
    font-size: 12px;
  }

  /* News card adaptations for small screens */
  .news-card-body p {
    display: none;
  }

  .news-card-body {
    padding: 8px;
  }

  .news-meta {
    flex-wrap: nowrap;
    gap: 4px;
    margin-bottom: 6px;
  }

  .news-tag {
    font-size: 10px;
    padding: 2px 4px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .news-date {
    font-size: 10px;
    white-space: nowrap;
  }

  .news-card-body h3 {
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.3;
  }

  .btn-news-more {
    padding: 8px 12px;
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
  }

  .btn-news-more svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
  }
  .hero {
    min-height: auto;
    padding-bottom: 0;
  }

  .news-meta {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .news-tag {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .hero-content {
    padding: 140px var(--container-padding) 32px;
  }

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

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

  .hero-text .btn {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .btn-hero {
    padding: 10px 20px;
    font-size: var(--text-sm);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .category-card,
  .category-card:nth-child(odd),
  .category-card:nth-child(even) {
    padding: 8px 4px;
    border-radius: 4px !important;
    min-height: 160px;
    height: 160px;
    background: linear-gradient(180deg, #E5E5E5 0%, #F8F8F8 100%) !important;
  }

  .category-card:hover,
  .category-card:nth-child(odd):hover,
  .category-card:nth-child(even):hover {
    background: linear-gradient(180deg, #D5D5D5 0%, #E8E8E8 100%) !important;
  }

  .category-card img {
    width: 70px;
    height: 70px;
  }

  .category-card-title {
    font-size: var(--text-xs);
  }

  .group-photo-slider {
    grid-template-columns: 1fr;
  }

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

  .features-bar {
    height: auto;
    padding: var(--space-lg) 0;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .feature-item {
    padding: var(--space-md) 0;
  }

  .export-grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 var(--container-padding);
  }

  .export-grid-wrap::-webkit-scrollbar {
    display: none;
  }

  .export-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: max-content;
  }

  .export-item {
    width: 260px;
    flex-shrink: 0;
  }
}
