/* mobile-fix.css - Complete responsive fixes for all device sizes */

/* Reset for expanded section visibility */
.more-products-wrapper,
.more-webinars-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    width: 100%;
    transition: max-height 0.5s ease, opacity 0.3s ease;
}

.more-products-wrapper.active,
.more-webinars-wrapper.active {
    max-height: 7000px;
    opacity: 1;
    display: block;
}

/* Ensure book grid displays correctly */
.bestseller-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    margin-bottom: 20px;
}

/* Book item base styling */
.bestseller-grid .book,
.webinar-content .webinar-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    height: 100%;
}

.bestseller-grid .book:hover,
.webinar-content .webinar-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/* Toggle button styling */
#toggle-products,
#toggle-webinars,
#toggle-ebooks {
    display: block;
    margin: 20px auto;
    min-width: 200px;
}

/* MEDIA QUERIES */

/* Large Desktop (7 items per row) */
@media (min-width: 1441px) {
    .bestseller-grid .book,
    .webinar-content .webinar-item {
        flex: 0 0 calc(14.28% - 15px);
        max-width: calc(14.28% - 15px);
    }
}

/* Desktop (5 items per row) */
@media (min-width: 1025px) and (max-width: 1440px) {
    .bestseller-grid .book,
    .webinar-content .webinar-item {
        flex: 0 0 calc(20% - 15px);
        max-width: calc(20% - 15px);
    }
}

/* Small Desktop / Large Tablet (4 items per row) */
@media (min-width: 769px) and (max-width: 1024px) {
    .bestseller-grid .book,
    .webinar-content .webinar-item {
        flex: 0 0 calc(25% - 15px);
        max-width: calc(25% - 15px);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .sidebar-nav {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        width: 280px;
    }
    
    .sidebar-nav.active {
        transform: translateX(0);
    }
    
    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1002;
        padding: 12px;
        background: #3c2f2a;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 18px;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
    
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        backdrop-filter: blur(3px);
    }
    
    .overlay.active {
        display: block;
    }
    
    .hero {
        padding: 80px 20px;
    }
    
    .hero h2 {
        font-size: 2.2rem;
    }
}

/* Tablet (3 items per row) */
@media (min-width: 481px) and (max-width: 768px) {
    .bestseller-grid .book,
    .webinar-content .webinar-item {
        flex: 0 0 calc(33.33% - 15px);
        max-width: calc(33.33% - 15px);
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .sidebar-nav {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        width: 280px;
    }
    
    .sidebar-nav.active {
        transform: translateX(0);
    }
    
    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1002;
        padding: 10px;
        background: #3c2f2a;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
    
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        backdrop-filter: blur(3px);
    }
    
    .overlay.active {
        display: block;
    }
    
    .bestseller-grid,
    .webinar-content {
        gap: 15px;
        padding: 0 10px;
    }
    
    .bestseller-grid .book p,
    .webinar-content .webinar-item p {
        font-size: 0.95rem;
        margin: 8px 0;
        line-height: 1.3;
    }
    
    .bestseller-grid .book small,
    .webinar-content .webinar-item small {
        font-size: 0.85rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: 3.9em;
    }
    
    .hero {
        padding: 60px 15px;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    .author-profile {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .author-profile img {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile (2 items per row) */
@media (min-width: 361px) and (max-width: 480px) {
    .bestseller-grid .book,
    .webinar-content .webinar-item {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .bestseller-grid,
    .webinar-content {
        gap: 10px;
        padding: 0 5px;
    }
    
    .bestseller-grid .book img,
    .webinar-content .webinar-item img {
        max-height: 160px;
        width: auto;
        margin: 0 auto 10px;
    }
    
    .bestseller-grid .book p,
    .webinar-content .webinar-item p {
        font-size: 0.9rem;
        margin: 5px 0;
    }
    
    .bestseller-grid .book small,
    .webinar-content .webinar-item small {
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: 2.6em;
    }
    
    .cta-button {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .bestseller-grid .book .cta-button,
    .webinar-content .webinar-item .cta-button {
        padding: 8px;
        font-size: 0.85rem;
    }
    
    .main-content {
        margin-left: 0;
        padding: 10px;
    }
    
    .hero {
        padding: 40px 10px;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.9rem;
        padding: 0 10px;
    }
    
    section h2 {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }
    
    section p {
        font-size: 0.9rem;
        padding: 0 5px;
        margin-bottom: 15px;
    }
}

/* Small Mobile (1 item per row) */
@media (max-width: 360px) {
    .bestseller-grid .book,
    .webinar-content .webinar-item {
        flex: 0 0 100%;
        max-width: 100%;
        margin: 0 0 15px;
        padding: 12px;
    }
    
    .bestseller-grid .book img,
    .webinar-content .webinar-item img {
        max-width: 140px;
        margin: 0 auto 10px;
    }
    
    .bestseller-grid .book small,
    .webinar-content .webinar-item small {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
        height: 2.6em;
    }
    
    .price-block {
        margin: 5px 0;
    }
    
    .bestseller-grid .book .cta-button,
    .webinar-content .webinar-item .cta-button {
        padding: 8px;
        font-size: 0.8rem;
    }
}

/* Improved Card Styling */
@media (max-width: 768px) {
    .bestseller-grid .book,
    .webinar-content .webinar-item {
      margin-bottom: 20px !important;
      height: auto !important;
      padding: 15px !important;
    }
    
    /* Better image handling */
    .bestseller-grid .book img, 
    .webinar-content .webinar-item img {
      max-height: 180px !important;
      width: auto !important;
      object-fit: contain !important;
      margin: 0 auto 12px !important;
    }
    
    /* Improved text truncation */
    .bestseller-grid .book small,
    .webinar-content .webinar-item small {
      display: -webkit-box !important;
      -webkit-line-clamp: 3 !important;
      -webkit-box-orient: vertical !important;
      overflow: hidden !important;
      height: 4.5em !important;
      margin-bottom: 10px !important;
      line-height: 1.5 !important;
    }
    
    /* Better button styling */
    .bestseller-grid .book .cta-button,
    .webinar-content .webinar-item .cta-button {
      width: 100% !important;
      padding: 10px 15px !important;
      margin-top: auto !important;
    }
    
    /* Section spacing */
    .bestseller, .webinare, .kundenmeinungen {
      padding: 40px 15px !important;
    }
    
    /* Background consistency */
    .kundenmeinungen, .bestseller, .webinare, .ebooks {
      background: #fff9f2 !important;
    }

    /* Hide deals on mobile and tablet */
    .deals-container,
    #deals-script,
    .deals-wrapper {
        display: none !important;
    }

    /* Hide deals and exit popup on mobile and tablet */
    .deals-container,
    #deals-script,
    .deals-wrapper,
    .deals-popup,
    .exit-popup,
    #exitPopup {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
  }
  
  /* Small screens further refinements */
  @media (max-width: 480px) {
    .bestseller-grid {
      gap: 15px !important;
    }
    
    .bestseller-grid .book,
    .webinar-content .webinar-item {
      flex: 0 0 calc(100% - 30px) !important;
      max-width: calc(100% - 30px) !important;
      margin: 0 auto 15px !important;
    }
  }

  /* Mobile Navigation Improvements */
@media (max-width: 768px) {
    /* Sidebar navigation fixes */
    .sidebar-nav {
      width: 80% !important;
      max-width: 280px !important;
      height: 100% !important;
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      background: #3c2f2a !important;
      color: #fff !important;
      z-index: 1001 !important;
      padding: 25px 20px !important;
      overflow-y: auto !important;
      transform: translateX(-100%) !important;
      transition: transform 0.3s ease !important;
      box-shadow: 2px 0 10px rgba(0,0,0,0.2) !important;
    }
    
    .sidebar-nav.active {
      transform: translateX(0) !important;
      display: block !important;
    }
    
    /* Menu button improvements */
    .mobile-menu-btn {
      display: block !important;
      position: fixed !important;
      top: 15px !important;
      left: 15px !important;
      z-index: 1002 !important;
      padding: 10px 12px !important;
      background: #3c2f2a !important;
      color: #fff !important;
      border: none !important;
      border-radius: 6px !important;
      font-size: 18px !important;
      cursor: pointer !important;
      box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
    }
    
    /* Nav links improvements */
    .sidebar-nav ul {
      margin-top: 20px !important;
    }
    
    .sidebar-nav ul li {
      margin-bottom: 15px !important;
    }
    
    .sidebar-nav ul li a {
      display: block !important;
      padding: 10px 5px !important;
      color: #fff !important;
      font-size: 1.1rem !important;
      border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    }
    
    /* Ensure overlay works */
    .overlay {
      display: none !important;
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      background: rgba(0,0,0,0.5) !important;
      z-index: 1000 !important;
      backdrop-filter: blur(3px) !important;
    }
    
    .overlay.active {
      display: block !important;
    }
  }

  /* Fix for Author Profile Section */
@media (max-width: 768px) {
    .featured-author {
      padding: 30px 15px !important;
    }
    
    .author-profile {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      gap: 20px !important;
      text-align: center !important;
      padding: 10px !important;
    }
    
    .author-profile img {
      width: 100% !important;
      max-width: 220px !important;
      height: auto !important;
      margin: 0 auto 15px !important;
      border-radius: 12px !important;
    }
    
    .author-info {
      width: 100% !important;
      padding: 0 !important;
    }
    
    .author-info h3 {
      font-size: 1.8rem !important;
      margin-bottom: 15px !important;
      text-align: center !important;
    }
    
    .author-info p {
      text-align: center !important;
      font-size: 0.95rem !important;
      line-height: 1.6 !important;
      margin-bottom: 15px !important;
    }
    
    .author-info .cta-button {
      margin: 15px auto !important;
      display: block !important;
      max-width: 80% !important;
    }
  }

  /* Fix for horizontal scrolling and right-side whitespace */
@media (max-width: 768px) {
    html, body {
      overflow-x: hidden !important;
      width: 100% !important;
      position: relative !important;
    }
    
    .main-content {
      width: 100% !important;
      box-sizing: border-box !important;
      overflow-x: hidden !important;
    }
    
    /* Fix container widths */
    .container, 
    .hero, 
    .featured-author, 
    .bestseller, 
    .webinare, 
    .ebooks, 
    .kundenmeinungen, 
    .faq, 
    .new-arrivals {
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
      overflow-x: hidden !important;
      margin-left: 0 !important;
      margin-right: 0 !important;
    }
    
    /* Fix any possible absolute positioned elements */
    .site-footer {
      width: 100% !important;
      left: 0 !important;
    }
  }

  /* High-resolution display fixes */
@media (min-width: 1441px) {
    /* Fix grid alignment for 1440p displays */
    .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(7, 1fr) !important;
      gap: 20px !important;
      justify-content: center !important;
      width: 100% !important;
      max-width: 1800px !important;
      margin: 0 auto 30px !important;
      padding: 0 30px !important;
    }
    
    .bestseller-grid .book {
      flex: 0 0 100% !important;
      max-width: 100% !important;
      width: 100% !important;
      height: 100% !important;
      display: flex !important;
      flex-direction: column !important;
    }
    
    /* Webinar grid - use same approach for consistency */
    .webinare .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(7, 1fr) !important;
    }
    
    /* Better image handling for high-res */
    .bestseller-grid .book img {
      height: 230px !important;
      object-fit: contain !important;
      width: auto !important;
      max-width: 100% !important;
      margin: 0 auto 15px !important;
    }
  }
  
  /* Very large screens - maintain maximum width */
  @media (min-width: 2000px) {
    .bestseller-grid,
    .webinare .bestseller-grid {
      max-width: 1900px !important;
      margin-left: auto !important;
      margin-right: auto !important;
    }
    
    .main-content {
      max-width: 2000px !important;
      margin-left: auto !important;
      margin-right: auto !important;
      padding-left: 270px !important; /* Account for sidebar */
    }
  }

  @media (max-width: 768px) {
    /* Hide deals on mobile and tablet */
    .deals-container,
    #deals-script,
    .deals-wrapper {
        display: none !important;
    }
  }

  @media (max-width: 768px) {
    .chat-bot-button-text {
      display: none !important;
    }
  }

  /* Better cross-device compatibility fixes */

/* LAPTOP OPTIMIZATION (13-15" screens) */
@media (min-width: 1025px) and (max-width: 1440px) {
    /* Reduce from 7 to 4 products per row on regular laptops */
    .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(4, 1fr) !important;
      gap: 20px !important;
      padding: 0 20px !important;
      max-width: 1200px !important;
      margin: 0 auto 20px !important;
    }
    
    .bestseller-grid .book,
    .webinar-content .webinar-item {
      flex: none !important;
      max-width: none !important;
      width: 100% !important;
    }
    
    /* Standardize image heights */
    .bestseller-grid .book img {
      height: 200px !important;
      object-fit: contain !important;
      width: auto !important;
      max-width: 100% !important;
      margin: 0 auto 15px !important;
    }
  }
  
  /* ANDROID SPECIFIC FIXES - many Samsung devices are 360-412px wide */
  @media (min-width: 360px) and (max-width: 412px) {
    /* Use 1 product per row to prevent overflow on narrow Android devices */
    .bestseller-grid .book,
    .webinar-content .webinar-item {
      flex: 0 0 100% !important;
      max-width: 100% !important;
      margin: 0 auto 15px !important;
      padding: 15px !important;
    }
    
    /* Make content narrower to fit screen */
    .bestseller-grid,
    .webinar-content {
      width: 95% !important;
      margin: 0 auto !important;
      padding: 0 !important;
      gap: 10px !important;
    }
    
    /* Adjust font sizes for readability */
    .bestseller-grid .book p {
      font-size: 1rem !important;
      margin: 8px 0 !important;
    }
    
    .bestseller-grid .book small {
      font-size: 0.85rem !important;
      -webkit-line-clamp: 3 !important;
      line-height: 1.4 !important;
    }
    
    /* Ensure buttons fit properly */
    .bestseller-grid .book .cta-button {
      width: 100% !important;
      padding: 10px !important;
      font-size: 0.9rem !important;
    }
  }
  
  /* GENERAL CROSS-DEVICE OVERFLOW FIX */
  @media (max-width: 1440px) {
    /* Prevent overflow on all devices */
    .container,
    .bestseller,
    .webinare,
    .ebooks,
    .kundenmeinungen,
    .faq,
    .new-arrivals,
    .featured-author {
      width: 100% !important;
      max-width: 100% !important;
      overflow-x: hidden !important;
      padding-left: 10px !important;
      padding-right: 10px !important;
      box-sizing: border-box !important;
    }
    
    /* Force proper container sizing to prevent overflow */
    .main-content {
      width: 100% !important;
      overflow-x: hidden !important;
      box-sizing: border-box !important;
    }
    
    /* Ensure hero section doesn't overflow */
    .hero {
      width: 100% !important;
      box-sizing: border-box !important;
      overflow: hidden !important;
    }
  }
  
  /* HIGH RESOLUTION SCREENS (above 1440p) */
  @media (min-width: 1441px) and (max-width: 1920px) {
    /* Use 5 items per row instead of 7 for larger screens */
    .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(5, 1fr) !important;
      gap: 25px !important;
      max-width: 1600px !important;
      margin: 0 auto !important;
      padding: 0 30px !important;
    }
  }
  
  /* ROOT FIXES FOR ALL DEVICES */
  html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  /* Comprehensive cross-device fixes - add this to the end of your mobile-fix.css */

/* Fix for webinar section on laptops */
@media (min-width: 1025px) and (max-width: 1440px) {
    /* Make the webinar section match the bestseller grid layout */
    .webinare .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(4, 1fr) !important;
      gap: 20px !important;
      padding: 0 20px !important;
      max-width: 1200px !important;
      margin: 0 auto 20px !important;
    }
    
    /* Fix individual webinar items */
    .webinare .bestseller-grid .book {
      flex: none !important;
      width: 100% !important;
      max-width: none !important;
    }
  }
  
  /* Samsung phone right-shift fix - this is likely due to position or margin issues */
  @media (max-width: 480px) {
    /* Reset all margins and positioning */
    body, html, .main-content, .bestseller, .webinare, .ebooks, .kundenmeinungen, .faq, .new-arrivals {
      margin: 0 !important;
      left: 0 !important;
      right: 0 !important;
      width: 100% !important;
      max-width: 100vw !important;
      overflow-x: hidden !important;
      position: relative !important;
    }
    
    /* Hard reset for Samsung devices */
    body {
      position: absolute !important;
      left: 0 !important;
      top: 0 !important;
      width: 100% !important;
      box-sizing: border-box !important;
    }
    
    /* Fix content alignment */
    .main-content {
      padding: 10px !important;
      margin-left: 0 !important;
      box-sizing: border-box !important;
    }
    
    /* Fix for book items on narrow Android screens */
    .bestseller-grid .book,
    .webinar-content .webinar-item,
    .webinare .bestseller-grid .book {
      flex: 0 0 100% !important;
      max-width: 100% !important;
      margin: 0 auto 15px !important;
      width: 100% !important;
      box-sizing: border-box !important;
    }
    
    /* Fix content containers */
    .bestseller-grid,
    .webinare .bestseller-grid {
      padding: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
    }
  }
  
  /* Stronger reset for mobile browsers */
  @media (max-width: 768px) {
    /* Force viewport reset */
    html, body {
      width: 100% !important;
      max-width: 100% !important;
      overflow-x: hidden !important;
      position: relative !important;
      left: 0 !important;
      margin: 0 !important;
      padding: 0 !important;
    }
    
    /* Fix all containers */
    .container, section, .main-content, div {
      max-width: 100% !important;
      box-sizing: border-box !important;
    }
    
    /* Fix sidebar to ensure it doesn't cause layout issues */
    .sidebar-nav {
      position: fixed !important;
      width: 80% !important;
      max-width: 280px !important;
      left: -100% !important;
      transform: translateX(0) !important;
    }
    
    .sidebar-nav.active {
      left: 0 !important;
      transform: translateX(0) !important;
    }
  }
  
  /* Fix webinar section on all screens */
  .webinare .bestseller-grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 15px !important;
  }
  
  /* Ultra-specific Samsung fix */
  @media screen and (min-width: 360px) and (max-width: 412px) {
    body {
      width: 100vw !important;
      overflow-x: hidden !important;
      margin: 0 !important;
      padding: 0 !important;
      position: relative !important;
      left: 0 !important;
    }
    
    .main-content {
      width: 100% !important;
      margin: 0 !important;
      padding: 0 !important;
    }
  }

  /* Explicit fix for webinar section on laptops - add to end of mobile-fix.css */

  /* NUCLEAR OPTION TO FIX WEBINAR GRID - ADD TO THE VERY END OF mobile-fix.css */
@media (min-width: 1025px) and (max-width: 1440px) {
    #webinare .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(4, 1fr) !important;
      flex-wrap: unset !important;
    }
    
    #webinare .bestseller-grid .book {
      flex: unset !important;
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
    }
    
    #webinare .more-webinars-wrapper.active .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(4, 1fr) !important;
      flex-wrap: unset !important;
    }
    
    #webinare .more-webinars-wrapper.active .bestseller-grid .book {
      flex: unset !important;
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
    }
    
    /* This removes all flex-based styling for webinar grid */
    .webinare .bestseller-grid,
    .webinare .container .bestseller-grid,
    section.webinare .bestseller-grid,
    #webinare .bestseller-grid {
      justify-content: unset !important;
      align-items: unset !important;
    }
  }

  /* Fix for 1920x1080 laptops - Add this to the end of your mobile-fix.css file */
@media (min-width: 1441px) and (max-width: 1920px) {
    #webinare .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(4, 1fr) !important;
      gap: 20px !important;
    }
    
    #webinare .bestseller-grid .book {
      flex: unset !important;
      width: 100% !important;
      max-width: 100% !important;
    }
    
    #webinare .more-webinars-wrapper.active .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(4, 1fr) !important;
    }
  }

  /* COMPREHENSIVE FIX FOR MULTIPLE ISSUES - ADD TO END OF mobile-fix.css */

/* Fix for 1920x1080 laptops - webinar grid */
@media (min-width: 1441px) and (max-width: 1920px) {
    #webinare .bestseller-grid,
    section.webinare .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(4, 1fr) !important;
      gap: 20px !important;
    }
    
    #webinare .bestseller-grid .book,
    section.webinare .bestseller-grid .book {
      flex: unset !important;
      width: 100% !important;
      max-width: 100% !important;
    }
    
    #webinare .more-webinars-wrapper.active .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(4, 1fr) !important;
    }
  }
  
  /* Fix for 1000x1000 resolution book display */
  @media (min-width: 990px) and (max-width: 1100px) {
    /* Reduce books to 3 per row for this specific resolution */
    .bestseller-grid {
      display: grid !important;
      grid-template-columns: repeat(3, 1fr) !important;
      gap: 20px !important;
      max-width: 900px !important;
      margin: 0 auto !important;
      padding: 0 15px !important;
    }
    
    .bestseller-grid .book {
      flex: unset !important;
      width: 100% !important;
      max-width: 100% !important;
    }
    
    /* Ensure book items have proper spacing and layout */
    .bestseller-grid .book img {
      max-height: 180px !important;
      width: auto !important;
      max-width: 100% !important;
      object-fit: contain !important;
      margin: 0 auto 15px !important;
    }
  }
  
  /* Fix for half-shown hero button */
  .hero-content {
    position: relative !important;
    z-index: 2 !important;
    padding-bottom: 30px !important; /* Add more padding at bottom */
  }
  
  .hero-cta-wrapper {
    margin-top: 25px !important;
    margin-bottom: 15px !important;
    position: relative !important;
    width: 100% !important;
    text-align: center !important;
  }
  
  .hero-cta-wrapper .cta-button {
    display: inline-block !important;
    position: relative !important;
    z-index: 5 !important;
    margin: 0 auto !important;
  }
  
  @media (max-width: 1100px) {
    .hero {
      padding-bottom: 80px !important; /* Even more padding for smaller screens */
    }
    
    .hero-content {
      padding-bottom: 40px !important;
    }
  }
  
  /* Fix for responsive issues on 1000x1000 */
  @media (width: 1000px) {
    .main-content {
      padding: 15px !important;
      box-sizing: border-box !important;
    }
    
    /* Ensure proper container widths */
    .container, 
    .hero, 
    .bestseller, 
    .webinare, 
    .ebooks {
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
      overflow-x: hidden !important;
    }
    
    /* Override the grid settings for this resolution */
    .bestseller-grid,
    #webinare .bestseller-grid,
    .webinare .bestseller-grid,
    #webinare .container .bestseller-grid {
      grid-template-columns: repeat(3, 1fr) !important;
      gap: 15px !important;
    }
  }
  
  /* Ensure hero button is always fully visible */
  .hero .cta-button,
  #toggle-products,
  #toggle-webinars,
  #toggle-ebooks {
    position: relative !important;
    z-index: 10 !important;
    margin-bottom: 20px !important;
  }
  
  /* Ensure proper display of "Angebot entdecken" button in hero */
  .container a[href="#bestseller"],
  .hero-content a.cta-button {
    display: inline-block !important;
    margin: 20px auto !important;
    position: relative !important;
    z-index: 10 !important;
  }
  
  /* Force visibility of critical elements */
  #bestseller, #webinare, #ebooks {
    position: relative !important;
    overflow: visible !important;
  }
  
  /* Make sure bestseller grid doesn't cause horizontal scroll */
  .bestseller-grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Mobile navigation button overlap fix - Add to end of mobile-fix.css */

/* Fix for mobile menu button overlapping title */
@media (max-width: 768px) {
    /* Adjust sidebar logo/title area */
    .sidebar-nav h1 {
      margin-left: 50px !important; /* Create space for the menu button */
      position: relative !important;
      z-index: 999 !important;
    }
    
    /* Move the menu button slightly */
    .mobile-menu-btn {
      top: 12px !important;
      left: 12px !important;
      padding: 8px 10px !important;
      font-size: 16px !important;
      z-index: 1003 !important; /* Ensure it's above other elements */
    }
    
    /* Add spacing to the top of sidebar when open */
    .sidebar-nav.active {
      padding-top: 60px !important;
    }
    
    /* Ensure sidebar nav items don't overlap */
    .sidebar-nav ul {
      margin-top: 15px !important;
      padding-left: 5px !important;
    }
  }
  
  /* For very small screens */
  @media (max-width: 360px) {
    .sidebar-nav h1 {
      font-size: 1.4rem !important;
      margin-left: 45px !important;
    }
    
    .mobile-menu-btn {
      padding: 6px 8px !important;
      font-size: 14px !important;
    }
  }
  
  /* When the mobile menu is open, ensure proper positioning */
  .mobile-menu-btn.active {
    position: fixed !important;
    left: auto !important;
    right: 15px !important; /* Move to right side when menu is open */
  }
  
  /* Ensure the main content doesn't overlap with the sidebar nav when open */
  .sidebar-nav.active + .main-content {
    margin-left: 0 !important;
  }

  /* Add this CSS to fix mobile expansion issues */

/* Increase max-height for expanded sections */
.more-products-wrapper.active,
.more-webinars-wrapper.active,
.more-ebooks-wrapper.active {
    max-height: 9999px !important; /* Much larger value to ensure full expansion */
    opacity: 1;
    display: block;
    transition: opacity 0.3s ease;
}

/* Fix for smaller screens to ensure proper expansion */
@media (max-width: 768px) {
    .more-products-wrapper,
    .more-webinars-wrapper,
    .more-ebooks-wrapper {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .more-products-wrapper.active,
    .more-webinars-wrapper.active,
    .more-ebooks-wrapper.active {
        max-height: none !important; /* Remove max-height constraint completely */
        overflow: visible !important; /* Ensure content isn't cut off */
        opacity: 1;
    }
}

/* Ensure all items in expanded sections are visible */
.more-products-wrapper.active .bestseller-grid,
.more-webinars-wrapper.active .bestseller-grid,
.more-ebooks-wrapper.active .bestseller-grid {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

/* Fix animation timing */
.more-products-wrapper,
.more-webinars-wrapper,
.more-ebooks-wrapper {
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease;
}

/* Specific fix for smaller laptops (1025px - 1100px) */
@media (min-width: 1025px) and (max-width: 1100px) {
  .bestseller-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    padding: 0 20px !important;
    margin: 0 auto !important;
  }
  .bestseller-grid .book,
  .webinar-content .webinar-item {
    width: 100% !important;
    flex: none !important;
    max-width: none !important;
  }
  .bestseller-grid .book img {
    height: 200px !important;
    object-fit: contain !important;
    margin: 0 auto 15px !important;
  }
}

/* Laptop Display Fix - Add this to the end of your mobile-fix.css file */

/* Force consistent grid layout across all sections for laptops */
@media (min-width: 1025px) and (max-width: 1440px) {

  /* Reset all previous grid settings for these screen sizes */
  .bestseller-grid,
  #bestseller .bestseller-grid,
  .webinare .bestseller-grid,
  #webinare .bestseller-grid,
  .ebooks .bestseller-grid,
  #ebooks .bestseller-grid,
  .more-products-wrapper .bestseller-grid,
  .more-webinars-wrapper .bestseller-grid,
  .more-ebooks-wrapper .bestseller-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    max-width: 1200px !important;
    margin: 0 auto 20px !important;
    padding: 0 20px !important;
    flex-wrap: unset !important;
    justify-content: unset !important;
  }

  /* Ensure all book items have consistent styling */
  .bestseller-grid .book,
  #bestseller .bestseller-grid .book,
  .webinare .bestseller-grid .book,
  #webinare .bestseller-grid .book,
  .ebooks .bestseller-grid .book,
  #ebooks .bestseller-grid .book,
  .more-products-wrapper .bestseller-grid .book,
  .more-webinars-wrapper .bestseller-grid .book,
  .more-ebooks-wrapper .bestseller-grid .book,
  .webinar-content .webinar-item {
    flex: unset !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: unset !important;
    margin: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  /* Fix image sizing */
  .bestseller-grid .book img,
  .webinar-content .webinar-item img {
    height: 180px !important;
    object-fit: contain !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 auto 15px !important;
  }

  /* Ensure text is properly displayed */
  .bestseller-grid .book p,
  .webinar-content .webinar-item p {
    font-size: 1rem !important;
    margin: 8px 0 !important;
    line-height: 1.4 !important;
  }

  .bestseller-grid .book small,
  .webinar-content .webinar-item small {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    height: 4em !important;
  }

  /* Fix button positioning */
  .bestseller-grid .book .cta-button,
  .webinar-content .webinar-item .cta-button {
    width: 100% !important;
    margin-top: auto !important;
    text-align: center !important;
  }

  /* Special fix for expanded sections */
  .more-products-wrapper.active,
  .more-webinars-wrapper.active,
  .more-ebooks-wrapper.active {
    max-height: none !important;
    overflow: visible !important;
  }

  .more-products-wrapper.active .bestseller-grid,
  .more-webinars-wrapper.active .bestseller-grid,
  .more-ebooks-wrapper.active .bestseller-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Fix for MacBook screen sizes (13-16 inch) */
@media (min-width: 1280px) and (max-width: 1440px) {

  /* Main content padding */
  .main-content {
    padding: 20px !important;
    margin-left: 260px !important;
    /* Account for sidebar */
    box-sizing: border-box !important;
    width: calc(100% - 260px) !important;
  }

  /* Ensure sidebar is visible and properly positioned */
  .sidebar-nav {
    width: 260px !important;
    transform: none !important;
    position: fixed !important;
    height: 100% !important;
    z-index: 999 !important;
    left: 0 !important;
  }

  /* Hide mobile menu elements */
  .mobile-menu-btn,
  .overlay {
    display: none !important;
  }
}

/* Fix for smaller MacBooks and other laptops */
@media (min-width: 1025px) and (max-width: 1279px) {

  /* Adjust main content and sidebar for smaller screens */
  .main-content {
    padding: 20px !important;
    margin-left: 0 !important;
    /* No space for fixed sidebar */
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Utilize the mobile menu on smaller laptops */
  .sidebar-nav {
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease !important;
    z-index: 1000 !important;
    width: 280px !important;
    position: fixed !important;
    height: 100% !important;
  }

  .sidebar-nav.active {
    transform: translateX(0) !important;
  }

  .mobile-menu-btn {
    display: block !important;
    position: fixed !important;
    top: 15px !important;
    left: 15px !important;
    z-index: 1002 !important;
  }

  .overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 999 !important;
  }

  .overlay.active {
    display: block !important;
  }
}

/* Fix for expanded sections in general */
.more-products-wrapper.active,
.more-webinars-wrapper.active,
.more-ebooks-wrapper.active {
  max-height: none !important;
  /* Remove height constraint completely */
  height: auto !important;
  overflow: visible !important;
  opacity: 1 !important;
  transition: opacity 0.3s ease !important;
}

/* Reset any float and flex conflicts */
.bestseller-grid {
  clear: both !important;
}

/* Ensure all expanded sections display properly */
#toggle-products,
#toggle-webinars,
#toggle-ebooks {
  position: relative !important;
  z-index: 5 !important;
  margin: 20px auto !important;
  display: block !important;
}
