/**
 * @file
 * Subtheme specific CSS.
 */

/* Header */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

* {
  font-family: inter;
}

/* Make navbar a flex container - Enabled for all sizes to support custom mobile/tablet layout */
@media (min-width: 1px) {
  #CollapsingNavbar {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

#main-wrapper {
  position: relative;
}




/* Hide second search on desktop (used for mobile search overlay) */
@media (min-width: 992px) {
  #block-redfox-views-block-product-search-block-1 {
    display: none !important;
  }
}

/* Menu below search */
#block-redfox-mainnavigation {
  order: 2;
}

/* Right side items */

#block-redfox-useraccountmenu {
  position: absolute;
  right: 60px;
  top: 20px;
}


/* Modern Cart Design */
#block-redfox-cart {
  position: absolute;
  right: 145px;
  /* Adjusted to give more space */
  top: 15px;
  z-index: 10;
}

.cart--cart-block {
  display: flex;
  justify-content: center;
}

.cart-block--summary__icon {
  display: block;
  line-height: 1;
}

#block-redfox-cart .cart-block--summary__icon img {
  width: 28px;
  height: auto;
  filter: brightness(0) invert(1);
  /* Ensure icon is white */
}

/* The Badge */
#block-redfox-cart .cart-block--summary__count {
  position: absolute;
  top: 2px;
  right: -5px;
  background: #ffffff;
  color: #AC0401;
  /* Primary theme color */
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Cart count badge refinement */
#block-redfox-cart .cart-block--summary__count {
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
}

/* Search wrapper */
.views-exposed-form .d-flex {
  padding: 10px;
  border-radius: 10px;
  align-items: center;
  max-width: 600px;
  flex-wrap: nowrap !important;
}

/* Input field */
[data-drupal-selector="edit-search-api-fulltext"] {
  border: none !important;
  border-radius: 8px 0 0 8px !important;
  height: 45px !important;
  padding: 0 15px !important;
  font-size: 15px !important;
  box-shadow: none !important;
  width: 100% !important;
}

/* Remove default margin */
.form-item-search-api-fulltext {
  margin-bottom: 0 !important;
  flex: 1;
}

/* Search button container */
[data-drupal-selector="edit-actions"] {
  margin-bottom: 0 !important;
}

/* Search button */
button[data-drupal-selector^="edit-submit-product-search"] {
  background: #8f0000 !important;
  border: none !important;
  height: 45px !important;
  width: 60px !important;
  border-radius: 0 8px 8px 0 !important;
  color: white !important;
  font-size: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
}

button[data-drupal-selector^="edit-submit-product-search"]::before {
  content: "🔍";
  font-size: 18px !important;
}

#block-redfox-useraccountmenu .nav-item .nav-link--user {
  display: none;
}

/* ========================================
   Tablet & Mobile Header Layout (< 992px)
   ======================================== */
@media (max-width: 991px) {

  /* Hide default bootstrap toggler as we use custom ones */
  button.navbar-toggler:not(.tablet-menu-toggle) {
    display: none !important;
  }

  /* 1. Menu Icon (Left) */
  .tablet-menu-toggle {
    order: 1 !important;
    margin-right: 15px;
    position: absolute;
    left: 0;
  }

  /* 2. Logo (Next to Menu) */
  #navbar-main .navbar-brand {
    order: 2 !important;
    margin-right: 0;
    padding-top: 5px;
    padding-bottom: 5px;
    /* Removed margin-right: auto */
  }

  #navbar-main .navbar-brand img {
    max-height: 40px;
    width: auto;
  }

  /* 3. Search Icon (Right Group) */
  /* Push this and following items to the right */
  .tablet-search-toggle {
    order: 3 !important;
    margin-right: 15px;
    margin-left: auto;
  }

  /* 4. Cart Icon (Right Group) */
  #block-redfox-cart {
    order: 4 !important;
    position: static !important;
    /* Reset layout from desktop absolute */
    margin-right: 35px;
    top: auto;
    right: 3px;
  }

  /* Ensure icon size matches others if needed */
  #block-redfox-cart .cart-block--summary__icon img {
    width: 24px;
    height: auto;
    vertical-align: middle;
  }

  /* Hide the "0 items" text if desired? User: [Cart Icon]. Usually implies icon only. */
  #block-redfox-cart .cart-block--summary__count {
    display: none;
  }

  /* 5. Login Icon (Rightmost) */
  #block-redfox-useraccountmenu {
    order: 5 !important;
    position: absolute !important;
    top: auto;
    right: 3px;
  }

  /* Login Icon Customization - Icon Only */
  #block-redfox-useraccountmenu ul.flex-row {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #block-redfox-useraccountmenu .nav-link {
    font-size: 0 !important;
    /* Hide "Log in" text */
    padding: 5px;
    line-height: 1;
    display: block;
  }

  #block-redfox-useraccountmenu .nav-link:before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    /* Using a simple user icon SVG - White */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3e%3ccircle cx='12' cy='7' r='4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
  }

  /* Hiding Desktop Elements */

  /* Hide the Full Search Bar */
  #block-redfox-views-block-product-search-block-1 {
    display: none;
    width: 100%;
    order: 10;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    z-index: 2000;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-top: 1px solid #e9ecef;
  }

  /* Show it when toggled */
  #block-redfox-views-block-product-search-block-1.search-overlay-visible {
    display: block !important;
    background-color: bisque;
  }

  /* Ensure input container is full width in the dropdown */
  #block-redfox-views-block-product-search-block-1 .d-flex {
    width: 100%;
    max-width: none;
    padding: 0;
    border: none;
  }

  #block-redfox-views-block-product-search-block-1 form {
    width: 100%;
  }

  /* Hide the Main Navigation */
  #block-redfox-mainnavigation {
    display: none;
    width: 100%;
    order: 11;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    z-index: 999;
    border-top: 1px solid #ddd;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  /* Show it when toggled */
  #block-redfox-mainnavigation.show-tablet-menu {
    display: block !important;
  }

  /* Style the Mobile Menu Items */
  #block-redfox-mainnavigation .navbar-nav {
    flex-direction: column;
    width: 100%;
  }

  #block-redfox-mainnavigation .nav-item {
    width: 100%;
    border-bottom: 1px solid #f1f1f1;
  }

  #block-redfox-mainnavigation .nav-link {
    padding: 15px 20px;
    color: #333;
    font-weight: 500;
    text-align: left;
  }

  #block-redfox-mainnavigation .nav-link:hover {
    background-color: #f8f9fa;
  }

  #header {
    position: relative;
  }
}

/* Better Exposed Filter */

form.bef-exposed-form .form-check-label {
  color: #000;
}