/* 4K and Ultra-wide Screens */
@media (min-width: 1600px) {
    /* .container {
        max-width: 1500px;
        margin: 0 auto;
    } */

    .heading-title h2 {
        font-size: 32px;
    }

    .product-category,
    .news-index,
    .why-choice-us,
    .partner,
    .product-hot {
        padding: 80px 0;
    }
}

/* Ultra Large Devices (Extra Large Desktop) */
@media (max-width: 1599px) {
    /* .container {
        max-width: 1320px;
        margin: 0 auto;
    } */
}

/* XXL Devices (Large Desktop) */
@media (max-width: 1440px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Extra Large Devices (Small Desktop) */
@media (max-width: 1199px) {
    .container {
        max-width: 1115px;
        margin: 0 auto;
        padding-left: 16px;
        padding-right: 16px;
    }

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

/* Large Devices (Tablets) */
@media (max-width: 991px) {
    .flex-footer {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .menu {
        display: flex;
        flex-wrap: wrap;
    }

    .title-main {
        font-size: 24px;
    }

    .menu {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

}

/* Medium Devices (Tablets) */
@media (max-width: 767px) {
    .menu {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

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

    .heading-title h2 {
        font-size: 24px;
    }
}

/* Small Devices (Phones) */
@media (max-width: 575px) {
    .mobile-header {
        display: flex;
    }

    .heading-title h2::before,
    .heading-title h2::after {
        display: none;
    }

    .heading-title h2 {
        font-size: 20px;
    }

    .flex-header-top {
        flex-direction: column;
        gap: 8px;
    }

    .flex-header-top-left {
        flex-direction: column;
        gap: 6px;
    }

    .menu {
        display: none;
    }

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

    .product-category,
    .news-index,
    .why-choice-us,
    .partner,
    .product-hot {
        padding: 32px 1rem;
    }
}

/* Extra Small Devices */
@media (max-width: 374px) {
    .heading-title h2 {
        font-size: 18px;
    }

    .product-category,
    .news-index,
    .why-choice-us,
    .partner,
    .product-hot {
        padding: 24px 0;
    }
}

/* ================================
       HAMBURGER MENU BUTTON
       ================================ */

/* Base hamburger button */
.hamburger-button {
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Hamburger bars */
.hamburger-bar {
    position: absolute;
    width: 1.5rem;
    height: 2px;
    background-color: white;
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Bar positions */
.hamburger-bar-top {
    top: 4px;
}

.hamburger-bar-middle {
    top: 12px;
}

.hamburger-bar-bottom {
    top: 20px;
}

/* Active/Open state */
.hamburger-button.open .hamburger-bar-top {
    transform: rotate(45deg);
    top: 12px;
}

.hamburger-button.open .hamburger-bar-middle {
    opacity: 0;
    transform: scale(0);
}

.hamburger-button.open .hamburger-bar-bottom {
    transform: rotate(-45deg);
    top: 12px;
}

/* Loading state (optional) */
.hamburger-button.loading .hamburger-bar {
    animation: hamburgerPulse 1.5s ease-in-out infinite;
}

.hamburger-button.loading .hamburger-bar-top {
    animation-delay: 0s;
}

.hamburger-button.loading .hamburger-bar-middle {
    animation-delay: 0.2s;
}

.hamburger-button.loading .hamburger-bar-bottom {
    animation-delay: 0.4s;
}

@keyframes hamburgerPulse {

    0%,
    100% {
        opacity: 1;
        transform: scaleX(1);
    }

    50% {
        opacity: 0.6;
        transform: scaleX(0.8);
    }
}

/* Focus states for accessibility */
.hamburger-button:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

.hamburger-button:focus:not(:focus-visible) {
    outline: none;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .hamburger-button {
        width: 1.25rem;
        height: 1.25rem;
        padding: 0.5rem;
    }

    .hamburger-bar {
        width: 1.5rem;
    }

    .hamburger-bar-top {
        top: 3px;
    }

    .hamburger-bar-middle {
        top: 10px;
    }

    .hamburger-bar-bottom {
        top: 17px;
    }

    .hamburger-button.open .hamburger-bar-top,
    .hamburger-button.open .hamburger-bar-bottom {
        top: 10px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .hamburger-bar {
        background-color: white;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .hamburger-button {
        border: 1px solid white;
    }

    .hamburger-bar {
        background-color: white;
        height: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .hamburger-button,
    .hamburger-bar {
        transition: none;
    }

    .hamburger-button.loading .hamburger-bar {
        animation: none;
    }
}

/* Components */
.circle-btn {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #5eead4;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.circle-btn.open {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
}

.circle-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 72rem;
    height: 72rem;
    border-radius: 50%;
    background: linear-gradient(to bottom right, #014999, #002980);
    z-index: 1;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    transition: all 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.circle-bg.active {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1;
    pointer-events: auto;
}

.circle-border {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(229, 231, 235, 0.3);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity;
}

.circle-border.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.circle-inner {
    top: 50%;
    left: 50%;
}

/* Utilities */
.animate-scale-in {
    animation: scaleCircleMenu 0.7s ease-in-out forwards;
}

.animate-scale-out {
    animation: unScaleCircleMenu 0.1s ease-in-out forwards;
}

@keyframes scaleCircleMenu {
    to {
        transform: translate(-50%, -50%) scale(1) !important;
        opacity: 1;
    }
}

@keyframes unScaleCircleMenu {
    0% {
        transform: translate(-50%, -50%) scale(1) !important;
        opacity: 1;
    }

    70% {
        transform: translate(-50%, -50%) scale(0.3) !important;
        opacity: 0.7;
    }

    100% {
        transform: translate(-50%, -50%) scale(0) !important;
        opacity: 0;
    }
}

/* Thêm animation cho border ripple effect */
@keyframes borderRipple {
    0% {
        transform: translate(-50%, -50%) scale(0) !important;
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1) !important;
        opacity: 1;
    }
}

.circle-border.show {
    animation: borderRipple 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Animation cho border khi fade out */
@keyframes borderFadeOut {
    0% {
        transform: translate(-50%, -50%) scale(1) !important;
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.7) !important;
        opacity: 0;
    }
}

.circle-border:not(.show) {
    animation: borderFadeOut 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Custom CSS cho iOS */
.webkit-details-marker-none::-webkit-details-marker {
    display: none;
}

details[open] .details-open\:rotate-90 {
    transform: rotate(90deg);
}

/* Tối ưu cho touch trên iOS */
@supports (-webkit-touch-callout: none) {
    details summary {
        -webkit-tap-highlight-color: transparent;
    }

    a,
    summary {
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
    }
}

/* Mobile Menu Layout */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: none;
    overflow: hidden;
    /* Hardware acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 1;
    transition: opacity 0.4s ease-out, backdrop-filter 0.4s ease-out;
}

.mobile-menu-overlay.fade-out {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.mobile-menu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 2rem;
    position: relative;
    z-index: 30;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-in, transform 0.4s ease-in;
}

.mobile-menu-header {
    padding: 1rem;
    position: relative;
    z-index: 30;
}

.mobile-logo img {
    max-height: 40px;
    width: auto;
}

.mobile-menu-close {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.mobile-menu-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Navigation Styles */
.mobile-nav {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    min-height: 0;
    padding: 0.75rem 1.5rem;
    z-index: 20;
}

.mobile-nav-grid {
    gap: 0.75rem;
    max-width: 56rem;
}

@media (min-width: 768px) {
    .mobile-nav-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* Menu Items */
.mobile-menu-item {
    position: relative;
    text-align: left;
    padding: 0.25rem 0;
    max-width: 140px;
}

.mobile-menu-item summary {
    color: white;
    font-size: 1.25rem;
    transition: opacity 0.2s;
    outline: none;
    cursor: pointer;
    list-style: none;
}

@media (min-width: 640px) {
    .mobile-menu-item summary {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .mobile-menu-item summary {
        font-size: 1.875rem;
    }
}

.mobile-menu-item summary:focus {
    outline: none;
    box-shadow: none;
}

.mobile-menu-item summary::-webkit-details-marker {
    display: none;
}

.mobile-menu-item .menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Menu Icons */
.menu-icon {
    width: 0.625rem;
    height: 0.625rem;
    margin-left: 0.5rem;
    transition: transform 0.2s;
}

.menu-icon.rtl {
    transform: rotate(180deg);
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-top: 0;
    margin-left: 0.5rem;
    min-width: 180px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.dropdown-menu.scrollable {
    max-height: 16rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    font-weight: 500;
    display: block;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-menu a:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-menu li:first-child a {
    border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-menu li:last-child a {
    border-radius: 0 0 0.5rem 0.5rem;
    border-bottom: none;
}

/* Single Menu Items */
.single-menu-item {
    position: relative;
    text-align: left;
    padding: 0.25rem 0;
    max-width: 140px;
}

.single-menu-item a {
    color: white;
    font-size: 1.25rem;
    transition: opacity 0.2s;
    outline: none;
    text-decoration: none;
}

@media (min-width: 640px) {
    .single-menu-item a {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .single-menu-item a {
        font-size: 1.875rem;
    }
}

.single-menu-item a:focus {
    outline: none;
    box-shadow: none;
}

.single-menu-item a:active {
    opacity: 0.6;
}

/* Custom scrollbar */
.custom-scroll-thumb::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll-thumb::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.custom-scroll-thumb::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.custom-scroll-thumb::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}