/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Desktop: 1200px and above */
@media screen and (max-width: 1200px) {
    .nav-list {
        gap: 20px;
    }
}

/* Tablet: 992px - 1199px */
@media screen and (max-width: 992px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-tools-container {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 50px 20px 30px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 1001;
        overflow-y: auto;
    }

    .nav-tools-container.mobile-open {
        right: 0;
    }

    .main-nav {
        margin-right: 0;
        margin-bottom: 30px;
        width: 100%;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .nav-item {
        border-bottom: 1px solid #eee;
    }

    .nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
        font-size: 1.6rem;
        width: 100%;
    }

    .has-dropdown .nav-link {
        cursor: pointer;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        display: none;
        background: rgba(0, 147, 0, 0.02);
        margin-top: 5px;
        margin-bottom: 10px;
    }

    .dropdown-open .dropdown-menu {
        display: block;
    }

    .dropdown-open .dropdown-icon {
        transform: rotate(180deg);
    }

    .dropdown-link {
        padding: 12px 20px;
        border-top: 1px solid #eee;
        font-size: 1.4rem;
    }

    .header-tools {
        width: 100%;
        justify-content: center;
        border-top: 1px solid #eee;
        padding-top: 20px;
    }

    .site-main {
        margin-top: 70px;
    }

    .menu-open {
        overflow: hidden;
    }

    .menu-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.75);
        z-index: 990;
    }
    
    /* Product adjustments */
    .product-header {
        flex-direction: column;
    }

    .product-gallery,
    .product-info {
        padding: 0;
        margin-bottom: 30px;
    }

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

    .nav-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .nav-buttons .am-btn {
        width: 100%;
    }
}

/* Small Tablet: 768px - 991px */
@media screen and (max-width: 768px) {
    /* General adjustments */
    .am-btn {
        padding: 0.8em 1.2em !important;
        font-size: 13px;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .am-btn:hover {
        transform: translateY(-1px);
    }

    .site-header,
    .site-header.header-scrolled {
        padding: 5px 10px;
    }
    
    /* Logo */
    .logo-img {
        height: 40px;
    }

    .header-scrolled .logo-img {
        height: 35px;
    }

    /* Main content */
    .site-main {
        margin-top: 65px;
    }
    
    /* Banner */
    .inner-banner {
        height: 30vh !important;
    }
    
    /* Article content */
    .article-content {
        padding: 20px;
    }
    
    /* Sidebar navigation */
    .navside {
        padding: 15px 0;
        margin: 0;
        scroll-snap-type: x mandatory; /* Enable scroll snapping */
        scroll-padding: 0 50%; /* Center active item */
        scroll-behavior: smooth; /* Smooth scrolling */
    }
    
    .navside-container {
        justify-content: flex-start;
        padding: 0 50%; /* Space for centering */
        gap: 8px;
        position: relative;
    }
    
    .navside-link {
        padding: 8px 16px;
        font-size: 1.3rem;
        scroll-snap-align: center; /* Center on click */
    }
    
    .navside-link.active {
        padding: 8px 16px;
    }
    
    /* Section spacing */
    .section-title {
        margin-bottom: 15px;
    }
    
    .solutions-section {
        padding: 30px 0;
    }
    
    .solution-slider {
        padding: 0px 15px 0;
    }
    
    .solution-card {
        display: block;
    }
    
    .product-categories-section {
        padding: 30px 0;
    }
    
    /* Banner adjustments */
    .banner-section {
        height: 350px;
    }

    .banner-content {
        justify-content: center;
        text-align: center;
        align-items: end;
        padding-bottom: 30px;
    }
    
    /* Article detail */
    .article-detail {
        padding: 25px;
    }

    .article-title {
        font-size: 28px;
        text-align: left;
    }

    .article-meta {
        justify-content: flex-start;
        gap: 15px;
        font-size: 14px;
    }

    .content-body {
        font-size: 15px;
    }

    .content-body h2 {
        font-size: 24px;
    }

    .content-body h3 {
        font-size: 20px;
    }

    /* Navigation buttons */
    .nav-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-buttons .am-btn {
        width: 100%;
        margin-bottom: 15px;
    }

    .nav-buttons .am-btn:first-child,
    .nav-buttons .am-btn:last-child {
        margin-left: 0;
        margin-right: 0;
    }

    /* Table adjustments */
    .content-body table {
        font-size: 14px;
    }

    .content-body table th,
    .content-body table td {
        padding: 10px 15px;
    }

    /* Layout adjustments */
    .sidebar,
    .main-content {
        width: 100%;
        padding: 0;
    }

    .sidebar {
        margin-bottom: 30px;
        padding-right: 0;
    }

    .main-content {
        padding-left: 0;
    }

    /* Category grid */
    .category-item {
        width: 50%;
    }

    /* Product tabs */
    .products-tab-link {
        margin: 5px;
        padding: 12px 20px;
        font-size: 14px;
    }

    /* News grid */
    .featured-news,
    .news-list {
        width: 100%;
    }

    /* About us image */
    .about-image {
        position: relative;
        height: 300px;
        top: 0;
        width: 100%;
        margin-top: 30px;
    }

    /* Form fields */
    .form-field {
        width: 100%;
    }

    /* Pagination */
    .am-pagination a,
    .am-pagination span {
        padding: 8px 15px;
        font-size: 14px;
    }

    /* Timeline */
    .timeline-card {
        flex-wrap: wrap;
        gap: 15px;
    }

    .timeline-date {
        min-width: 70px;
        padding: 15px;
    }

    .date-day {
        font-size: 24px;
    }

    .date-month-year {
        font-size: 13px;
    }

    .timeline-action {
        width: 100%;
        text-align: center;
    }

    .timeline-action .am-btn {
        width: 100%;
    }

    /* Search results page */
    .search-banner {
        height: 30vh;
        background-attachment: scroll;
    }

    .search-title {
        font-size: 28px;
    }

    .search-header {
        margin-bottom: 30px;
    }

    /* No results */
    .no-results {
        padding: 40px 20px;
    }

    .no-results-title {
        font-size: 24px;
    }

    .no-results-suggestions {
        text-align: center;
    }

    /* Contact card */
    .contact-banner {
        min-height: 70vh;
        background-attachment: scroll;
    }

    .contact-card {
        padding: 30px;
        width: 95%;
        margin: 20px;
    }

    .contact-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .info-item {
        padding: 12px 15px;
        gap: 15px;
    }

    .info-item i {
        font-size: 20px;
        width: 30px;
    }

    .info-item span {
        font-size: 16px;
    }

    /* Footer */
    .footer-section {
        width: 50%;
    }

    /* Fixed buttons */
    .fixed-side-buttons {
        right: 15px;
        bottom: 15px;
    }

    .fixed-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .footer-title {
        font-size: 16px;
    }

    .qrcode {
        width: 120px;
        height: 120px;
    }
    
    .product-detail-section {
        padding: 0px 0;
    }
    
    /* Product detail */
    .product-detail {
        padding: 15px;
    }

    .product-title {
        font-size: 28px;
    }

    .product-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .price-value {
        font-size: 20px;
    }

    .product-header {
        flex-direction: column;
        padding: 15px;
    }

    .product-gallery,
    .product-info {
        width: 100%;
    }
    
    /* Video adjustments */
    .play-button svg {
        width: 50px;
        height: 50px;
    }
    
    .video-label {
        font-size: 12px;
    }
    
    .video-player-modal .am-modal-dialog {
        width: 95%;
        margin: 10px auto;
    }
    
    .video-player-modal .am-modal-hd {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* Ensure desktop navside shows correctly */
    @media screen and (min-width: 769px) {
        .navside {
            overflow: hidden;
        }
        
        .navside:hover {
            overflow-x: auto;
        }
        
        .navside-container {
            justify-content: center;
            flex-wrap: wrap;
        }
    }
}

/* Mobile: 480px - 767px */
@media screen and (max-width: 480px) {
    .nav-tools-container {
        width: 280px;
    }
 
    .logo-img {
        height: 35px;
    }

    .header-scrolled .logo-img {
        height: 30px;
    }

    .site-main {
        margin-top: 50px;
    }
    
    /* Further adjustments */
    .article-detail {
        padding: 20px;
    }

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

    .article-meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    /* Grid items */
    .footer-section,
    .result-item,
    .article-item,
    .category-item,
    .product-item {
        width: 100%;
    }

    /* Search results title */
    .search-title {
        font-size: 24px;
    }

    .result-content {
        padding: 20px;
    }

    .result-title {
        font-size: 16px;
    }

    .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Fixed buttons */
    .fixed-side-buttons {
        gap: 10px;
        right: 10px;
        bottom: 10px;
    }

    .fixed-button {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    /* Contact card */
    .contact-card {
        padding: 20px;
    }

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

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px;
    }

    .info-item i {
        width: auto;
    }

    /* Timeline card */
    .timeline-card {
        padding: 20px;
        gap: 15px;
    }

    .timeline-content {
        order: 2;
        width: 100%;
    }

    .timeline-date {
        order: 1;
    }

    .timeline-action {
        order: 3;
    }

    .timeline-title {
        font-size: 16px;
    }

    .timeline-description {
        font-size: 13px;
    }

    /* Category article */
    .category-article {
        padding: 20px;
    }

    .article-title {
        font-size: 24px;
    }
    
    /* Product detail */
    .product-title {
        font-size: 2.2rem;
    }

    .price-value {
        font-size: 2rem;
    }

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

    .features-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .article-content {
        padding: 20px;
    }

    .video-container iframe {
        min-height: 250px;
    }

    .product-excerpt {
        padding: 15px;
    }
}

/* ============================================
   IE11 COMPATIBILITY FALLBACKS
   ============================================ */
@media all and (-ms-high-contrast: none),
       (-ms-high-contrast: active) {
    /* Remove glass effects */
    .am-btn {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .am-btn::before {
        display: none;
    }

    /* Solid color fallbacks */
    .am-btn-primary {
        background-color: #009300;
        border-color: #009300;
    }

    .am-btn-warning {
        background-color: #ff9900;
        border-color: #ff9900;
    }

    .am-btn-danger {
        background-color: #dc3545;
        border-color: #dc3545;
    }

    .am-btn-default {
        background-color: #fff;
        border-color: #e0e0e0;
    }

    .am-btn-border {
        background-color: transparent;
        border-color: #009300;
    }

    .am-btn-white {
        background-color: #fff;
        border-color: #fff;
    }

    /* Fixed header */
    .head.am-topbar-fixed-top {
        background: #fff;
        position: fixed;
        top: 0;
        width: 100%;
    }

    /* Fixed buttons */
    .fixed-button {
        background: #009300;
    }

    .whatsapp-button {
        background: #25D366;
    }

    .top-button {
        background: #666;
    }

    /* Tab links */
    .products-tab-link {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    .products-tab-link::before {
        display: none;
    }

    .products-tab-link {
        background-color: #fff;
        border-color: #e0e0e0;
    }

    .products-tab-link.active {
        background-color: #009300;
        border-color: #009300;
        box-shadow: 0 4px 15px rgba(0, 147, 0, 0.3);
    }

    .products-tab-link.active:hover {
        background-color: #00b400;
        border-color: #00b400;
        box-shadow: 0 6px 20px rgba(0, 180, 0, 0.4);
    }

    /* Swiper buttons */
    .swiper-button-next,
    .swiper-button-prev {
        background-color: #009300;
        backdrop-filter: none;
    }

    .swiper-button-next:hover,
    .swiper-button-prev:hover {
        background-color: #de6800;
        transform: none;
    }

    /* Timeline date */
    .timeline-date {
        backdrop-filter: none;
    }

    /* Contact card */
    .contact-banner {
        background-attachment: scroll;
    }

    .contact-card {
        background: #009300;
        border: 1px solid #007a00;
    }

    .contact-overlay {
        background: rgba(0, 0, 0, 0.6);
    }

    .info-item {
        background: rgba(0, 0, 0, 0.2);
        border-left: 4px solid rgba(255, 255, 255, 0.3);
    }

    /* Article meta */
    .article-meta {
        display: block;
    }

    .meta-item {
        display: inline-block;
        margin-right: 25px;
        margin-bottom: 10px;
    }

    /* Navigation buttons */
    .nav-buttons {
        display: block;
    }

    .nav-buttons .am-btn {
        display: inline-block;
        margin-bottom: 15px;
        width: 48%;
    }

    .nav-buttons .am-btn:first-child {
        margin-right: 4%;
    }

    /* Timeline */
    .timeline-card {
        display: block;
    }

    .timeline-date,
    .timeline-content,
    .timeline-action {
        display: block;
        margin-bottom: 15px;
    }

    .timeline-date {
        float: left;
        margin-right: 20px;
        margin-bottom: 0;
    }

    .timeline-action .am-btn {
        width: auto;
    }

    .timeline-meta {
        display: block;
    }

    .meta-category,
    .meta-time {
        display: inline-block;
        margin-right: 15px;
        margin-bottom: 5px;
    }

    /* Article meta */
    .article-meta {
        display: block;
    }

    .article-date,
    .article-views {
        display: inline-block;
        margin-right: 15px;
    }

    /* Pagination */
    .am-pagination ul {
        display: block;
    }

    .am-pagination li {
        display: inline-block;
        margin: 0 5px;
    }

    /* Search results grid */
    .results-grid {
        display: block;
    }

    .result-item {
        display: inline-block;
        vertical-align: top;
        width: 48%;
        margin-right: 2%;
        margin-bottom: 20px;
    }

    .result-item:nth-child(2n) {
        margin-right: 0;
    }

    .result-meta {
        display: block;
    }

    .result-date,
    .result-category {
        display: inline-block;
        margin-right: 15px;
        margin-bottom: 10px;
    }

    .no-results-suggestions {
        text-align: center;
    }

    .no-results-suggestions ul {
        display: inline-block;
        text-align: left;
    }

    /* Product price */
    .product-price {
        display: block;
    }

    .price-label,
    .price-value {
        display: block;
        margin-bottom: 5px;
    }

    /* Layout fallbacks */
    .articles-grid,
    .results-grid,
    .category-grid,
    .products-grid,
    .news-grid,
    .footer-content,
    .nav-buttons,
    .article-meta,
    .timeline-meta,
    .result-meta,
    .am-pagination ul {
        display: block;
    }

    .article-item,
    .result-item,
    .category-item,
    .footer-section,
    .nav-buttons .am-btn,
    .meta-item,
    .am-pagination li {
        display: inline-block;
        vertical-align: top;
        margin-right: 2%;
        margin-bottom: 20px;
    }

    .article-item:nth-child(2n),
    .result-item:nth-child(2n),
    .category-item:nth-child(2n),
    .footer-section:nth-child(2n),
    .am-pagination li:nth-child(2n) {
        margin-right: 0;
    }

    /* Image ratio container */
    .ratio-4-3 {
        height: 0;
    }

    .ratio-4-3 > img {
        object-fit: none;
        min-width: 100%;
        min-height: 100%;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}