/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/



/**
 * Loading Overlay Styles
 * High-performance frosted glass (Glassmorphism) effect
 */
#ft-loading-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  
  /* For Light Mode */
  background-color: rgba(255, 255, 255, 0.7); 
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); /* Required for Safari */

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: 40px;
  text-align: center;
}

/* Dark Mode adjustment for the frosted glass */
[data-brx-theme="dark"] #ft-loading-overlay {
  background-color: rgba(16, 24, 40, 0.75); /* Matches your #101828 with transparency */
}

#ft-loading-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Spinner Styles */
#ft-loading-overlay .ft-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 0, 0, 0.05);
  border-top: 3px solid var(--ft-link-color);
  border-radius: 50%;
  animation: ft-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin-bottom: 24px;
}

[data-brx-theme="dark"] #ft-loading-overlay .ft-spinner {
  border-color: rgba(255, 255, 255, 0.1);
  border-top-color: var(--ft-link-color);
}

/* Message Typography */
.ft-overlay-msg {
  font-family: inherit;
  font-size: 1.15rem;
  color: var(--ft-text-color);
  max-width: 340px;
  line-height: 1.6;
  font-weight: 500;
  margin-bottom: 30px;
  transition: opacity 0.3s ease;
}

/* Button UI */
.ft-reload-btn {
  display: none;
  padding: 12px 32px;
  background: var(--ft-button-primary-bg);
  color: var(--ft-button-primary-text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes ft-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/**
 * Offline Overlay Styles
 * Refined for balanced button sizing and typography
 */
#ft-offline-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

[data-brx-theme="dark"] #ft-offline-overlay {
    background-color: rgba(16, 24, 40, 0.8);
}

#ft-offline-overlay.ft-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Card UI: Slightly narrowed for better text flow */
.ft-offline-content {
    background-color: var(--ft-card-bg);
    text-align: center;
    padding: 2rem; /* Balanced padding */
    max-width: 400px; /* Narrower card feels more modern */
    width: 90%;
    border-radius: 12px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
    border: 1px solid color-mix(in srgb, var(--ft-text-color), transparent 90%);
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#ft-offline-overlay.ft-visible .ft-offline-content {
    transform: translateY(0);
}

.ft-offline-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem; /* Slightly smaller title */
    font-weight: 700;
    color: var(--ft-text-color);
}

.ft-offline-message {
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ft-text-color);
    opacity: 0.7;
}

/* Actions: Consistent height and alignment */
.ft-offline-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.ft-offline-btn {
    /* Fixed height ensures they look identical regardless of text */
    height: 42px; 
    padding: 0 1.25rem;
    cursor: pointer;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem; /* Clean, smaller text */
    white-space: nowrap; /* Prevents text from wrapping to 2 lines */
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1; /* Both buttons take equal space */
}

.ft-offline-btn-refresh {
    background-color: var(--ft-button-primary-bg);
    color: var(--ft-button-primary-text);
}

.ft-offline-btn-login {
    background-color: transparent;
    color: var(--ft-text-color);
    border: 1px solid color-mix(in srgb, var(--ft-text-color), transparent 80%);
}

.ft-offline-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

@media (max-width: 400px) {
    .ft-offline-actions {
        flex-direction: column;
    }
    .ft-offline-btn {
        width: 100%;
        flex: none;
    }
}

/* hidden-by-default horizontal scrollbar
Apply to any element with class .ft-scroll-styling */

.ft-scroll-styling {
  overflow-x: auto;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* Old Edge / IE */
}

/* Chrome / Safari */
.ft-scroll-styling::-webkit-scrollbar {
  height: 0;
}

/* Reveal on hover */
.ft-scroll-styling:hover {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.35) transparent;
}

.ft-scroll-styling:hover::-webkit-scrollbar {
  height: 6px;
}

.ft-scroll-styling::-webkit-scrollbar-track {
  background: transparent;
}

.ft-scroll-styling::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,.35);
  border-radius: 10px;
}

.ft-scroll-styling::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0,0,0,.5);
}


/* Form Validation */

/* --- Input Error Highlight --- */
.ft-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* --- Inline Error Message --- */
.ft-error-message {
    color: #ef4444;
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
    display: block;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease-out;
}

.ft-error-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.heading-line {
  position: relative;
  display: block;
  width: 100px;
  height: 4px;
  margin-top: 0.2rem;
}

.heading-line::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;

  background-image: linear-gradient(
    90deg,
    var(--ft-button-primary-bg),
    #6dd5fa,
    #a855f7
  );
}


/* Popup */
.brx-popup-backdrop {
    background-color: rgb(0 0 0 / 30%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.3s ease-in-out, backdrop-filter 0.3s ease-in-out;
}


/* ------------------------------------------------------------- */
/* 1. Base styles for all custom menu items                       */
/* ------------------------------------------------------------- */
li[class^="menu-icon-"] > a {
  display: flex;                 /* put icon + text in a row */
  align-items: center;           /* vertical centering */
  justify-content: flex-start !important;
  padding-left: 0 !important;    /* remove default gutter */
}

/* define a CSS variable for the icon character */
li[class^="menu-icon-"] {
  --ti: "";
}

/* shared icon styling */
li[class^="menu-icon-"] > a::before {
  font-family: "themify";        /* Themify icon font */
  content: var(--ti);            /* pull in the correct glyph */
  margin-right: 0.8em;           /* spacing between icon and text */
  font-size: 1.5rem;               /* icon size */
  display: inline-block;
  line-height: 1;                /* keep height consistent */
  padding-left: var(--space-2xs);            /* optional left indent */
  margin-top: auto;
  margin-bottom: auto;           /* ensure vertical balance */
}

/* ------------------------------------------------------------- */
/* 2. Individual icon assignments                                */
/* ------------------------------------------------------------- */
li.menu-icon-sales-dashboard           { --ti: "\e673"; }
li.menu-icon-inventory-dashboard { --ti: "\e6bf"; }
li.menu-icon-manage-inventory     { --ti: "\e687"; }
li.menu-icon-add-new-item     { --ti: "\e61a"; }
li.menu-icon-bulk-add-items     { --ti: "\e62f"; }
li.menu-icon-manage-sales     { --ti: "\e608"; }
li.menu-icon-record-a-sale     { --ti: "\e64d"; }
li.menu-icon-storage-location-updater    { --ti: "\e693"; }
/* ------------------------------------------------------------- */
/* 3. General fixes                                               */
/* ------------------------------------------------------------- */
/* push dropdown chevron/arrow to far right */
.x-slide-menu_dropdown-icon {
  margin-left: auto;
}

/* indent submenu items for hierarchy clarity */
.sub-menu {
  margin-left: var(--space-2xs) !important;
}


/* Bulk Add Items Styling */

/* Bulk Add Wrapper */
.ft-bulk-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: var(--space-s);
}

.ft-bulk-wrapper * {
    box-sizing: border-box;
}

/* Queue Section */
.ft-queue-section {
    border: 1px solid var(--ft-button-border);
    border-radius: var(--radius-lg);
    background: var(--ft-card-bg);
    overflow: hidden;
    margin-bottom: var(--space-s);
    display: block; 
    scroll-margin-top: calc(var(--ft-horizontal-menu-height) + 20px);
}

.ft-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--ft-card-footer-bg);
    min-height: 50px;
    transition: background-color 0.3s;
}

.ft-summary-stats {
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.ft-stat-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
}

.ft-stat-label {
    font-size: var(--step--2);
    font-weight: 600;
    color: var(--ft-text-color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ft-stat-value {
    font-size: var(--step-0);
    font-weight: 700;
    color: var(--ft-text-color);
}

.ft-stat-divider {
    width: 1px;
    height: 24px;
    background: var(--ft-card-border);
}

.ft-summary-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ft-btn-delete-all {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--ft-error-border);
    border-radius: var(--radius-md);
    font-size: var(--step-0);
    font-weight: 600;
    color: var(--ft-error-icon);
    cursor: pointer;
    transition: all 0.2s;
}

.ft-btn-delete-all:hover {
    background: var(--ft-error-bg);
    color: var(--ft-error-icon);
}

.ft-btn-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--ft-button-secondary-bg);
    border: 1px solid var(--ft-button-border);
    border-radius: var(--radius-md);
    font-size: var(--step-0);
    font-weight: 600;
    color: var(--ft-button-secondary-text);
    cursor: pointer;
    transition: all 0.2s;
}

.ft-btn-toggle:hover {
    background: var(--ft-button-secondary-bg-hover);
    color: var(--ft-button-secondary-text);
}

/* List Table/Cards */
.ft-list-wrapper {
    border-top: 1px solid var(--ft-card-border);
    background: var(--ft-card-bg);
}

.ft-table-desktop {
    width: 100%;
}

.ft-table-head {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 0.6fr 90px;
    gap: 12px;
    padding: 10px 16px;
    background: var(--ft-card-footer-bg);
    border-bottom: 0.3px solid var(--ft-button-border);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ft-text-color-secondary);
    text-transform: uppercase;
}

.ft-table-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 0.6fr 90px;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ft-card-border);
    align-items: center;
}

.ft-table-row:last-child {
    border-bottom: none;
}

.ft-text-main {
    font-size: var(--step-0);
    color: var(--ft-text-color);
    font-weight: 500;
}

.ft-text-sub {
    font-size: var(--step--1);
    color: var(--ft-text-color-secondary);
    display: block;
    margin-top: 2px;
    margin-bottom: 2px;
}

.ft-center {
    text-align: center;
}

.ft-row-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.ft-btn-del, .ft-btn-edit {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.ft-btn-del {
    color: var(--ft-error-icon);
}

.ft-btn-edit {
    color: var(--ft-info-icon);
}

.ft-btn-del:hover {
    background: var(--ft-error-bg);
}

.ft-btn-edit:hover {
    background: var(--ft-info-bg);
}

/* Mobile List */
.ft-mobile-list {
    display: none;
    padding: 12px;
    gap: 12px;
}

.ft-mobile-card {
    border: 1px solid var(--ft-card-border);
    border-radius: 8px;
    padding: 12px;
    background: var(--ft-card-footer-bg);
}

.ft-m-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.ft-m-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ft-text-color);
    word-break: break-word;
}

.ft-m-actions {
    display: flex;
    gap: 4px;
}

.ft-m-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ft-m-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ft-text-color-secondary);
    text-transform: uppercase;
}

/* Input Section */
.ft-input-container {
padding: 0 0 25px 0; /* Updated: Added 25px bottom padding */
    position: relative;   /* Ensures the padding contains the space correctly */
}

.ft-input-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 0.6fr auto;
    gap: 12px;
    align-items: stretch;
}

.ft-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    justify-content: flex-start;
    /* Ensure stacking context for helper z-index */
    isolation: isolate; 
}

.ft-col-action {
    justify-content: flex-end; 
    padding-bottom: 0; 
}

.ft-field-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ft-text-color-secondary);
}

/* Fake Input Styling */
.ft-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid var(--ft-form-input-border-color);
    border-radius: 6px;
    background: var(--ft-form-input-bg-color);
    color: var(--ft-form-input-text);
    min-height: 40px; 
    line-height: 1.5;
    transition: border-color 0.2s;
    cursor: text;
    
    /* Strict Single Line Enforcement */
    overflow: hidden;
    white-space: nowrap;
    display: block;
}

.ft-input br {
    display: none;
}

.ft-input:focus {
    outline: none;
    border-color: var(--ft-button-primary-bg);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.ft-input:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
    display: block;
}

/* Helper Text Styling */
.ft-input-helper {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px; /* Slight gap */
    font-size: 0.7rem;
    color: var(--ft-text-color-secondary);
    font-weight: 600;
    z-index: 20; /* High z-index to sit ON TOP of the row below it */
    pointer-events: none;
    white-space: nowrap;
}

.ft-btn-add {
    height: 40px;
    padding: 0 24px;
    background: var(--ft-button-primary-bg);
    color: var(--ft-button-primary-text);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.ft-btn-add:hover {
    opacity: 0.9;
}

.ft-btn-success {
    background-color: var(--ft-success-bg) !important;
    transform: scale(1.02);
}

@keyframes ftShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes ftFlash {
    0% { background-color: rgba(16, 185, 129, 0.2); }
    100% { background-color: var(--ft-card-footer-bg); }
}

.ft-error-shake {
    animation: ftShake 0.3s ease-in-out;
    border-color: var(--ft-error-border) !important;
}

.ft-flash-success {
    animation: ftFlash 1s ease-out;
}

@media (max-width: 1024px) {
    .ft-input-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ft-col-name { grid-column: 1 / -1; }
    .ft-col-action { 
        grid-column: 1 / -1; 
        margin-top: 30px;
    }
    .ft-col-qty{
        grid-column: 1 / -1; 
    padding-top: 8px;
    }
    .ft-btn-add { width: 100%; }
    
    .ft-table-desktop { display: none; }
    .ft-mobile-list { display: flex; flex-direction: column; }
    
    .ft-summary-bar { flex-direction: column; gap: 12px; align-items: stretch; }
    .ft-summary-stats { justify-content: space-between; gap: 10px; }
    .ft-stat-divider { display: none; }
    .ft-summary-actions { flex-direction: column; width: 100%; }
    .ft-btn-delete-all { justify-content: center; width: 100%; }
    .ft-btn-toggle { justify-content: center; width: 100%; }
}




/* =========================================
   1. View Switcher & Desktop Pills
   ========================================= */

/* Base Container */
.ft-view-switcher {
    width: 100%;
}

/* --- Desktop Pills --- */
.ft-pill-tabs {
    display: flex;
    gap: 6px;
    background: var(--ft-card-footer-bg);
    padding: 6px;
    border-radius: 999px;
    width: max-content; /* Keeps the bar from stretching unnecessarily */
}

.ft-pill-tab {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    color: var(--ft-text-color);
    display: flex;
    align-items: center;
}

.ft-pill-tab:hover {
    background: var(--ft-card-bg);
}

.ft-pill-tab.active {
    background: var(--ft-card-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: var(--ft-text-color);
}

.ft-count {
    margin-left: 8px;
    font-size: 12px;
    opacity: 0.5;
}

/* Hide dropdown on desktop */
.ft-view-dropdown {
    display: none;
}

/* Shared Styles for both Search and Selects */
#ft-item-search, 
#ft-selling-platform-filter,
#ft-source-filter,
#brxe-uvojqh {
    height: 42px;
    padding: 0 16px;
    font-size: 16px;
    font-family: inherit;
    border-radius: 10px;
    border: 1px solid var(--ft-form-input-border-color);
    background-color: var(--ft-form-input-bg-color);
    color: var(--ft-form-input-text);
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
}

/* Specific Styling for Search (Magnifying Glass) */
#ft-item-search {
    padding-left: 40px; /* Room for icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 18px;
    cursor: text;
}

/* Placeholder color for search */
#ft-item-search::placeholder {
    color: var(--ft-form-input-placeholder);
}

/* Specific Styling for Selects (Chevron Arrow) */
#ft-selling-platform-filter,
#ft-source-filter,
#brxe-uvojqh {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px; /* Room for arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

/* Focus States for all */
#ft-item-search:focus, 
#ft-selling-platform-filter:focus,
#ft-source-filter:focus,
#brxe-uvojqh:focus {
    border-color: var(--ft-button-primary-bg);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

@media (max-width: 1024px) {
    .ft-pill-tabs {
        display: none;
    }

    .ft-view-dropdown {
        display: block;
        width: 100%;
    }

    .ft-view-select {
        width: 100%;
        height: 48px;
        font-size: 16px;
        padding: 0 40px 0 16px;
        border-radius: 12px;
        border: 1px solid var(--ft-form-input-border-color);
        background-color: var(--ft-form-input-bg-color);
        color: var(--ft-form-input-text);
        cursor: pointer;
        
        /* Remove default browser arrow */
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;

        /* Add custom chevron arrow */
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 18px;
    }

    .ft-view-select:focus {
        outline: none;
        border-color: var(--ft-button-primary-bg);
        box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
    }
}