/* -------------------------------------------------------------------------------------------------------------------------
   Sitewide Stuff
--------------------------------------------------------------------------------------------------------------------------- */

/* Reset and Base Styles */
html, body, nav, .navbar, .navbar-custom, header, section, ul {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    
}

body {
    margin: 0 !important;
    padding-top: 108px; /* Matches header height */
    padding-bottom: 60px; /* Matches footer height */
    font-family: Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Row */
.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

/* Columns */
.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

/* Display Utilities */
.d-flex {
    display: flex !important;
}

.d-none {
    display: none !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-end {
    justify-content: flex-end !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

@media (min-width: 768px) {
    .d-md-flex {
        display: flex !important;
    }
    .d-md-block {
        display: block !important;
    }
}

@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }
    .d-lg-flex {
        display: flex !important;
    }
    .d-lg-block {
        display: block !important;
    }
}

/* Cards */
.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* Feathered Image */
.feathered-image {
    mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 85%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 1) 85%, rgba(0, 0, 0, 0) 100%);
}

/* Headings */
h2 {
    text-align: center;
    margin-bottom: 20px;
}

/* -------------------------------------------------------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------------------------------------------------------- */

/* Sticky Fixed Header */
.navbar-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3100; /* Above content, below cookie popup */
    background-color: white;
    padding: 8px 0 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Header Container */
.navbar-custom .container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

#navbar-logo {
    width: 112.5px;
    height: auto;
    max-height: 85px;
}

/* Search Bar */
.search-bar-row {
    width: 100%;
    display: flex;
    align-items: center;
}

.search-bar-row .form-control {
    width: 100%;
    font-size: 14px;
    padding: 8px;
    border-radius: 5px;
}

/* Right Side (Desktop: Search + Nav Links/Icons) */
.navbar-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 90px;
    padding-top: 2mm;
}

/* Navigation Row */
.nav-links-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

/* Navigation Links */
.navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.navbar-nav .nav-item {
    display: inline-flex;
}

.navbar-nav .nav-link {
    white-space: nowrap;
    font-size: 14px;
    color: #6c757d;
    text-decoration: none;
    padding: 8px 12px;
    transition: color 0.3s;
}

.navbar-nav .nav-link:hover {
    color: #4caf50;
    text-decoration: underline;
}

.navbar-nav .nav-link.active {
    font-weight: bold;
    color: #4caf50;
}

/* Icon Links */
.nav-item .nav-link.logout-icon-link:hover,
.nav-item .nav-link.logout-icon-link.active,
.nav-item .nav-link.cart-icon-link:hover,
.nav-item .nav-link.cart-icon-link.active {
    color: inherit;
}

/* Icons */
.logout-icon {
    font-size: 20px;
    color: #555;
    transition: color 0.3s;
}

.logout-icon:hover {
    color: #007bff;
}

.cart-icon {
    width: 20px;
    height: 20px;
    transition: opacity 0.3s;
}

.cart-icon:hover {
    opacity: 0.7;
}

.cart-count {
    font-size: 0.8rem;
    color: #6c757d; /* Matches text-muted for consistency */
    margin-left: 5px;
}
/* Toggler (Footer Only) */
.navbar-toggler {
    border: none;
    padding: 0;
    cursor: pointer;
}

.navbar-toggler-icon {
    width: 25px;
    height: 25px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.55)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-size: contain;
}

/* Responsive Header */
@media (max-width: 991px) {
    .navbar-custom {
        padding: 8px 0 10px;
    }
    .search-bar-row.d-lg-none {
        margin: 0;
        padding: 0 10px; /* Slight inset for search bar */
    }
    .navbar-collapse {
        display: none;
    }
    .navbar-collapse.show {
        display: block;
        position: fixed;
        bottom: 60px; /* Align above footer */
        left: 50%; /* Center horizontally */
        transform: translateX(-50%); /* Center offset */
        top: auto;
        width: 200px; /* Fixed width to fit content */
        max-height: 50vh;
        overflow-y: auto;
        background-color: white;
        border: 1px solid #ddd;
        border-radius: 10px 10px 0 0;
        padding: 10px 5px 10px 0; /* Zero left padding */
        box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
        z-index: 3050;
    }
    .navbar-right {
        min-height: auto;
        padding-top: 0;
        justify-content: flex-start; /* Align content left */
    }
    .nav-links-row {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start; /* Align content left */
    }
    .navbar-nav {
        flex-direction: column;
        gap: 5px;
        margin-left: 0 !important; /* Override ms-auto */
        width: 100%; /* Ensure links fill container */
    }
    .navbar-nav .nav-item {
        width: 100%; /* Full width for items */
        margin: 0; /* Remove any margins */
        padding: 0; /* Remove padding */
    }
    .navbar-nav .nav-link {
        padding: 10px 0 10px 5px; /* Minimal left padding */
        width: 100%; /* Links span container */
        text-align: left; /* Explicit left alignment */
    }
    .logout-icon,
    .cart-icon {
        margin-top: 5px;
    }

    @media (max-width: 991px) {
        body {
          padding-top: 30px !important; /* or match actual mobile header height */
        }
    }
}

.search-box {
    border: .5px solid #555 !important; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Optional: subtle shadow */
    border-radius: 6px; /* Slightly rounder */
    padding: 8px 12px; /* More breathing room */
    font-size: 1rem;
    background-color: #d0eaff;
}

/* --------------------------------------------------
   Footer Layout
-------------------------------------------------- */

.footer-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    width: 100%;
    background-color: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    font-size: 14px;
}

/* Footer Buttons */
.footer-icon-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-icon {
    width: 25px;
    height: 25px;
}

.footer-icon-button.navbar-toggler .navbar-toggler-icon {
    width: 25px;
    height: 25px;
}

/* Copyright */
.copyright {
    font-weight: normal;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    margin-left: 8px;
}

.copyright-link {
    color: #333;
    text-decoration: none;
}

.copyright-link:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Twitter (X) icon cleanup */
a.text-dark.fs-4 {
    text-decoration: none;
}
a.text-dark.fs-4:hover {
    color: #007bff;
    text-decoration: none;
}

/* Legal Navigation Links */
.nav-legal {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-legal .nav-item {
    margin: 0;
}

.nav-legal .nav-link {
    padding: 0 10px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    line-height: 1.5;
}

.nav-legal .nav-link:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Chat Button */
.footer-content .mobile-footer-left #chat-button {
    background-color: #0088cc !important;
    color: white !important;
    width: 25px;
    height: 25px;
    font-size: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
    cursor: pointer;
    position: relative;
    z-index: 20;
}

.footer-content .mobile-footer-left #chat-button:hover {
    background-color: #006699 !important; /* Darker blue on hover */
}

/* Chat Container */
#chat-container {
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 3000;
    box-sizing: border-box;
}

#chat-header {
    background: #0088cc;
    color: white;
    padding: 10px;
    font-size: 16px;
    text-align: center;
    border-radius: 10px 10px 0 0;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #f9f9f9;
    word-wrap: break-word;
    -webkit-overflow-scrolling: touch;
}

#chat-messages > div {
    margin-bottom: 8px;
    line-height: 1.4;
}

#chat-messages img {
    vertical-align: middle;
    margin-right: 5px;
}

#chat-messages a {
    color: #007bff;
    text-decoration: underline;
}

#chat-messages a:hover {
    color: #0056b3;
}

#chat-messages::-webkit-scrollbar {
    width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ccc;
}

#chat-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#chat-input button {
    margin-left: 5px;
    padding: 8px;
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Mobile Styles */
@media (max-width: 767px) {
    .footer-content {
        background-size: 50%;
        background-color: #fff;
    }

    .copyright,
    .nav-legal {
        display: none !important;
    }

    #chat-button {
        font-size: 16px;
        width: 25px;
        height: 25px;
    }

    .footer-icon,
    .footer-icon-button.navbar-toggler .navbar-toggler-icon {
        width: 22px;
        height: 22px;
    }

    #chat-container {
        width: 95%;
        left: 2.5%;
        right: auto;
    }
}

@media (max-width: 991px) {
    #navbarCollapse {
      position: fixed;
      bottom: 55px;
      left: 10px;
      width: 200px;
      background-color: white;
      z-index: 2000;
      box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
      padding: 10px;
      border-radius: 10px 10px 0 0;
      border: 1px solid #ccc;
      transition: transform 0.3s ease-in-out;
    }

    #navbarCollapse .navbar-right {
      width: 100% !important;
      max-width: 100% !important;
    }

    #navbarCollapse .search-bar-row {
      width: 100% !important;
      max-width: 100% !important;
    }

    #navbarCollapse input.form-control {
      width: 100% !important;
      font-size: 14px;
      padding: 6px 8px;
    }

    /* Optional: Smooth slide-up effect */
    .collapse:not(.show) {
      transform: translateY(100%);
      visibility: hidden;
      opacity: 0;
    }

    .collapse.show {
      transform: translateY(0);
      visibility: visible;
      opacity: 1;
    }
}

.footer-icon-button {
  background: none;
  border: none;
  padding: 0 8px;
  font-size: 1.3rem;
  color: #555;
}
/* -------------------------------------------------------------------------------------------------------------------------
   Cookie Popup
--------------------------------------------------------------------------------------------------------------------------- */

/* Cookie Consent Overlay */
.cookie-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
}

.cookie-overlay.show {
    display: block;
}

/* Cookie Consent Popup */
.cookie-popup {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    width: 90%;
    background-color: #fff;
    border: 1px solid #ccc;
    border: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 3001;
}

.cookie-popup.show {
    display: block;
}

.cookie-popup p {
    margin: 0 0 15px;
    font-size: 14px;
    color: #333;
}

.cookie-popup button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.cookie-popup button:hover {
    background-color: #0056b3;
}

/* Lock Page Content */
body.locked {
    pointer-events: none !important;
}

body.locked .cookie-overlay,
body.locked .cookie-popup,
body.locked .cookie-popup * {
    pointer-events: auto !important;
}

/* Ensure header and footer remain unaffected */
body.locked .navbar-custom,
body.locked .footer-content {
    pointer-events: auto !important;
    z-index: 3100;
}

/* Responsive Popup */
@media (max-width: 576px) {
    .cookie-popup {
        bottom: 10px;
        padding: 15px;
    }
    .cookie-popup p {
        font-size: 12px;
    }
    .cookie-popup button {
        padding: 8px 15px;
        font-size: 12px;
    }
}

/* -------------------------------------------------------------------------------------------------------------------------
   Login Page
--------------------------------------------------------------------------------------------------------------------------- */

.login-form-container {
    margin-top: 200px; /* Increased to move form further down */
    padding: 0 15px; /* Match .container padding */
}

/* Form container */
.login-form-container .container {
    max-width: 400px;
    width: 100%;
}

/* Form fields */
.login-form-container .form-control {
    font-size: 16px;
    padding: 10px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* Error message */
.login-form-container .alert {
    max-width: 400px;
    margin: 0 auto 20px;
}

/* Button container */
.login-form-container .login-button-container {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin: 0 auto;
}

/* Buttons */
.login-form-container .login-btn {
    width: 48%;
    padding: 10px;
    font-size: 16px;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .login-form-container {
        margin-top: 160px; /* Increased for mobile, smaller header (~80px) */
        padding: 0 10px;
    }

    .login-form-container .container {
        max-width: 100%;
        padding: 0 15px;
    }

    .login-form-container .form-control {
        font-size: 14px;
        padding: 8px;
    }

    .login-form-container .login-btn {
        font-size: 14px;
        padding: 8px;
    }
}


/* -------------------------------------------------------------------------------------------------------------------------
   Other Features
--------------------------------------------------------------------------------------------------------------------------- */

/* Account Panels */
.account-panels .col {
    padding: 6mm;
}

.account-panels .account-panel {
    transform: scale(0.95);
    transition: transform 0.2s, box-shadow 0.2s;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.account-panels .account-panel:hover {
    transform: scale(1.0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.account-panels .card-title {
    font-size: 1.25rem;
    color: #333;
}

@media (max-width: 767px) {
    .account-panels .account-panel {
        margin-bottom: 1rem;
    }
}

/* About Me Modal */
.about-me-modal .modal-dialog {
    max-width: 600px;
    margin: 30px auto;
    transform: none !important;
    position: relative !important;
}

.about-me-modal .modal-content {
    border-radius: 8px;
}

.about-me-modal .modal-body .form-control,
.about-me-modal .modal-body .btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
}

.about-me-modal .modal-body .btn {
    width: 48%;
    margin: 1%;
}

.about-me-modal .modal-body .btn-primary {
    background-color: #4caf50;
    border-color: #4caf50;
}

.about-me-modal .modal-body .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

@media (max-width: 576px) {
    .about-me-modal .modal-dialog {
        max-width: 90%;
        margin: 20px auto;
    }
}