/* Mobile-first responsive styles */
@media (max-width: 991px) {
  /* Mobile header styling - SSS style */
  #site_header.navbar-static-top {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 5px 0; /* Further reduced padding */
    position: relative;
    z-index: 1000;
    transition: all 0.3s ease;
  }
  
  /* Sticky header for mobile scrolling */
  #site_header.navbar-static-top.mobile-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    padding: 3px 0; /* Minimal sticky padding */
  }
  
  /* Adjust logo size when sticky */
  #site_header.navbar-static-top.mobile-sticky .site-logo img {
    max-height: 55px; /* Increased sticky logo size */
    transition: all 0.3s ease;
  }
  
  /* Adjust hamburger when sticky */
  #site_header.navbar-static-top.mobile-sticky .mobile-menu-toggle {
    width: 30px;
    height: 30px;
    transition: all 0.3s ease;
  }
  
  /* Add body padding to prevent content jump */
  body.mobile-header-sticky {
    padding-top: 60px; /* Reduced body padding */
  }
  
  /* Remove all space above content */
  #content {
    margin-top: -15px; /* Remove space above content */
  }
  
  /* Mobile header layout - Logo left, menu right */
  .navbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  
  /* Logo styling - Left side */
  .site-logo {
    flex: 0 0 auto;
    margin: 0;
  }
  
  .site-logo img {
    max-height: 70px; /* Increased mobile logo size */
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
  }
  
  /* Hamburger menu styling - Right side */
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    position: relative;
    z-index: 1001;
  }
  
  .hamburger-line {
    width: 28px;
    height: 3px;
    background-color: #333;
    margin: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .hamburger-line:nth-child(1) {
    top: 6px;
  }
  
  .hamburger-line:nth-child(2) {
    top: 50%;
    transform: translate(-50%, -50%);
  }
  
  .hamburger-line:nth-child(3) {
    bottom: 6px;
  }
  
  .mobile-menu-toggle:hover .hamburger-line {
    background-color: #ed1c24;
  }
  
  /* Animate hamburger to X when active */
  .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
  }
  
  .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    bottom: 50%;
    transform: translate(-50%, 50%) rotate(-45deg);
  }
  
  /* Hide desktop menu on mobile */
  .header-menu {
    display: none;
  }
  
  /* Mobile menu styling - SSS style */
  .sidenav {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 9999;
    top: 0;
    right: 0;
    background-color: #fff;
    overflow-x: hidden;
    overflow-y: auto;
    transition: 0.4s ease;
    padding-top: 80px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  }
  
  .mobile-nav {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0 20px;
  }
  
  .mobile-nav li {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .mobile-nav a {
    padding: 18px 0;
    display: block;
    min-height: 48px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .mobile-nav a:hover {
    color: #ed1c24;
    padding-left: 10px;
  }
  
  .closebtn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 30px;
    background: none;
    border: none;
    padding: 0;
    min-width: 40px;
    min-height: 40px;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
    font-weight: bold;
  }
  
  .closebtn:hover {
    color: #ed1c24;
    transform: rotate(90deg);
  }
  
  /* General mobile adjustments */
  img {
    max-width: 100%;
    height: auto;
  }
  
  input, textarea, select, button {
    min-height: 48px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* Enhanced form mobile responsiveness */
  .wpcf7-form-control,
  .form-control {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    padding: 12px 15px;
    font-size: 16px;
    transition: border-color 0.3s ease;
  }
  
  .wpcf7-form-control:focus,
  .form-control:focus {
    border-color: #ed1c24;
    outline: none;
    box-shadow: 0 0 0 2px rgba(237, 28, 36, 0.2);
  }
  
  .wpcf7-submit,
  .btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
  }
  
  /* Product cards mobile optimization */
  .product-item,
  .card {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
  }
  
  .product-item:hover,
  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  }
  
  /* Table mobile responsiveness */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Video embeds mobile */
  iframe,
  embed,
  object,
  video {
    max-width: 100%;
    height: auto;
  }
  
  /* Social sharing mobile */
  .social-icons a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    margin: 5px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #333;
    transition: all 0.3s ease;
  }
  
  .social-icons a:hover {
    background: #ed1c24;
    color: #fff;
    transform: translateY(-2px);
  }
  
  /* Mobile Slider Styling - SSS style */
  .homeband {
    position: relative;
    margin-top: -10px; /* Remove space above slider */
    margin-bottom: 0;
  }
  
  .homeband .flexslider {
    margin: -5px 0; /* Remove all slider margins */
    border: none;
    background: transparent;
    box-shadow: none;
  }
  
  .homeband .slides {
    margin: 0;
    padding: 0;
  }
  
  .homeband .slides li {
    position: relative;
    height: 300px;
    overflow: hidden;
    margin: 0; /* Remove slide margin */
  }
  
  .homeband .slides li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
  
  .homeband .slide-caption {
    position: absolute;
    bottom: 30px;
    left: 20px;
    right: 20px;
    text-align: center;
    z-index: 10;
  }
  
  .homeband .slide-caption h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin: 0;
    padding: 0;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  
  /* Flexslider pagination dots - SSS style */
  .homeband .flexslider .flex-control-nav {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    margin: 0;
    padding: 0;
    display: flex !important;
    gap: 8px;
  }
  
  .homeband .flexslider .flex-control-nav li {
    margin: 0;
    list-style: none;
  }
  
  .homeband .flexslider .flex-control-nav li a {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: 2px solid #fff;
    text-indent: -9999px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .homeband .flexslider .flex-control-nav li a.flex-active {
    background: #fff;
    transform: scale(1.2);
  }
  
  .homeband .flexslider .flex-control-nav li a:hover {
    background: rgba(255,255,255,0.8);
  }
  
  /* Hide flexslider arrows on mobile */
  .homeband .flexslider .flex-direction-nav {
    display: none;
  }
  
  /* Container adjustments */
  .container {
    padding: 0 5px; /* Minimal container padding */
  }
  
  /* Responsive typography */
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }
  h4 { font-size: 18px; }
  h5 { font-size: 16px; }
  h6 { font-size: 14px; }
}

/* View More Button Styles */
.view-more-btn {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 25px auto 0;
    padding: 15px 20px;
    background-color: #2c7c4a;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.view-more-btn:hover {
    background-color: #1e5a35;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.view-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view-more-btn.loading {
    background-color: #1e5a35;
    cursor: wait;
}

.view-more-btn i {
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.view-more-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.all-products-loaded {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 14px;
}

.all-products-loaded i {
    color: #2c7c4a;
    margin-right: 8px;
}

/* Mobile View More Button */
.view-more-btn {
    display: block !important;
    width: 100% !important;
    max-width: 280px !important;
    margin: 20px auto !important;
    padding: 15px 20px !important;
    background-color: #2c7c4a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-align: center !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
    position: relative !important;
    z-index: 100 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.view-more-btn:active,
.view-more-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(44, 124, 74, 0.3) !important;
    transform: translateY(1px) !important;
}

/* Ensure button is visible on mobile devices */
@media (hover: none) and (pointer: coarse) {
    .view-more-btn {
        min-height: 44px !important;
        min-width: 44px !important;
        font-size: 16px !important;
        padding: 12px 24px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
    }
    
    .view-more-btn i {
        margin-right: 8px;
    }
}

/* Fix for iOS devices */
@supports (-webkit-touch-callout: none) {
    .view-more-btn {
        padding: 16px 20px !important;
    }
}

/* Ensure button is visible when body has mobile class */
body.is-mobile-device .view-more-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 991px) {
  /* Tablet-specific adjustments */
  .container {
    padding: 0 20px;
  }
  
  h1 { font-size: 32px; }
  h2 { font-size: 28px; }
  h3 { font-size: 24px; }
  h4 { font-size: 20px; }
  
  /* Logo adjustments for tablet */
  .site-logo img {
    max-height: 50px;
    width: auto;
  }
  
  .navbar-header {
    justify-content: flex-start;
    align-items: center;
  }
  
  .site-logo {
    margin-right: 20px;
  }
  
  /* Fixed header adjustments for tablet */
  .navbar-static-top.fixed .site-logo img {
    max-height: 40px !important;
    width: auto !important;
  }
  
  .navbar-static-top.fixed .navbar-header {
    padding: 8px 0;
  }
}

/* Product Page Mobile Responsive Styles */

@media (max-width: 767px) {
    /* Category Filter Mobile */
    .category-filter-section {
        margin-bottom: 20px;
    }
    
    .category-filter-wrapper {
        padding: 15px;
        border-radius: 6px;
    }
    
    .filter-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .category-filter-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .category-filter-tabs li a {
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 20px;
        text-align: center;
        min-height: 48px;
    }
    
    .category-filter-tabs li.active a {
        background: #2874f0;
        color: #fff;
    }
    
    /* Products Grid Mobile */
    .products-display-section {
        margin-top: 20px;
    }
    
    .product-grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-item {
        flex-direction: column;
        padding: 15px;
        border-radius: 8px;
    }
    
    .product-image {
        height: 200px;
        margin-bottom: 15px;
    }
    
    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .product-content h3 {
        font-size: 16px;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    .product-content p {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 15px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .view-product-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 20px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    /* Category Filter Extra Small Mobile */
    .category-filter-wrapper {
        padding: 12px;
        margin: 0 10px;
    }
    
    .filter-title {
        font-size: 14px;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .category-filter-tabs {
        gap: 6px;
    }
    
    .category-filter-tabs li a {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
    }
    
    /* Products Grid Extra Small Mobile */
    .product-grid-container {
        gap: 12px;
    }
    
    .product-item {
        padding: 12px;
    }
    
    .product-image {
        height: 180px;
        margin-bottom: 12px;
    }
    
    .product-content h3 {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .product-content p {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .view-product-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Touch Optimizations */
    .category-filter-tabs li a:active {
        transform: scale(0.95);
    }
    
    .product-item:active {
        transform: scale(0.98);
    }
    
    /* Contact Form Mobile */
    .writeus .col-lg-10 {
        padding: 0 15px;
    }
    
    .writeus h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .writeus .formcontact {
        padding: 0;
    }
    
    .writeus .wpcf7-form-control {
        font-size: 14px;
        padding: 12px;
        border-radius: 6px;
    }
    
    .writeus .wpcf7-submit {
        width: 100%;
        padding: 14px;
        font-size: 14px;
        border-radius: 20px;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    /* Ultra Small Mobile */
    .category-filter-section {
        margin-bottom: 15px;
    }
    
    .category-filter-wrapper {
        padding: 10px;
        margin: 0 5px;
    }
    
    .filter-title {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .category-filter-tabs {
        gap: 5px;
    }
    
    .category-filter-tabs li a {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 40px;
    }
    
    .product-grid-container {
        gap: 10px;
    }
    
    .product-item {
        padding: 10px;
    }
    
    .product-image {
        height: 160px;
        margin-bottom: 10px;
    }
    
    .product-content h3 {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .product-content p {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .view-product-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .writeus h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .writeus .wpcf7-form-control {
        font-size: 13px;
        padding: 10px;
    }
    
    .writeus .wpcf7-submit {
        padding: 12px;
        font-size: 13px;
    }
}

/* Small mobile styles */
@media (max-width: 767px) {
    /* Stack columns */
    .col-md-6, .col-md-4, .col-md-3, .col-md-8, .col-md-12 {
        width: 100% !important;
        margin-bottom: 20px;
    }
  
    /* Button adjustments */
    .btn {
        width: 100%;
        margin-bottom: 10px;
        padding: 12px 20px;
    }
  
    /* Form adjustments */
    .form-group {
        margin-bottom: 20px;
    }
  
    /* Card adjustments */
    .card, .product-card {
        margin-bottom: 20px;
    }
}

/* Extra small mobile styles */
@media (max-width: 480px) {
  .container {
    padding: 0 3px; /* Ultra minimal container padding */
  }
  
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }
  
  /* Logo adjustments for small mobile */
  .site-logo img {
    max-height: 55px; /* Increased logo size for small screens */
    width: auto;
    padding: 5px 25px;
  }
  
  /* Header adjustments for small mobile */
  .navbar-header {
    justify-content: space-between;
    width: 100%;
    padding: 5px 0;
  }
  
  .site-logo {
    flex: 0 0 auto;
  }
  
  .mobile-menu-toggle {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    right: 20px;
  }
  
  /* Fixed header adjustments for small mobile */
  .navbar-static-top.mobile-sticky .site-logo img {
    max-height: 45px !important;
    width: auto !important;
  }
  
  .navbar-static-top.mobile-sticky .mobile-menu-toggle {
    width: 25px;
    height: 25px;
  }
  
  /* Spacing adjustments */
  .section {
    padding: 15px 0; /* Minimal section spacing */
  }
  
  /* Enhanced mobile touch targets */
  .btn, button, input[type="submit"], input[type="button"] {
    min-height: 50px;
    padding: 15px 20px;
    font-size: 16px;
    margin-bottom: 15px;
  }
  
  /* Mobile grid adjustments */
  .row {
    margin: 0 -5px;
  }
  
  [class*="col-"] {
    padding: 0 5px 10px;
  }
  
  /* Mobile text adjustments */
  .text-center-mobile {
    text-align: center !important;
  }
  
  .hide-mobile {
    display: none !important;
  }
  
  .show-mobile {
    display: block !important;
  }
  
  /* Mobile pagination */
  .pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
  }
  
  .pagination a,
  .pagination span {
    display: inline-block;
    min-width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 2px;
    font-size: 14px;
  }
  
  /* Mobile breadcrumbs */
  .breadcrumb {
    font-size: 12px;
    padding: 10px 0;
    margin-bottom: 15px;
  }
  
  .breadcrumb li {
    margin-bottom: 5px;
  }
  
  /* Mobile search */
  .search-form {
    margin-bottom: 20px;
  }
  
  .search-form input[type="search"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
  }
  
  /* Mobile comments */
  .comment-list {
    padding: 0;
  }
  
  .comment-body {
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 5px;
  }
  
  .comment-reply-link {
    display: inline-block;
    padding: 8px 15px;
    background: #ed1c24;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
  }
  
  .comment-reply-link:hover {
    background: #c80000;
    color: #fff;
  }
}

/* Desktop styles */
@media (min-width: 992px) {
  /* Hide mobile menu toggle on desktop */
  .mobile-menu-toggle {
    display: none;
  }
  
  /* Show desktop menu */
  .header-menu {
    display: block;
  }
  
  /* Hide mobile menu */
  .sidenav {
    display: none;
  }
  
  /* Desktop utility classes */
  .hide-desktop {
    display: none !important;
  }
  
  .show-desktop {
    display: block !important;
  }
}

/* Utility classes for responsive development */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (max-width: 991px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .product-item:hover,
  .card:hover {
    transform: none;
  }
  
  /* Increase touch targets */
  a, button, input, select, textarea {
    min-height: 48px;
  }
  
  /* Better spacing for mobile */
  .section, .container-fluid > .row {
    padding: 10px 0; /* Reduced section spacing */
    margin-top: -10px; /* Remove space above sections */
  }
}

/* High DPI displays optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .site-logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Landscape mobile optimizations */
@media (max-width: 991px) and (orientation: landscape) {
  .navbar-static-top.mobile-sticky {
    padding: 5px 0;
  }
  
  .navbar-static-top.mobile-sticky .site-logo img {
    max-height: 40px;
  }
  
  body.mobile-header-sticky {
    padding-top: 70px;
  }
}

/* Print styles for mobile */
@media print {
  .mobile-menu-toggle,
  .sidenav,
  .scroll-to-top {
    display: none !important;
  }
  
  .site-header {
    position: static !important;
  }
  
  body {
    padding-top: 0 !important;
  }
}
