/* =====================
   Global & Body
   ===================== */
body {
  margin: 0;
  padding-bottom: calc(
    50px + env(safe-area-inset-top) + env(safe-area-inset-bottom)
  );
}

/* =====================
   Header & Navigation
   ===================== */
#site-header {
  background-color: #f4f4f9;
  padding-top: env(safe-area-inset-top);
  width: 100%;
  height: 8vh; /* stays as-is for pages without the search row */
}

.header-container {
  display: flex;
  flex-wrap: wrap; /* NEW — allows .container to drop to its own line */
  position: fixed;
  top: 0;
  background-color: var(--bg-primary);
  border-bottom: 2px solid var(--accent-primary);
  width: 100%;
  height: 8vh; /* fine when nothing wraps */
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.brand-logo {
  margin-left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.akhyaar-logo {
  height: 32px;
  width: auto;
}

.brand-logo h1 {
  color: var(--bg-page);
  font-family: "playfair display", serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 0;
}

.nav-container {
  display: flex;
  margin-right: 5px;
  align-items: center;
  justify-content: space-evenly;
  gap: 15px;
}

/* =====================
   Dropdown Menu (Click-Only)
   ===================== */
.dropdown {
  position: relative;
}

.dropbtn {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
}

.menu-icon-img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  display: block;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: var(--bg-card);
  min-width: 200px;
  border-radius: 12px;
  box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 10px 0;
  margin-top: 12px;
}

/* The Click Trigger */
.dropdown-content.show {
  display: block !important;
}

.dropdown-content a {
  color: var(--text-primary);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 15px;
}

.dropdown-content a:active {
  background-color: var(--bg-page);
}

/* =====================
   Essentials Sub-Menu
   ===================== */
.nested-menu {
  border-top: 1px solid var(--bg-page-secondary);
  margin-top: 5px;
}

.nested-trigger {
  color: var(--accent-secondary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
}

.nested-trigger i {
  transition: transform 0.3s ease;
}

/* Rotate arrow when active */
.nested-menu.active .nested-trigger i {
  transform: rotate(180deg);
}

.sub-menu-items {
  display: none;
  background-color: var(--bg-page);
  padding-left: 10px;
}

.sub-menu-items.open {
  display: block !important;
}

/* =====================
   Footer Styles
   ===================== */
#site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 50px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-soft);
  z-index: 999;
}

.footer-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  height: 100%;
}

.footer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--bg-highlight);
  flex: 1;
  height: 100%;
}

.footer-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.footer-item span {
  font-size: 12px;
  font-weight: bolder;
}

/* =====================
   Desktop (min 600px)
   ===================== */
@media (min-width: 600px) {
  #site-footer {
    top: 8vh;
    bottom: 0;
    left: 0;
    right: auto;
    width: 55px;
    height: 92%;
    z-index: 4;
  }

  .footer-container {
    flex-direction: column;
    padding-top: 20px;
    justify-content: flex-start;
    gap: 30px;
  }

  main {
    margin-left: 60px;
  }

  body {
    padding-bottom: 0;
  }
}

.footer-item {
  position: relative; /* Essential so the badge stays anchored to the icon container */
}

/* Permanent app-style badge */
.badge-pill {
  position: absolute;
  top: 2px;
  right: 22%; /* Adjusts placement over the icon */
  background-color: var(--accent-primary);
  color: var(--text-primary);
  font-size: 9px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 10px;
  text-transform: uppercase;
  font-family: sans-serif;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.preference {
  display: none;
}

/* sssssssssssssssssssssssssssssssssssss */
.container {
  display: none !important;
  width: 100%;
  outline: none;
  flex-basis: 100%;
  order: 3;
  justify-content: flex-end;
  margin: 0 15px;
}

.search-container {
  overflow: hidden;
  float: right;
  height: 3em;
  /* width: 4em; */
  width: 100%;
  border-radius: 2em;
  box-shadow: 0 0 5px #ffba46;
  -moz-transition: all 0.35s;
  -webkit-transition: all 0.35s;
  transition: all 0.35s;
  /* margin-bottom: 1em; */
  background: var(--bg-page);
}

.search-container:hover,
.search-container:focus,
.search-container:focus-within {
  /* width: 100%; */
  border-radius: 2em 2em 2em 2em;
  outline: none;
  box-shadow: 0 0 5px #4c4663;
}

.search-container:hover .button,
.search-container:focus .button,
.search-container:focus-within .button {
}

.search-container:hover input,
.search-container:focus input,
.search-container:focus-within input {
  display: inline-block;
  width: 85%;
  padding: 10px;
  /* border-radius: 2em 2em 2em 2em; */
}

input {
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  float: left;
  /* width: 0em; */
  width: 85%;
  height: 100%;
  /* margin: 1em 0 1em 1em; */

  /* margin-right: -4.5em; */
  background: var(--bg-page);
  color: #6a5d4f;
  font-size: 1em;
  font-weight: 600;
  padding: 0 5px;
  border: 0;
  border-radius: 5px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2) inset;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  -moz-transition: all 0.25s;
  -webkit-transition: all 0.25s;
  transition: all 0.25s;
}

input:focus {
  outline: none;
  box-shadow:
    0 -1px 1px rgba(255, 255, 255, 0.25),
    0 1px 5px rgba(0, 0, 0, 0.15);
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  float: right;
  width: 1.5em;
  height: 1.5em;
  margin: 0.2px;
  margin-right: 0.9px;
  background: #6a5d4f;
  text-align: center;
  font-size: 2em;
  color: #fdf6e3;
  border-radius: 50%;
  box-shadow:
    0 -1px 1px rgba(255, 255, 255, 0.25),
    0 1px 1px rgba(0, 0, 0, 0.25);
  text-shadow: 0 -2px 1px rgba(0, 0, 0, 0.3);
}

.button:active {
  border: 0 !important;
  text-shadow: 0 0 0;
}

.button i {
  font-size: 85%;
}
