/* ========== Responsive Layouts ========== */

/* Large desktops */
@media (max-width: 1200px) {
  .container {
    padding-inline: 20px;
  }
  .navbar-brand img {
    height: 45px;
  }
}

/* Tablets and small laptops */
@media (max-width: 992px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  [dir="rtl"] .navbar {
    align-items: flex-end;
  }

  .navbar-toggler {
    margin-inline-start: auto;
  }

  .navbar-collapse {
    width: 100%;
  }

  .navbar-nav {
    width: 100%;
    padding: 0.5rem 1rem;
  }

  .navbar-nav .nav-item,
  .navbar-nav .nav-link {
    width: 100%;
  }

  .navbar-nav .nav-link {
    display: block;
    padding: 0.5rem 1rem;
    text-align: start;
  }

  [dir="rtl"] .navbar-nav .nav-link {
    text-align: end;
  }

  .dropdown-menu {
    position: static !important;
    float: none;
    background-color: var(--color-primary);
    box-shadow: none;
    margin: 0;
    border-radius: 0;
    width: 100%;
    display: none;
  }

  .dropdown-menu.show {
    display: block !important;
  }

  .dropdown-submenu > .dropdown-menu {
    position: static !important;
    display: none;
    width: 100%;
    background-color: var(--color-primary);
  }

  /* Removed hover behavior for mobile submenus */
  /* .dropdown-submenu:hover > .dropdown-menu {
    display: block;
  } */

  .dropdown-item {
    width: 100%;
    color: white;
    padding: 0.5rem 1rem;
    text-align: start;
  }

  [dir="rtl"] .dropdown-item {
    text-align: end;
  }

  .card {
    margin-bottom: 1.5rem;
  }

  .btn {
    width: 100%;
  }

  .navbar-brand img {
    height: 40px;
  }
}

/* Mobile landscape */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }

  .card {
    padding: 15px;
  }

  input,
  textarea,
  select {
    font-size: 1rem;
    text-align: start;
  }

  [dir="rtl"] input,
  [dir="rtl"] textarea,
  [dir="rtl"] select {
    text-align: end;
  }

  .navbar-brand img {
    height: 35px;
  }

  .swiper-slide .slider-title {
    font-size: 1.5rem;
  }

  .swiper-slide .slider-subtitle {
    font-size: 1rem;
  }

  .highlight-brand {
    font-size: 1.1rem;
  }

  .material-symbols-outlined,
  .fas {
    font-size: 1.25rem;
  }

  /* Contact Form Adjustments */
  .contact-form .form-control,
  .contact-form .form-select,
  .contact-form textarea {
    font-size: 0.95rem;
    min-height: 42px;
  }

  .contact-form textarea.form-control {
    min-height: 100px;
  }

  #backToTop {
    width: 60px;
    height: 100px;
    bottom: 20px;
    right: 20px;
  }

  #batteryIcon {
    width: 100%;
    height: 100%;
  }
}

/* Mobile portrait */
@media (max-width: 576px) {
  .container {
    padding-inline: 10px;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  th {
    position: absolute;
    top: -9999px;
    inset-inline-start: -9999px;
  }

  td {
    position: relative;
    padding-inline-start: 50%;
    border: none;
    border-bottom: 1px solid #ddd;
    text-align: start;
  }

  [dir="rtl"] td {
    text-align: end;
    padding-inline-start: 0;
    padding-inline-end: 50%;
  }

  td::before {
    position: absolute;
    top: 0;
    inset-inline-start: 10px;
    width: 45%;
    padding-inline-end: 10px;
    white-space: nowrap;
    font-weight: bold;
    color: #666;
    content: attr(data-label);
    text-align: start;
  }

  [dir="rtl"] td::before {
    text-align: end;
    inset-inline-start: auto;
    inset-inline-end: 10px;
    padding-inline-end: 0;
    padding-inline-start: 10px;
  }

  .navbar-brand img {
    height: 30px;
  }

  .swiper-button-prev,
  .swiper-button-next {
    width: 32px;
    height: 32px;
  }

  .banner-content h2,
  .banner-content h3 {
    font-size: 1rem;
  }

  .banner-content {
    padding: 1rem;
  }
}

/* Prevent dropdown on hover in mobile */
@media (max-width: 991px) {
  .navbar .dropdown:hover > .dropdown-menu {
    display: none !important;
  }

  .dropdown-menu {
    display: none;
  }

  .dropdown-menu.show {
    display: block !important;
  }
}

/* Utility alignments */
.text-center { text-align: center; }
.text-start  { text-align: start; }
.text-end    { text-align: end; }

[dir="rtl"] .text-start { text-align: right; }
[dir="rtl"] .text-end   { text-align: left; }