/* public/assets/css/header.css */

/* Header styling */
.custom-header {
  background: rgba(255,255,255,0.95);  /* soft white with blur */
  backdrop-filter: blur(8px);
  height: 110px;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Logo */
.logo {
  height: auto;
  max-height: 60px;          /* desktop */
  object-fit: contain;
  transition: max-height 0.3s ease;
}

/* Nav links */
.custom-header .nav-link {
  color: #444444;                /* dark grey text */
  font-size: 1.05rem;
  font-weight: 500;
  margin-left: 15px;
  transition: color 0.3s ease, transform 0.3s ease;
  position: relative;
}
.custom-header .nav-link:hover {
  color: #A67B5B;                /* Almond-Tea accent */
  transform: translateY(-2px);
}
.custom-header .nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #A67B5B;
  transition: width 0.3s ease;
}
.custom-header .nav-link:hover::after {
  width: 100%;
}

/* Dropdown styling */
.dropdown-menu {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
  padding: 0.5rem 0;
  font-size: 0.95rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.nav-item.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.dropdown-item:hover {
  background-color: #f0ebe3;     /* very light almond */
  color: #A67B5B;
}
/* Soft arrow */
.nav-item.dropdown > .nav-link::after {
  content: '▾';
  font-size: 0.65rem;
  margin-left: 6px;
  vertical-align: middle;
  color: #888888;
  transition: transform 0.3s ease, color 0.3s ease;
}
.nav-item.dropdown:hover > .nav-link::after {
  transform: rotate(180deg);
  color: #A67B5B;
}
/* Remove default caret */
.nav-link.dropdown-toggle::after {
  display: none !important;
  content: none;
}

/* By default hide the 'X' close button */
.close-nav {
  display: none;
}

/* Off-canvas collapse on tablet+ */
@media (max-width: 991.98px) {
  .navbar-collapse {
    position: fixed;
    top: 0;
    left: 0;                  /* slide in from left */
    width: 100%;              /* full width on mobile */
    height: 100vh;
    background-color: #ffffff;
    padding-top: 110px;       /* match your header height */
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1050;
  }
  .navbar-collapse.show {
    transform: translateX(0);
  }
  .navbar-nav {
    flex-direction: column;
    padding-left: 0;
    margin: 0;
  }
  .navbar-nav .nav-item {
    width: 100%;
  }
  .navbar-nav .nav-link {
    display: block;
    padding: 1rem 1.5rem;
    margin-left: 0;           /* remove left margin */
    border-bottom: 1px solid #f0ebe3;
    text-align: left;         /* align text left */
    pointer-events: auto;
  }
  .navbar-nav .nav-link:hover {
    background-color: #f8f4f6;
    color: #A67B5B;
  }

  /* show the close button on mobile */
  .close-nav {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1060;
  }

  /* Optional dimming backdrop */
  body.nav-open { overflow: hidden; }
  .backdrop {
    position: fixed; top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.3);
    z-index: 1040;
    display: none;
  }
  .navbar-collapse.show ~ .backdrop {
    display: block;
  }
}

/* Tablet */
@media (max-width: 991.98px) {
  .logo {
    max-height: 50px;
  }
}

/* Mobile */
@media (max-width: 575.98px) {
  .custom-header {
    height: 80px;            /* optionally shrink header */
  }
  .logo {
    max-height: 40px;
  }
}

/*─────────────────────────────────────────────────────*/
/*  Mobile: fix Our Collection dropdown in off-canvas */
/*─────────────────────────────────────────────────────*/
@media (max-width: 991.98px) {
  /* Make all dropdown menus static (so they push content below) */
  .navbar-collapse .dropdown-menu {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0;
    padding: 0;
    pointer-events: auto;      /* enable clicks */
    width: 100%;               /* fill container */
  }

  /* Indent each dropdown item */
  .navbar-collapse .dropdown-menu .dropdown-item {
    padding-left: 2rem;
    border-bottom: 1px solid #f0ebe3;
    pointer-events: auto;
  }

  /* Rotate the caret 90° on mobile */
  .nav-item.dropdown > .nav-link .fa-chevron-down {
    transform: rotate(90deg);
    transition: transform 0.2s ease;
  }

  /* Remove extra padding around the parent link */
  .nav-item.dropdown > .nav-link {
    padding-right: 1.5rem;
  }
}

/*─────────────────────────────────────────────────────*/
/*  Ensure cart badge shows in collapsed mobile menu    */
/*─────────────────────────────────────────────────────*/
@media (max-width: 991.98px) {
  /* Override badge positioning so it’s visible */
  .navbar-nav .nav-item .badge {
    position: static !important;
    transform: none !important;
    top: auto !important;
    right: auto !important;
    margin-left: 0.5rem;
    display: inline-block;
    pointer-events: auto;
  }
}
