/* ============================================================
   layout.css — Header, footer, navigation, breadcrumbs, mobile responsive
   Loaded on: All pages
   ============================================================ */

/* --- CSS Custom Properties (Brand Tokens) --- */
:root {
    --brand-blue: #184484;
    --brand-pink: #d81b60;
    --brand-grey: #f4f7f6;
    --text-dark: #333;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* --- Styles from common/header --- */



/* --- Floating Cart Notification --- */
/* --- Floating Cart Notification --- */
#floating-cart-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--brand-blue, #141c6a);
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    z-index: 99999;
    font-size: 16px;
    font-weight: 600;
    display: none;
    text-align: center;
    border: 2px solid #fff;
    
    /* MOBILE FIXES: Ensures long names wrap and don't blow out the screen width */
    width: 90%;
    max-width: 450px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}
#floating-cart-toast i {
    margin-right: 8px;
    font-size: 1.2em;
    vertical-align: middle;
}

/* Modifying standard cart to look like the pink checkout button */
#cart {
  margin: 0 !important; width: auto !important;
}
#cart > .btn {
  background: var(--brand-pink, #d81b60) !important;
  color: #fff !important;
  border: none !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 24px !important;
  border-radius: 6px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  transition: background 0.2s !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  margin: 0 !important;
}
#cart > .btn:hover, #cart > .btn:focus {
  background: #b0154e !important;
  color: #fff !important;
  text-decoration: none !important;
}
#cart > .btn i {
  font-size: 18px !important;
}
#cart .dropdown-menu {
  z-index: 2001 !important;
}

/* Cart Dropdown Hover for Desktop */
@media (min-width: 992px) {
  #cart:hover .dropdown-menu {
    display: block;
  }
}






/* ==========================================================================
     GLOBAL FIXES
     ========================================================================== */
  body {
    padding-top: 0;
    font-family: var(--font-body, 'Open Sans', sans-serif);
    /* Fluid standard text: 14px on mobile -> up to 17px on large monitors */
    font-size: clamp(14px, 1vw + 10px, 17px);
  }
  
  /* Fix Breadcrumbs blowing out the screen width on mobile */
  .breadcrumb {
      display: flex;
      flex-wrap: wrap;
      background: transparent;
      margin-bottom: 20px;
      padding: 8px 15px 8px 0; /* Right padding ensures items don't touch screen edge */
      list-style: none;
      width: 100%;
      max-width: 100%;
      overflow: hidden;
  }
  .breadcrumb li {
      white-space: normal;
      word-wrap: break-word;
      word-break: break-word;
      font-size: 12px; /* Slightly smaller to fit more on one line */
      display: flex;
      align-items: center;
  }
  .breadcrumb li a {
      display: inline-block;
  }

  /* ==========================================================================
     TOP BAR (Always Visible)
     ========================================================================== */
  #top-bar {
    background: var(--brand-blue, #184484); /* Matched to theme */
    padding: 8px 0;
    font-size: 13px;
    margin: 0 !important;
  }
  .top-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .top-bar-phone {
    flex: 0 0 auto;
    margin-right: auto; /* Forces phone to extreme left and pushes remaining links to extreme right on desktop */
  }
  .top-bar-links {
    margin-bottom: 0;
    display: flex;
    align-items: center;
  }
  .top-bar-links > li > a {
    color: #fff; /* White text */
    text-decoration: none;
    transition: color 0.2s;
  }
  .top-bar-links > li > a:hover {
    color: var(--brand-pink, #d81b60);
  }
  .top-bar-links i {
    color: #fff; /* White icons */
    margin-right: 6px;
    font-size: 14px;
    opacity: 0.8; /* Subtly separate icons from text */
  }
  .top-bar-links .dropdown-menu a {
    color: #333; /* Reset dropdown text */
  }
  
  /* Prominent Phone Number Styles */
  .prominent-phone {
    font-size: 16px !important;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    color: #fff !important; /* Force white text to override theme default blue */
    text-decoration: none !important;
  }
  .prominent-phone:hover {
    color: #fff !important;
  }
  .prominent-phone i {
    color: var(--brand-pink, #d81b60) !important;
    font-size: 18px !important;
    opacity: 1 !important;
    margin-right: 8px !important; /* Extra breathing room after the phone icon */
  }

  /* ==========================================================================
     STICKY HEADER WRAPPER (Native CSS)
     ========================================================================== */
  .sticky-header-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1040;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  }

  /* ==========================================================================
     MAIN HEADER GRID
     ========================================================================== */
  #main-header {
    background: #fff;
    margin: 0 !important;
    padding: 0 !important;
  }
  #main-header .container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  
  .header-grid {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    padding: 10px 0 !important; /* Very tight vertical padding */
    margin: 0 !important;
  }
  
  .grid-logo { 
    flex: 0 0 auto !important;
    margin: 0 auto 0 0 !important; /* Force right margin auto, top/bottom zero */
    padding: 0 !important;
  }
  .grid-logo img { 
    max-height: 60px !important; 
    width: auto !important;
    display: block !important;
    margin: 0 !important;
  }
  .grid-logo h1 { 
    margin: 0 !important; 
    font-size: 24px !important; 
    font-weight: bold !important; 
  }
  .grid-logo h1 a { 
    color: var(--brand-blue, #184484) !important; 
    text-decoration: none !important; 
  }
  
  /* Search Box Redesign - Pixel Perfect Match */
  .grid-search { 
    flex: 1 1 auto !important;
    max-width: 600px !important;
    margin: 0 40px !important; 
    padding: 0 !important;
  }
  #search {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  #search.input-group {
    display: flex !important;
    width: 100% !important;
    align-items: stretch !important;
    margin: 0 !important;
  }
  
  /* Aggressive overrides for Bootstrap's input classes */
  #search .form-control,
  #search .form-control.input-lg {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    line-height: normal !important;
    border: 2px solid #ccc !important;
    border-right: none !important;
    box-shadow: none !important;
    border-radius: 6px 0 0 6px !important;
    font-size: 15px !important;
    padding: 0 15px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: #fff !important;
    outline: none !important;
    z-index: 1 !important;
  }
  #search .form-control:focus,
  #search .form-control.input-lg:focus {
    border-color: var(--brand-blue, #184484) !important;
  }
  
  /* Make the search button's border color match the input focus */
  #search:focus-within .btn,
  #search:focus-within .btn.btn-lg {
    border-color: var(--brand-blue, #184484) !important;
  }
  
  #search .input-group-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    display: flex !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2 !important;
  }
  
  #search .btn,
  #search .btn.btn-lg {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 44px !important;
    min-height: 44px !important;
    line-height: normal !important;
    padding: 0 24px !important;
    background: #f4f4f4 !important;
    border: 2px solid #ccc !important;
    border-left: none !important;
    border-radius: 0 6px 6px 0 !important;
    color: #333 !important;
    font-size: 16px !important;
    box-shadow: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    transition: background 0.2s !important;
    outline: none !important;
  }
  #search .btn:hover,
  #search .btn.btn-lg:hover {
    background: #e0e0e0 !important;
  }

  /* Actions */
  .grid-actions { 
    flex: 0 0 auto !important;
    margin: 0 0 0 auto !important; 
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
  }
  
  .btn-checkout-desktop {
    background: var(--brand-pink, #d81b60) !important;
    color: #fff !important;
    border: none !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 24px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    transition: background 0.2s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    margin: 0 !important;
  }
  .btn-checkout-desktop:hover, .btn-checkout-desktop:focus {
    background: #b0154e !important;
    color: #fff !important;
    text-decoration: none !important;
  }
  .btn-checkout-desktop i {
    font-size: 18px !important;
  }
  #desktop-cart-badge {
    color: #fff !important;
    font-weight: 800 !important;
  }

  /* ==========================================================================
     MENU BAR
     ========================================================================== */
  #menu-wrapper {
    background: var(--brand-blue, #184484);
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .menu-flex {
    display: flex;
    align-items: stretch;
  }
  .menu-home-btn {
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #fff;
    font-size: 20px;
    background: rgba(0,0,0,0.15);
    transition: background 0.2s;
    border-right: 1px solid rgba(255,255,255,0.1);
  }
  .menu-home-btn:hover {
    background: var(--brand-pink, #d81b60);
    color: #fff;
  }
  .menu-container-inner {
    flex: 1;
    /* FIX: Changed overflow hidden to visible to allow dropdowns to flow over content */
    overflow: visible !important; 
  }
  
  /* Reset OpenCart Default Menu Styles */
  #menu { 
    background: transparent !important; 
    background-image: none !important;
    border: none !important; 
    min-height: 0 !important; 
    margin: 0 !important; 
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    /* FIX: Ensure the menu container doesn't clip its children */
    overflow: visible !important;
  }

  /* Desktop Menu Constraints */
  @media (min-width: 992px) {
    #menu .nav {
      display: flex !important;
      flex-wrap: nowrap !important; /* Forces a single line */
      align-items: center;
      /* FIX: Changed overflow-x auto to visible so dropdowns aren't hidden */
      overflow: visible !important; 
    }
    #menu .nav > li {
      flex: 0 0 auto;
      /* FIX: Ensure parent li allows absolute children (dropdowns) to show */
      position: relative;
    }
    #menu .nav > li > a { 
      color: #fff !important; 
      text-shadow: none !important; 
      padding: 12px 18px !important; 
      font-weight: 600 !important; 
      font-size: 14px !important;
      white-space: nowrap !important;
      transition: background 0.2s !important; 
    }
    /* FIX: Unify hover, focus, and open states to prevent 'stuck pink' issue */
    #menu .nav > li > a:hover,
    #menu .nav > li > a:focus,
    #menu .nav > li.open > a { 
      background: rgba(0,0,0,0.2) !important; 
      color: #fff !important; 
    }
    /* FIX: Ensure OpenCart dropdown menus sit correctly and aren't hidden */
    #menu .dropdown-menu {
      z-index: 2000 !important;
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      visibility: visible !important;
      opacity: 1 !important;
    }
    #menu .dropdown:hover > .dropdown-menu {
      display: block;
    }
  }

  /* ==========================================================================
     BANNERS SECTION (Scrolls away)
     ========================================================================== */
  #banners-section {
    position: relative;
    z-index: 1030;
  }
  .delivery-banner-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
  }
  .delivery-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
  }
  .banner-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
  }
  .banner-item i {
    color: var(--brand-pink, #d81b60);
    font-size: 28px;
  }
  .banner-item .highlight {
    color: var(--brand-pink, #d81b60);
    font-weight: 700;
  }
  .banner-item .coupon-code {
    display: inline-block;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(135deg, #d81b60 0%, #e91e63 100%);
    padding: 4px 10px;
    border-radius: 4px;
    margin-left: 6px;
    white-space: nowrap;
  }
  .help-banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    background: var(--brand-blue, #184484);
    color: #fff;
    padding: 10px 0;
  }
  .help-banner-content i { font-size: 18px; color: var(--brand-pink, #d81b60); }
  .help-banner-content strong {
    font-weight: 700;
    color: #fff;
    font-size: 14px;
  }

  /* ==========================================================================
     MOBILE RESPONSIVE LAYOUT
     ========================================================================== */
  @media (max-width: 991px) {
    
    /* Breadcrumb Mobile Reset: Destroy theme graphics and use text separators */
    .breadcrumb {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 5px 15px !important;
    }
    .breadcrumb li {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .breadcrumb li:after, 
    .breadcrumb li:before {
        display: none !important; /* Hide theme chevrons/arrows */
    }
    .breadcrumb li a {
        background: none !important;
        border: none !important;
        padding: 0 !important;
    }
    /* Add our custom text-only separator back in for nested items */
    .breadcrumb li + li:before {
        display: inline-block !important;
        content: ">" !important;
        padding: 0 8px !important;
        color: #999 !important;
        font-weight: bold !important;
    }

    /* Strict Lock on Top Bar Height & Alignment */
    #top-bar {
        height: 54px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        border-bottom: none !important;
    }
    .top-bar-container {
        padding: 0 15px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    /* Perfect Center Alignment for Phone */
    .mobile-menu-icon {
        font-size: 24px !important;
        color: #fff !important;
        cursor: pointer !important;
        width: 75px !important; /* Bump width to match the right actions block (75px) so the phone number remains perfectly centered */
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    .top-bar-phone {
        flex: 1 1 auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin-right: 0 !important; /* Reset desktop auto margin */
    }
    .prominent-phone {
        font-size: 16px !important;
    }
    .mobile-actions-group {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        width: 75px !important;
        gap: 15px !important;
    }
    .mobile-wishlist-icon,
    .mobile-checkout-icon {
        color: #fff !important;
        font-size: 22px !important;
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        text-decoration: none !important;
        transition: color 0.2s;
    }
    
    #mobile-cart-badge {
        position: absolute;
        top: -6px;
        right: -2px;
        background: var(--brand-pink, #d81b60);
        color: #fff;
        font-size: 11px;
        font-weight: 800;
        padding: 2px 5px;
        border-radius: 12px;
        min-width: 18px;
        text-align: center;
        line-height: 1.2;
    }

    /* Eradicate all rogue whitespace in main header */
    header, #main-header {
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
    }
    .header-grid {
        flex-direction: column !important;
        align-items: center !important;
        padding: 5px 15px 10px 15px !important; /* Brutally tight padding */
        gap: 10px !important; /* Minimal space between logo and search */
        margin: 0 !important;
    }
    
    /* Logo Configuration */
    .grid-logo { 
        margin: 0 auto !important;
        display: block !important;
        text-align: center !important;
        width: 100% !important;
        padding: 0 !important;
    }
    .grid-logo img { 
        max-height: 48px !important; 
        margin: 0 auto !important;
    }
    
    /* Search Configuration */
    .grid-search { 
        width: 100% !important; 
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Fix Menu Opening Position - Anchor perfectly to bottom of the 54px top bar */
    #menu-wrapper {
        position: absolute !important;
        top: 54px !important; 
        left: 0 !important;
        width: 100% !important;
        background: transparent !important;
        border: none !important;
        z-index: 1050 !important;
    }
    #menu .navbar-collapse {
        background: var(--brand-blue, #184484) !important;
        max-height: calc(100vh - 54px) !important; 
        overflow-y: auto !important;
        border-top: 1px solid rgba(255,255,255,0.1) !important;
        box-shadow: 0 10px 15px rgba(0,0,0,0.2) !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Fix Bootstrap 3 Tablet Conflict (Forces menu open above 768px by default) */
    #menu .navbar-collapse.collapse {
        display: none !important;
        height: auto !important;
    }
    #menu .navbar-collapse.collapse.in {
        display: block !important;
    }
    
    /* Hide Desktop Elements Completely */
    .grid-actions {
        display: none !important;
    }
    #menu .navbar-header { 
        display: none !important; 
    }
    
    /* Dismantle horizontal nav logic for mobile dropdown */
    #menu .nav {
        display: block !important;
        flex-direction: column !important;
        white-space: normal !important;
        margin: 0 !important;
    }
    #menu .nav > li {
        display: block !important;
        width: 100% !important;
    }
    #menu .nav > li > a { 
        color: #fff !important; 
        padding: 14px 20px !important; 
        border-bottom: 1px solid rgba(255,255,255,0.1) !important; 
        white-space: normal !important;
        display: block !important;
    }
    /* FIX: Unify hover, focus, and open states for mobile as well */
    #menu .nav > li > a:hover,
    #menu .nav > li > a:focus,
    #menu .nav > li.open > a { 
        background: rgba(0,0,0,0.2) !important; 
        color: #fff !important; 
    }

    /* Mobile Auto-Rotating Banners */
    .delivery-banner-container {
        padding: 8px 0 !important;
    }
    .delivery-banner-content {
      display: block;
      margin: 0;
      position: relative;
      min-height: 55px;
    }
    .banner-item {
      display: none !important; /* Hidden by default */
      width: 100%;
      background: #fff;
      padding: 10px;
      border-radius: 6px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.1);
      animation: bannerFadeIn 0.4s ease-out forwards;      justify-content: flex-start;
    }
    .banner-item.active-banner {
      display: flex !important;
    }
    @keyframes bannerFadeIn {
      from { opacity: 0; transform: translateY(2px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .banner-item i {
      font-size: 24px;
      min-width: 24px;
    }
    .help-banner-content {
      padding: 12px 10px;
      font-size: 14px;
    }
  }

  @media (max-width: 576px) {
    .banner-item { font-size: 12px; }
    .banner-item i { font-size: 22px; }
  }

/* --- Styles from common/footer --- */

footer h5 {
    font-size: clamp(14px, 1vw + 10px, 16px) !important;
    font-weight: 700;
    color: #ffffff; /* Contrast fix: White text for dark backgrounds */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

footer a,
footer p {
    font-size: clamp(12px, 1vw + 6px, 13px);
    color: #cccccc; /* Make links readable against a dark background */
    transition: color 0.2s;
}

footer a:hover {
    color: var(--brand-pink, #d81b60);
    text-decoration: none;
}



.footer-details {
        text-align: center;
        font-size: 13px;
        line-height: 1.6;
      }
      .footer-details a {
        text-decoration: underline;
      }
      /* New CSS rule to assemble the email address visually */
      .email-obfuscate::before {
        content: attr(data-user) "@" attr(data-domain);
      }
      .footer-details .separator {
        margin: 0 5px;
      }
      .copyright-notice {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #e7e7e7;
        font-size: 12px;
      }


/* --- Container Width Overrides (from legacy custom.css) --- */
@media (min-width:1600px) {
    .container {
        width: 1570px;
    }
}
@media (min-width:1900px) {
    .container {
        width: 1870px;
    }
}
@media (min-width:992px) {
    .header-left {
        padding-right: 0px;
    }
    .header-right {
        padding-left: 0px;
    }
}
@media (max-width:991px) {
    .header-left {
        padding-bottom: 2px;
    }
    .header-right {
        padding-bottom: 2px;
    }
}
