/* Large tablets and small desktops */
@media (min-width: 993px) and (max-width: 1123px) {
  .search-form input {
    width: 90px;
    height: 40px;
    margin-left: 1px;
  }

  .nav-links a {
    margin: 0 16px;
  }

  .contact a {
    margin-right: 0;
  }
}

/* Tablets and below (0px – 992px) */
@media (max-width: 992px) {
  .logo {
    margin-right: 1px;
    padding-top: 10px;
  }

  .nav-links a {
    margin: 0 16px;
  }

  .search-form input {
    width: 80px;
    height: 40px;
  }

  .contact a {
    margin-right: 0;
  }

  .watermark {
    position: fixed;
    top: 55%;
    left: 50%;

    transform: translate3d(-50%, -50%, 0);
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
    -webkit-transform: translate3d(-50%, -50%, 0);
  }

  .scroll-bar-wrapper {
    margin-top: -1px;
  }

  /* Hide sidebar */
  .sidebar {
    display: none !important;
  }

  /* Custom dropdown (visible only on mobile/tablets) */
  .chapter-dropdown-wrapper {
    display: block !important;
    margin: 0 auto;
    width: 55%;
    text-align: center;
    position: fixed;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
  }

  .custom-dropdown {
    background-color: #5c0000;
    border: 2px solid #ff8c00;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #ffda96;
    position: relative;
    user-select: none;
    height: 25px;
    text-align: center;
    padding-top: 5PX;
  }

  .dropdown-selected {
    padding: 1px;
    border-radius: 8px;
    position: relative;
  }



  .custom-dropdown.open .dropdown-options {
    display: block;
  }

  .dropdown-options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 160px;
    overflow-y: auto;
    background-color: #ffe4b3;
    border: 2px solid #ff8c00;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
  }

  .dropdown-options li {
    padding: 4px;
    font-size: 14px;
    font-weight: bold;
    color: #5c0000;
    transition: background 0.2s;
    cursor: pointer;
  }

  .dropdown-options li:hover {
    background-color: #ffda96;
    color: #5c0000;
  }

  .dropdown-options li.selected {
    background-color: #ff8c00;
    color: #450000;
  }
}

/* Tablets (0px – 924px) */
@media (max-width: 924px) {
  .logo {
    margin-right: 1px;
    padding-top: 10px;
  }

  .nav-links a {
    margin: 0 16px;
  }

  .contact a {
    margin-right: 0;
  }

  .watermark {
    position: fixed;
    top: 55%;
    left: 50%;

    transform: translate3d(-50%, -50%, 0);
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
    -webkit-transform: translate3d(-50%, -50%, 0);
  }

  .scroll-bar-wrapper {
    margin-top: -1px;
  }

  .sidebar {
    display: none !important;
  }

.gyansakha button {
  font-size: 15px;
  padding: 10px 6px;
}
}

@media (max-width: 341px) {
  .gyansakha button {
  font-size: 10px;
  padding: 10px 6px;
}
}


/* Mobile (0px – 712px) */
@media (max-width: 712px) {
  .watermark {
    position: fixed;
    width: 300px;
    height: auto;

    transform: translate3d(-50%, -50%, 0);
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
    -webkit-transform: translate3d(-50%, -50%, 0);
  }

  .hamburger {
    display: block;
    font-size: 28px;
    color: #ffda96;
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 10px;
    bottom: 0;
  }

  /* Slide menu */
  .nav-links {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: hsl(8, 97%, 15%);
    box-shadow: 2px 0 10px rgba(83, 0, 0, 0.151);
    display: flex;
    flex-direction: column;
    padding-top: 0;
    transition: left 0.2s ease;
    z-index: 999;
    background-image: 
      url("imagestore/Sanatan-Path-logo2.webp"),
      url("imagestore/krishnaarjunrath.webp");
    background-repeat: no-repeat, no-repeat;
    background-size: contain, contain;
    background-position: center 10px, center calc(100% - 50px); /* 50px खाली padding सारखं */
    background-size: 150px auto, contain;
    padding-top: 50px;    /* वरच्या image साठी */
  }


  .nav-links a.home {
    display: block;
    margin-top: 120px;
  }

  .nav-links a {
    margin-top: 12px;
    background-color: #450000;
    width: 215px;
    text-align: center;
  }

  /* Overlay shadow */
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 999;
  }

  .nav-links.active {
    left: 0;
  }

  .overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .close-btn {
    position: absolute;
    top: 1%;
    right: 65%;
    width: 30%;
    height: 3%;
    background: url("imagestore/crosssbhala.webp");
    background-repeat: no-repeat;
    background-size: contain;
    border: none;
    cursor: pointer;
    z-index: 1002;
  }
}

/* Small phones (0px – 500px) */
@media (max-width: 500px) {
  .hamburger {
    display: block;
    font-size: 28px;
    color: #ffda96;
    background: none;
    border: none;
    cursor: pointer;
    margin-right: -15px;
  }
}

/* Extra small phones (0px – 320px) */
@media (max-width: 320px) {
  .hamburger {
    display: block;
    font-size: 28px;
    color: #ffda96;
    background: none;
    border: none;
    cursor: pointer;
    margin-right: -15px;
    margin-left: -10px;
  }
}

/* ========================= */
/* ENHANCED MOBILE DROPDOWN  */
/* ========================= */

.chapter-dropdown-wrapper {
  width: 92%;
  max-width: 420px;
}

/* Dropdown box */
.custom-dropdown {
  background: linear-gradient(135deg, #7a0000, #450000);
  border: 2px solid #ffb000;
  border-radius: 14px;
  height: 42px;
  padding: 6px 14px;
  font-size: 15px;
  display: flex;
  align-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  transition: all 0.3s ease;
}

/* Selected text */
.dropdown-selected {
  width: 100%;
  text-align: left;
  padding-right: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Arrow */


.custom-dropdown.open .dropdown-selected::after {
  transform: rotate(180deg);
}

/* Options container */
.dropdown-options {
  max-height: 210px;
  margin-top: 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff3d6, #ffe2a8);
  box-shadow: 0 10px 22px rgba(0,0,0,0.4);
  overflow-y: auto;
  padding: 6px 0;
  animation: dropdownFade 0.25s ease;
}

/* Scrollbar */
.dropdown-options::-webkit-scrollbar {
  width: 6px;
}
.dropdown-options::-webkit-scrollbar-thumb {
  background: #ff8c00;
  border-radius: 10px;
}

/* Items */
.dropdown-options li {
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.4;
  border-radius: 10px;
  margin: 2px 6px;
}

/* Hover */
.dropdown-options li:hover {
  background: #ffd27a;
}

/* Selected */
.dropdown-options li.selected {
  background: linear-gradient(135deg, #ff8c00, #ffb347);
  color: #450000;
  font-weight: bold;
}

/* Subtle bottom shadow to show scroll */
.dropdown-options::after {
  content: "\25BE";
  position: sticky;
  bottom: 0;
  height: 18px;
  display: block;
  background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
}

/* Animation */
@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ============================= */
/* COMPACT MOBILE DROPDOWN – UI MATCH */
/* ============================= */

.chapter-dropdown-wrapper {
  width: 82%;
  max-width: 340px;
}

/* Main box */
.custom-dropdown {
  height: 32px;
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6a0000, #420000);
  border: 1.5px solid #ff9a00;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

/* Selected text */
.dropdown-selected {
  padding-right: 22px;
  font-weight: 600;
  font-size: 13px;
}

/* Arrow */

/* Options list */
.dropdown-options {
  max-height: 160px;
  border-radius: 10px;
  padding: 4px 0;
  margin-top: 4px;
  font-size: 13px;
}

/* Items */
.dropdown-options li {
  padding: 6px 10px;
  margin: 2px 6px;
  border-radius: 8px;
  line-height: 1.3;
}

/* Selected */
.dropdown-options li.selected {
  background: linear-gradient(135deg, #ff9800, #ffb347);
  font-weight: 700;
}

/* Scrollbar thin */
.dropdown-options::-webkit-scrollbar {
  width: 4px;
}

/* Bottom fade */
.dropdown-options::after {
  height: 14px;
}
/* ============================= */
/* DROPDOWN FINAL POLISH – ARROW + CENTER TEXT */
/* ============================= */

/* ============================= */
/* FINAL MICRO SIZE TUNING */
/* ============================= */

/* Box slightly smaller */
.chapter-dropdown-wrapper {
  width: 78%;
  max-width: 300px;
}

.custom-dropdown {
  height: 28px;           /* ⬇️ thoda chota */
  padding: 2px 8px;       /* compact */
}

/* Text slightly bigger */
.dropdown-selected {
  font-size: 14.5px;      /* ⬆️ thoda motha */
  font-weight: 700;
  line-height: 1;
}

/* Arrow balance */

/* ============================= */
/* GUARANTEED VERTICAL CENTER FIX */
/* ============================= */

.custom-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* TRUE center – no font jump */
.dropdown-selected {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;

  font-size: 14.5px;
  font-weight: 700;

  line-height: normal;   /* 🔑 VERY IMPORTANT */
  padding: 0;
  margin: 0;
  pointer-events: none;
}

/* Arrow independent */

/* Rotate arrow */
.custom-dropdown.open .dropdown-selected::after {
  transform: translateY(-50%) rotate(180deg);
}

/* ============================= */
/* MOBILE DROPDOWN – SAFE ARROW */
/* DESIGN PRESERVED            */
/* ============================= */

.dropdown-selected::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);

  /* Arrow shape */
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #ffd700;

  /* Same visual feel */
  filter:
    drop-shadow(0 0 4px rgba(255,215,0,0.7))
    drop-shadow(0 0 8px rgba(255,140,0,0.6));

  transition: transform 0.3s ease;
  pointer-events: none;
}

/* Rotate on open */
.custom-dropdown.open .dropdown-selected::after {
  transform: translateY(-50%) rotate(180deg);
}
