:root {
  --primary-color: #e67819;
  --banner-blue: #0066cc;
  --light-gray: #f2f2f2;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--primary-color);
  border-top: 5px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Maintenance Page Styles */
#maintenancePage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    /* Initially hidden, controlled by JS */
    display: none;
}

.maintenance-logo {
    max-width: 200px;
    margin-bottom: 30px;
}

#maintenancePage h1 {
    font-size: 2em;
    color: white;
    margin-bottom: 10px;
}

#maintenancePage p {
    font-size: 1.1em;
    color: white;
    margin-bottom: 30px;
}

.social-icons a {
    color: white;
    font-size: 2em;
    margin: 0 15px;
    transition: color 0.3s ease;
    text-decoration: none;
}

.social-icons a:hover {
    color: var(--light-gray);
}
/* End Maintenance Page Styles */

.header-container {
  width: 100%;
  background-color: var(--primary-color);
}

header {
  background-color: var(--primary-color);
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  position: relative;
}

.logo {
  margin-left: 20px;
}

.logo img {
  cursor: pointer;
  height: 40px;
}

.search-box {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 20px;
  padding: 0px 15px;
  cursor: text;
  flex-grow: 1;
  max-width: 600px;
}

.search-box input {
  border: none;
  background: none;
  padding: 8px 0px;
  width: 100%;
  outline: none;
  font-size: 14px;
  cursor: text;
  flex-grow: 1;
}

.search-box i {
  color: #666;
  margin-right: 5px;
}

.search-box button {
  border: none;
  background: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.search-box button i {
  margin-right: 5px;
}

.search-box input.input-warning {
  border: 1px solid red;
}

.search-box.desktop-header-search button span {
    display: inline;
}

.cart-icon {
  color: white;
  font-size: 24px;
  margin-right: 20px;
  position: relative;
}

.cart-notification {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff0000;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.categories-nav {
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 10;
  padding: 10px 0px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.categories-container {
  overflow: visible;
  margin: 0;
  position: relative;
  justify-content: center;
  display: flex;
}

.categories-scroll {
  display: inline-block;
  gap: 10px;
  transition: transform 0.3s;
  position: relative;
}

.category-button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  font-size: 12px;
  text-transform: uppercase;
}

.category-button.selected {
  background-color: #0066cc !important;
  position: relative;
}

.category-button.selected::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #0066cc;
}

.category-button:hover {
  opacity: 0.9;
}

.category-button img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.submenu-indicator {
  margin-left: 3px;
  font-size: 10px;
  color: white;
}

.category-submenu {
  position: relative;
  display: inline-block;
  padding-left: 5px;
  padding-top: 5px;
}

.category-submenu .submenu-items {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  background: white;
  min-width: 180px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 1000;
  border-radius: 5px;
}

.submenu-button {
  width: 100%;
  padding: 8px 12px;
  background: white;
  color: #333;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
}

.submenu-button:hover {
  background: #f5f5f5;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 2;
}

.nav-arrow.left {
  left: 0;
}

.nav-arrow.right {
  right: 0;
}

.breadcrumb {
  background-color: #f8f9fa;
  padding: 10px 20px;
  font-size: 14px;
  margin: 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e9ecef;
}

.breadcrumb-home {
  color: var(--banner-blue);
  cursor: pointer;
  font-weight: 600;
  transition: color 0.3s ease;
}

.breadcrumb-home:hover {
  color: #004a99;
}

.breadcrumb-separator {
  margin: 0 10px;
  color: #6c757d;
  font-size: 12px;
}

.breadcrumb-current {
  color: #495057;
  font-weight: 500;
}

.iframe-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 200px);
  margin: 0;
}

#contentFrame {
  width: 100%;
  height: 100%;
  border: none;
  margin: 0;
  padding: 0;
}

.iframe-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.assistance-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  z-index: 1000;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.assistance-button:hover {
  background-color: #c96414;
}

.assistance-button i {
  font-size: 28px;
}

.top-banner {
  background-color: #4e7cba;
  color: white;
  padding: 10px 20px;
  font-size: 14px;
  text-align: left;
}

.banner-content {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-icon {
  height: 16px;
  width: auto;
  vertical-align: middle;
}

@keyframes scroll-left {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.cart-added-notification {
  position: fixed;
  bottom: 90px;
  right: 20px;
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  pointer-events: none;
  font-size: 14px;
  max-width: 80%;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.cart-added-notification.visible {
  opacity: 1;
  visibility: visible;
}

/* Mobile styles */
@media (max-width: 768px) {
  .header-container {
    background-color: var(--primary-color);
  }

  header {
    padding: 10px;
    justify-content: space-between;
    gap: 15px;
  }

  .menu-toggle {
    display: block;
    font-size: 24px;
    color: white;
    cursor: pointer;
  }

  .search-box.desktop-header-search {
      display: none;
  }

  .mobile-search-row {
      display: flex;
      justify-content: center;
      padding: 10px 0;
      background-color: var(--light-gray);
      width: 100%;
  }

  .search-box.mobile-row-search {
      display: flex;
      flex-grow: 1;
      max-width: none;
      margin: 0 10px;
  }

  .search-box.mobile-row-search input {
    padding: 8px;
  }

  .search-box.mobile-row-search button {
    display: flex;
  }

  .search-box.mobile-row-search button i {
    margin-right: 0;
  }

  .search-box.mobile-row-search button span {
    display: none;
  }

  .categories-nav {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: white;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar-header {
    background: var(--primary-color);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    flex-shrink: 0;
  }

  .sidebar-header .back-button {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-right: 10px;
  }

  .sidebar-header h2 {
    flex-grow: 1;
    text-align: center;
    font-size: 18px;
    margin: 0;
  }

  .sidebar-header .close-sidebar {
    font-size: 30px;
    cursor: pointer;
    margin-left: 10px;
  }

  .categories-scroll {
     flex-grow: 1;
     overflow-y: auto;
     padding: 0;
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-bottom: 1px solid #eee;
    background: white;
    color: #333;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    transition: background-color 0.2s ease;
  }

  .sidebar-nav-item:last-child {
    border-bottom: none;
  }

  .sidebar-nav-item:hover {
      background-color: #f5f5f5;
  }

  .sidebar-nav-item.selected {
      font-weight: bold;
      color: var(--primary-color);
      background-color: #f5f5f5;
  }

  .sidebar-nav-item img {
      display: none;
  }

  .sidebar-nav-item[data-has-children="true"]::after {
      content: '\f105';
      font-family: 'Font Awesome 6 Free';
      font-weight: 900;
      margin-left: auto;
      color: #999;
  }

  .assistance-button {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 15px;
  }

  .assistance-button i {
    font-size: 24px;
  }

  .cart-added-notification {
    bottom: 75px;
    right: 15px;
    left: 15px;
    max-width: none;
  }
}

/* Desktop styles */
@media (min-width: 769px) {
  .sidebar {
    display: none !important;
  }

  .categories-nav {
    display: block;
    background-color: var(--primary-color);
    padding: 10px 0;
    position: relative;
    z-index: 50;
  }

  .categories-container {
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: center;
  }

  .categories-container::-webkit-scrollbar {
      display: none;
  }

  .categories-scroll {
      display: none;
  }

  .category-button {
      text-transform: uppercase;
      background-color: var(--primary-color);
  }

   .submenu-button {
       text-transform: uppercase;
   }

  .menu-toggle,
  .sidebar,
  .overlay {
    display: none !important;
  }

  .search-box.desktop-header-search {
    display: flex;
    flex-grow: 1;
    margin: 0 35px;
  }

  .mobile-search-row {
    display: none;
  }

  header {
      justify-content: space-between;
      padding: 10px 20px;
   }

   .logo {
       margin-left: 0;
   }

   .cart-icon {
       margin-right: 0;
   }

   header > .search-box.desktop-header-search {
       flex-basis: 600px;
       flex-grow: 0;
       margin: 0 35px;
   }

  .categories-nav-desktop {
    display: flex;
    justify-content: center;
    position: relative;
  }

  .categories-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 20px;
    cursor: pointer;
    white-space: nowrap;
    background-color: white;
    color: var(--primary-color);
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 0 auto;
  }

  .categories-dropdown-toggle:hover {
      background-color: var(--light-gray);
  }

  .categories-dropdown-toggle i {
      color: var(--primary-color);
  }

  .mega-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 40;
    flex-direction: row;
    border-top: 1px solid var(--light-gray);
    max-height: 500px;
    overflow: hidden;
  }

  .mega-menu-left {
    width: 30%;
    padding: 20px;
    border-right: 1px solid var(--light-gray);
    background-color: #607D8B;
    overflow-y: auto;
    max-height: 500px;
  }

  .mega-menu-right {
    width: 70%;
    padding: 20px;
    background-color: white;
    overflow-y: auto;
    max-height: 500px;
  }

  .mega-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 8px 15px;
    margin-bottom: 4px;
    border: none;
    background: none;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-transform: uppercase;
    border-radius: 3px;
  }

  .mega-menu-left .mega-menu-item {
      color: white;
  }

  .mega-menu-left .mega-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
  }

  .mega-menu-item:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
  }

  .mega-menu-item.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
  }

  .mega-menu-item img {
      width: 16px;
      height: 16px;
      object-fit: contain;
  }

  .mega-menu-left .mega-menu-item img {
       filter: brightness(0) invert(1);
   }

   .mega-menu-item.active img {
       filter: brightness(0) invert(1);
   }

  .mega-menu-right-placeholder {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
  }

  .subcategories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .subcategory-item {
    flex: 1 1 auto;
    padding: 6px 10px;
    font-weight: normal;
    display: block;
    gap: 0;
  }

  .subcategory-item:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
  }

  .subcategory-item.active {
    background-color: #e9ecef;
    color: var(--primary-color);
    font-weight: bold;
  }
}