/* ============================================
   RESPONSIVE CSS
   An Phát Hardware B2B Theme
   ============================================ */

/* --- Max 1280px --- */
@media (max-width: 1280px) {
    .hero__title {
        font-size: var(--fs-4xl);
    }

    .footer__grid {
        grid-template-columns: 1.5fr 1fr 1fr;
    }

    .footer__col:last-child {
        grid-column: 1 / -1;
    }

    .product-detail {
        gap: var(--space-8);
    }

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

/* --- Max 1024px (Tablet Landscape) --- */
@media (max-width: 1024px) {
    .hero {
        height: 500px;
    }

    .hero__title {
        font-size: var(--fs-3xl);
    }

    .hero__desc {
        font-size: var(--fs-base);
    }

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

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

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

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

    .header__hotline {
        display: none;
    }

    .header__hamburger {
        display: flex;
    }

    .header__nav {
        display: none;
    }

    .mobile-menu {
        display: block;
    }

    .nav-menu {
        display: none;
    }

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

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

    .content-layout__sidebar {
        order: -1;
    }

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

    .products-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

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

    .product-detail {
        grid-template-columns: 1fr;
    }

    .product-gallery {
        position: static;
    }

    .cta-banner__inner {
        flex-direction: column;
        text-align: center;
    }

    .cta-banner__actions {
        flex-direction: row;
    }
}

/* --- Max 768px (Tablet Portrait) --- */
@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

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

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

    .section-header__title {
        font-size: var(--fs-2xl);
    }

    .hero {
        height: 450px;
    }

    .hero__title {
        font-size: var(--fs-2xl);
    }

    .hero__badge {
        font-size: var(--fs-xs);
        margin-bottom: var(--space-4);
    }

    .hero__desc {
        font-size: var(--fs-sm);
        margin-bottom: var(--space-6);
    }

    .hero__actions {
        flex-direction: column;
        gap: var(--space-3);
    }

    .hero__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero__nav-btn {
        width: 40px;
        height: 40px;
    }

    .hero__nav-btn--prev { left: 12px; }
    .hero__nav-btn--next { right: 12px; }

    .stats__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .stats__item {
        padding: var(--space-6) var(--space-4);
    }

    .stats__number {
        font-size: var(--fs-3xl);
    }

    .stats__intro {
        margin-bottom: var(--space-8);
    }

    .product-cats__grid {
        grid-template-columns: 1fr;
    }

    .product-cat-card {
        padding: var(--space-4);
    }

    .grid--4,
    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .why-us__card {
        padding: var(--space-5);
    }

    .cta-banner {
        padding: var(--space-10) 0;
    }

    .cta-banner__title {
        font-size: var(--fs-2xl);
    }

    .cta-banner__actions {
        flex-direction: column;
        width: 100%;
    }

    .cta-banner__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .partners__logo {
        width: 150px;
    }

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

    .footer__top {
        padding: var(--space-10) 0 var(--space-6);
    }

    .footer__bottom-inner {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }

    .topbar {
        display: none;
    }

    .products-sidebar {
        grid-template-columns: 1fr;
    }

    .products-header {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start;
    }

    .related-products__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .product-info__title {
        font-size: var(--fs-2xl);
    }

    .page-header {
        padding: var(--space-8) 0;
    }

    .page-header__title {
        font-size: var(--fs-2xl);
    }

    /* Forms */
    .form-row {
        flex-direction: column;
    }

    /* Testimonial Slider */
    .testimonial-slide {
        flex: 0 0 calc(50% - var(--space-4) / 2);
    }

    .testimonial-slider__btn {
        width: 36px;
        height: 36px;
    }

    .testimonial-slider__btn--prev {
        left: -18px;
    }

    .testimonial-slider__btn--next {
        right: -18px;
    }

    .testimonial-card {
        padding: var(--space-5);
    }

    /* About Partners Grid */
    .about-partners__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
}

/* --- Max 480px (Mobile) --- */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-4);
    }

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

    .hero {
        height: 400px;
    }

    .hero__title {
        font-size: var(--fs-xl);
    }

    .hero__content {
        text-align: center;
    }

    h1 { font-size: var(--fs-2xl); }
    h2 { font-size: var(--fs-xl); }
    h3 { font-size: var(--fs-lg); }

    .section-header__title {
        font-size: var(--fs-xl);
    }

    .section-header__title::after {
        margin: var(--space-3) auto 0;
    }

    .stats__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .stats__item {
        padding: var(--space-4) var(--space-3);
    }

    .stats__number {
        font-size: var(--fs-2xl);
    }

    .stats__icon {
        width: 48px;
        height: 48px;
    }

    .stats__icon svg {
        width: 24px;
        height: 24px;
    }

    .grid--4,
    .grid--3,
    .grid--2 {
        grid-template-columns: 1fr;
    }

    .featured-products__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .product-cat-card {
        flex-direction: column;
        text-align: center;
    }

    .product-cat-card__footer {
        justify-content: center;
    }

    .why-us__card {
        padding: var(--space-4);
    }

    .why-us__icon {
        width: 56px;
        height: 56px;
    }

    .btn--xl {
        padding: var(--space-3) var(--space-6);
        font-size: var(--fs-sm);
    }

    .btn--lg {
        padding: var(--space-3) var(--space-5);
        font-size: var(--fs-sm);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .card__body {
        padding: var(--space-3);
    }

    .card__title {
        font-size: var(--fs-sm);
    }

    .card__footer {
        padding: var(--space-3);
        flex-direction: column;
        gap: var(--space-2);
    }

    .product-card__specs {
        display: none;
    }

    .product-card__code {
        font-size: 10px;
    }

    .floating-buttons {
        bottom: 16px;
        right: 16px;
    }

    .floating-btn {
        width: 46px;
        height: 46px;
    }

    .floating-btn__label {
        display: none;
    }

    .header__cta {
        display: none;
    }

    .logo__brand {
        font-size: var(--fs-lg);
    }

    .partners__logo {
        width: 130px;
    }

    .partners__logo-inner {
        height: 60px;
    }

    .mobile-menu {
        width: 100%;
        right: -100%;
    }

    .page-header__title {
        font-size: var(--fs-xl);
    }

    .page-header__desc {
        font-size: var(--fs-sm);
    }

    /* Testimonial Slider */
    .testimonial-slide {
        flex: 0 0 100%;
        margin-right: var(--space-4);
    }

    .testimonial-slider__btn {
        display: none;
    }

    .testimonial-card {
        padding: var(--space-4);
    }

    /* About Partners Grid */
    .about-partners__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .about-partner-card {
        padding: var(--space-3);
    }

    .about-partner-card__logo {
        height: 56px;
    }

    .about-partner-card__logo img {
        max-width: 120px;
        max-height: 48px;
    }
}

/* --- Print Styles --- */
@media print {
    .topbar,
    .header,
    .floating-buttons,
    .mobile-menu,
    .overlay,
    .footer__social,
    .cta-banner {
        display: none !important;
    }

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

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

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

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