/* GENERAL MOBILE RESET */
@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }

  .row {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
  }

  .columns,
  .column {
    width: 100% !important;
    margin-left: 0 !important;
    float: none !important;
  }

  .mainheaders {
    font-size: 35px;
  }

  .subheaders {
    font-size: 30px;
  }

  /* Dropdown options */
  .dropdown-option {
    padding: 8px;
    cursor: pointer;
    background-color: white;
    border-bottom: 1px solid #eee;
    position: relative;
  }

  /* Sub-options positioned to the right */
  .sub-options {
    display: none;
    position: absolute;
    top: 0;
    font-size: 12px;
    left: 100%;
    background-color: white;
    border: 1px solid #ccc;
    width: 150px;
    z-index: 101;
  }

  /* Hover effect for main options */
  .dropdown-option:hover {
    background-color: #f0f0f0;
  }

  /* Show the dropdown when input is focused */
  #dropdown-input:focus + .dropdown {
    display: block;
  }

  /* Show sub-options when hovering over an option */
  .dropdown-option:hover .sub-options {
    display: block;
  }

  /* Sub-option styling */
  .sub-option {
    padding: 4px 8px;
    cursor: pointer;
  }

  .sub-option:hover {
    background-color: #f0f0f0;
  }

  /* HEADER NAVBAR */
  .nav-container {
    margin-bottom: 1em;
    margin-top: 0px;
  }

  .modNav .nav-bar > li {
    border: none;
    margin: 0px;
    margin-bottom: 4em;
    border: 1px solid transparent;
    background-color: transparent;
  }

  .modNav .nav-bar > li > a {
    color: white;
    padding: 0 10px;
    line-height: 30px;
    text-transform: uppercase;
    font-family: "Steelfish";
    font-weight: 400;
    letter-spacing: 0.05em;
    font-size: 10px;
    font-weight: bolder;
    align-items: center;
  }

  .navbar-row {
    display: flex;
  }

  body #header {
    background: url(../images/header_bg2.png) 0 59px repeat-x;
    position: relative;
    min-width: 50%;
  }

  /* Stack service cards */
  .cards {
    flex-direction: column;
    gap: 10px;
  }

  .cards .card {
    width: 50% !important;
    margin: 0 auto;
  }

  .modServices.overlapped {
    width: 300px;
  }

  .modServices.overlapped > ul > li {
    margin-left: 0;
    margin-bottom: 0;
    margin-right: 0;
  }

  /* Forms and order section layout */
  .order {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
  }

  .order-form,
  .box {
    display: flex !important;
    flex-direction: column !important;
    width: 95% !important;
  }

  .order_titles,
  .order_images,
  .box-content,
  .map {
    width: 100% !important;
    margin: 0 0 20px !important;
  }

  .order_images img {
    width: 100%;
    height: auto;
    display: block;
  }

  .row {
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  /* Adjust testimonial section */
  .modTestimonials,
  .modBlogNews {
    width: 100% !important;
  }

  /* Footer social icons */
  .foot .social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }

  /* Nivo Slider Responsive Styles */
  .modNivoSlider,
  .nivoSlider {
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vw * 9 / 16) !important; /* 16:9 aspect ratio */
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
    margin-top: 20px; /* Avoid overlap with hamburger menu */
    display: block !important;
  }

  .nivoSlider img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: cover; /* Show full image */
    object-position: center;
  }

  /* Navigation buttons */
  .nivo-directionNav a {
    padding: 8px !important;
    font-size: 14px;
    z-index: 10;
    display: block !important;
  }

  .nivo-prevNav {
    left: 5px !important;
    right: auto !important;
  }

  .nivo-nextNav {
    right: 5px !important;
    left: auto !important;
  }

  /* Hide duplicate next buttons on left */
  .nivoSlider .nivo-directionNav .nivo-nextNav:not([style*="right"]) {
    display: none !important;
  }

  /* Control navigation (dots) */
  .nivo-controlNav {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    z-index: 10;
  }

  .nivo-controlNav a {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    margin: 0 5px;
    text-indent: -9999px;
    cursor: pointer;
  }

  .nivo-controlNav a.active {
    background: #fff;
  }

  .row,
  .columns,
  .twelve {
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .modSectionHeader {
    margin-top: 40px;
  }

  textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .modLogo h2 {
    width: 110px;
    height: 110px;
    background-size: contain;
    margin-left: 35px;
  }

  .modLogo {
    top: -20px;
    position: relative;
    height: 39px;
    left: -35px;
  }
}

@media (max-width: 768px) {
  #footer {
    background: none !important;
    background-size: auto 100px;
    color: #ffffff;
    padding: 40px 16px;
    text-align: center;
    font-family: "Oswald", sans-serif;
    font-size: 16px;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    height: 200px;
  }

  body.colorSchemeCyan #footer {
    background: url(../images/footer_bg_cyan.png) left top repeat-x;
    background-size: contain;
  }

  .row {
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  .foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .foot h6 {
    font-size: 16px;
    margin: 0;
  }

  .foot .social {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .foot .social img {
    width: 28px;
    height: 28px;
  }

  .copy {
    font-size: 13px;
    color: #ccc;
    margin-top: 20px;
    text-align: center;
  }
}

/* For mobile (max-width: 768px) */
@media (max-width: 768px) {
  .modGallery {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    margin-bottom: 50px;
  }

  .works {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 90px;
    padding: 0;
    margin: 0 auto;
    list-style: none;
  }

  .works li {
    width: 80%;
    max-width: 300px;
  }

  .image-wrapper {
    text-align: center;
  }

  .image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
  }

  .image-wrapper p {
    margin-top: 8px;
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .mod.modSectionHeader > h3,
  .mod.modTestimonials > h3,
  .mod.modBlogNews > h3 {
    font-size: 28px;
  }
}

.hamburger {
  display: none;
  font-size: 28px;
  cursor: pointer;
  z-index: 1001;
  position: absolute;
  top: 20px;
  right: 20px;
}

/* Hamburger (hidden on large screens) */
.hamburger {
  display: none;
  font-size: 30px;
  cursor: pointer;
  font-weight: bolder;
  color: #ffffff;
}

/* Offcanvas Menu */
.offcanvas {
  height: 100%;
  width: 0;
  position: fixed;
  top: 0;
  right: 0;
  background-color: #111;
  overflow-x: hidden;
  transition: 0.3s;
  z-index: 9999;
  padding-top: 60px;
}

.offcanvas .closebtn {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 36px;
  color: white;
  cursor: pointer;
}

.offcanvas ul {
  list-style-type: none;
  padding: 0;
}

.offcanvas a {
  display: block;
  color: white;
  padding: 16px 24px;
  text-decoration: none;
  margin-top: 4px;
  font-size: large;
}

.offcanvas a:hover {
  background-color: #96390e;
}

/* Responsive */
@media (max-width: 450px) {
  .nav-links {
    display: none;
  }

  .modSectionHeader {
    margin-top: 70px;
  }

  .Nivo-top {
    margin-top: 50px;
  }

  /* Nav menu style for mobile */
  .hamburger {
    display: block;
    top: 66px;
  }

  #navLinks {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: -20px;
    right: -100%;
    height: 100%;
    width: 250px;
    background-color: white;
    padding: 20px;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    background-color: #111;
  }

  #navLinks.show {
    right: 0;
  }

  .nav-bar li {
    margin: 1px 0;
  }

  .modLogo {
    top: -30px;
    position: relative;
    height: 39px;
    left: -35px;
  }

  /* Nivo Slider for smaller phones */
  .modNivoSlider,
  .nivoSlider {
    margin-top: 70px;
    height: calc(100vw * 9 / 16) !important; /* 16:9 aspect ratio */
    display: block !important;
  }

  .nivo-directionNav a {
    padding: 6px !important;
    font-size: 12px;
  }

  .nivo-prevNav {
    left: 2px !important;
  }

  .nivo-nextNav {
    right: 2px !important;
  }

  .nivo-controlNav a {
    width: 8px;
    height: 8px;
    margin: 0 4px;
  }
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  display: none;
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 500px) {
  .seals-container {
    grid-template-columns: repeat(3, 1fr);
  }

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