/* Mobile Fixes v1.0.48 - Formula wrap + Note placement */

/* ===================================
   TASK 1: Fix Formula Horizontal Scroll
   =================================== */
@media (max-width: 768px) {
  /* Remove horizontal scroll, allow wrapping */
  .formula-box {
    overflow-x: hidden !important;
  }
  
  .formula-box code {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
    display: block !important;
  }
}

/* ===================================
   TASK 2: Note Placement + Alignment
   =================================== */
/* Note styling - all devices */
.table-note,
.heat-scale-section .table-note {
  text-align: left !important;
  line-height: 1.5 !important;
  padding: var(--spacing-md) !important;
  background: #fef3c7 !important;
  border-left: 4px solid var(--color-primary) !important;
  border-radius: 8px !important;
  margin: var(--spacing-md) 0 !important;
}

/* Mobile: move note below pepper cards */
@media (max-width: 768px) {
  .heat-scale-section .table-card,
  .heat-scale-section .card {
    display: flex;
    flex-direction: column;
  }
  
  /* Table first */
  .heat-scale-section .table-responsive {
    order: 1;
  }
  
  /* Pepper cards second */
  .gc-pepper-cards {
    order: 2;
  }
  
  /* Note last */
  .table-note {
    order: 999 !important;
    margin-top: var(--spacing-lg) !important;
  }
}

/* ===================================
   ORIGINAL FIXES FROM v1.0.47
   =================================== */

/* TASK 1: Remove Formula Grey Sidebar (EN + HU) */
@media (max-width: 768px) {
  .formula-box {
    border-left: none !important;
    border: 1px solid var(--color-border, #e5e7eb) !important;
    background: var(--color-bg, #fff) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  }
}

/* TASK 3: Footer Logo Egg Fix */
.footer-logo {
  height: auto !important;
  width: 160px !important;
  max-width: 160px !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
}

@media (max-width: 768px) {
  .footer-logo {
    width: 120px !important;
    max-width: 120px !important;
  }
}

@media (max-width: 480px) {
  .footer-logo {
    width: 100px !important;
    max-width: 100px !important;
  }
}

/* TASK 5: HU Products Centering */
@media (max-width: 768px) {
  /* Only apply to HU page */
  body.lang-hu #hu-products .product-card,
  body.lang-hu .products-section .product-card {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  body.lang-hu #hu-products .product-image,
  body.lang-hu .products-section .product-image {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  body.lang-hu #hu-products .product-title,
  body.lang-hu .products-section .product-title {
    text-align: center !important;
  }
  
  body.lang-hu #hu-products .btn,
  body.lang-hu #hu-products .cta-button,
  body.lang-hu .products-section .btn,
  body.lang-hu .products-section .cta-button {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    width: fit-content !important;
  }
}
