/* =========================================
   COLORS.CSS - Color Picker, Swatches, Selection
   V22.1 - Restored from v5.1.2 + Live Color Dots & Stock Indicators
   ========================================= */

/* Component Tabs */
.component-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
}

.component-tab {
    background: var(--light);
    border: 1.5px solid var(--border);
    padding: 0.5rem 0.65rem;
    min-height: 42px;
    border-radius: 9px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.2;
    box-sizing: border-box;
}

.component-tab .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--secondary);
    line-height: 1;
}

.component-tab .icon svg {
    width: 17px;
    height: 17px;
    display: block;
    margin: auto;
}

.comp-tab-label {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.2;
    min-width: 0;
    flex: 1 1 auto;
}

.comp-tab-name {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.component-tab .sub-text {
    display: block;
    font-size: 0.56rem;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
    line-height: 1.15;
}

.comp-color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(74, 59, 50, 0.22);
    background: transparent;
    flex-shrink: 0;
    margin-left: auto;
    transition: all 0.2s ease;
}

.comp-color-dot.is-empty {
    width: 12px;
    height: 12px;
    border-style: dashed;
    opacity: 0.55;
}

.comp-color-dot.has-color {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

.component-tab:hover {
    border-color: var(--accent);
}

.component-tab.active {
    background: linear-gradient(135deg, #FFFBF6 0%, #F7EFE4 100%) !important;
    border-color: var(--accent) !important;
    color: var(--primary) !important;
    box-shadow: 0 3px 10px rgba(122, 84, 64, 0.25) !important;
    transform: translateY(-1px);
}

.component-tab.active .icon {
    color: var(--primary);
}

.component-tab.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Color Section Subtitle */
.color-section-subtitle {
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 0.6rem;
    font-weight: 500;
}

/* Color Divider */
.color-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #E5E0DB 20%, #E5E0DB 80%, transparent 100%);
    margin: 0.75rem 0;
}

/* Color Search */
.color-search {
    width: 100%;
    padding: 0.52rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.76rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
    font-family: var(--font-body);
}

.color-search:focus {
    outline: none;
    border-color: var(--accent);
}

.color-count {
    font-size: 0.62rem;
    color: var(--text-light);
    margin-left: auto;
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    row-gap: 8px;
    column-gap: 8px;
    max-height: 250px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 32px 8px 10px 8px;
    -webkit-overflow-scrolling: touch;
    background: #FFFFFF !important;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Color Swatch */
.color-swatch {
    width: 100%;
    min-width: 0 !important;
    padding-bottom: 100%;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    box-sizing: border-box !important;
}

.color-swatch:hover {
    transform: scale(1.08);
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-swatch:active {
    transform: scale(0.92);
}

.color-swatch.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--primary);
    transform: scale(1.05);
}

.color-swatch.is-pattern-swatch {
    border: 2px solid rgba(139, 115, 85, 0.4);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.color-swatch.is-pattern-swatch.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--primary);
}

.color-swatch::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 34, 30, 0.96);
    color: #FFFFFF;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.62rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.color-swatch:hover::after {
    opacity: 1;
}

/* Current Selection */
.current-selection {
    background: var(--light);
    border-radius: 10px;
    padding: 0.55rem;
    border: 1px solid var(--border);
    margin-top: 0.5rem;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
}

.selection-item {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    background: #FFFFFF;
    padding: 0.4rem;
    border-radius: 7px;
    border: 1px solid var(--border);
}

.selection-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
}

.selection-info {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
    overflow: hidden;
}

.selection-name {
    font-size: 0.54rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.selection-code {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
}

/* Selection Code Full */
.selection-code-full {
    display: flex;
    flex-direction: column;
    gap: 0.02rem;
}

.selection-color-name {
    font-size: 0.64rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selection-color-code {
    font-size: 0.54rem;
    color: var(--text-light);
}

/* Color picker section specific */
#groupColorPicker {
    padding-bottom: 0.6rem;
}

#groupColorPicker .color-search {
    margin-top: 0.5rem;
    margin-bottom: 0.6rem;
}

#groupColorPicker .current-selection {
    margin-top: 0.9rem;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--border);
}

/* Tablet */
@media (min-width: 600px) and (max-width: 1024px) {
    .component-tabs { grid-template-columns: repeat(3, 1fr); }
    .color-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        overflow-x: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Desktop */
@media (min-width: 900px) {
    .component-tabs { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 768px) {
    .color-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        padding: 24px 6px 10px 6px !important;
        gap: 6px !important;
        overflow-x: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .component-tabs {
        gap: 0.35rem;
    }
    .component-tab {
        padding: 0.55rem 0.35rem;
        font-size: 0.68rem;
    }
}

/* Small mobile */
@media (max-width: 380px) {
    .component-tabs { gap: 0.25rem; }
    .component-tab { padding: 0.4rem 0.25rem; font-size: 0.6rem; }
}

/* =========================================
   V4 PREMIUM STOCK WARNING & SELECTION UI
   ========================================= */

/* Stock Notification Banner */
.stock-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #FFFDF5;
    border: 1px solid #FFE58F;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    margin: 0.4rem 0 0.6rem 0;
    font-size: 0.72rem;
    color: #614700;
    box-shadow: 0 2px 8px rgba(250, 173, 20, 0.12);
    transition: all 0.25s ease;
    animation: slideDownFade 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.stock-banner.out-of-stock-mode {
    background: #FFF8F7;
    border-color: #FFA39E;
    color: #820014;
    box-shadow: 0 2px 8px rgba(245, 34, 45, 0.12);
}

.stock-banner.hidden {
    display: none !important;
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.stock-banner-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: #FFF1B8;
    color: #AD6800;
    border: 1px solid #FFE58F;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stock-banner.out-of-stock-mode .stock-banner-pill {
    background: #FFCCC7;
    color: #A8071A;
    border-color: #FFA39E;
}

.stock-banner-text {
    font-size: 0.72rem;
    line-height: 1.35;
    word-break: break-word;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot-amber {
    background: #D48806;
}

.status-dot-red {
    background: #CF1322;
}

/* Swatch Indicators */
.color-swatch.low-stock::before {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    background: #FAAD14;
    border-radius: 50%;
    border: 1px solid #FFFFFF;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.color-swatch.out-of-stock {
    opacity: 0.52;
    cursor: not-allowed;
    filter: grayscale(0.25);
    background-image: linear-gradient(
        135deg,
        transparent 46%,
        rgba(207, 19, 34, 0.7) 47%,
        rgba(207, 19, 34, 0.7) 53%,
        transparent 54%
    ) !important;
}

.color-swatch.out-of-stock:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.color-swatch.out-of-stock::before {
    content: attr(data-badge);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(207, 19, 34, 0.9);
    color: #FFFFFF;
    font-size: 0.52rem;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 10;
    letter-spacing: 0.02em;
    line-height: 1;
    pointer-events: none;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.color-swatch.out-of-stock:not([data-badge])::before {
    content: "Hết vải";
}

html[lang="en"] .color-swatch.out-of-stock:not([data-badge])::before {
    content: "Out of stock";
}

/* Compact & Sleek Selection Status Badges */
.selection-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    margin-top: 0.15rem;
    width: fit-content;
    line-height: 1.2;
    white-space: nowrap;
}

.selection-status-badge.low-stock {
    background: #FFFBE6;
    color: #D48806;
    border: 1px solid #FFE58F;
}

.selection-status-badge.out-of-stock {
    background: #FFF1F0;
    color: #CF1322;
    border: 1px solid #FFA39E;
}

/* Responsive Fixes for Selection Grid */
@media (max-width: 480px) {
    .selection-grid {
        grid-template-columns: 1fr !important;
        gap: 0.35rem !important;
    }
    .stock-banner {
        padding: 0.4rem 0.6rem;
        font-size: 0.68rem;
    }
}

/* Color Category Tabs (Feature 27 - M4) */
.color-cat-tabs-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin: 8px 0 10px 0;
}

.color-cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.color-cat-tab {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-body);
}

.color-cat-tab:hover {
    border-color: var(--secondary);
    color: var(--text);
    transform: translateY(-1px);
}

.color-cat-tab:active {
    transform: scale(0.985);
}

.color-cat-tab.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(74, 59, 50, 0.2);
}

.color-cat-pill {
    background: rgba(255, 255, 255, 0.25);
    color: currentColor;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 5px;
    border-radius: 999px;
    line-height: 1.2;
}

.btn-expand-all-colors {
    background: transparent;
    border: 1px dashed var(--accent);
    color: var(--secondary);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-body);
}

.btn-expand-all-colors:hover {
    background: rgba(122, 84, 64, 0.08);
    border-style: solid;
    border-color: var(--accent);
    color: var(--primary);
    transform: translateY(-1px);
}


/* Linshang 1-Line Disclaimer Bar & Popover (Feature 28 - M4) */
.linshang-disclaimer-bar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 12px;
    margin-top: 8px;
    background: rgba(247, 244, 240, 0.85);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.68rem;
    color: var(--text-light);
}

.linshang-short-text {
    line-height: 1.3;
    font-weight: 500;
}

.linshang-popover-btn {
    background: transparent;
    border: none;
    padding: 2px 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: underline;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-body);
    transition: color 0.2s;
}

.linshang-popover-btn:hover {
    color: var(--accent);
}

.linshang-popover-content {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    width: 320px;
    max-width: 90vw;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(74, 59, 50, 0.15);
    z-index: 100;
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--text);
    animation: fadeIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.linshang-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-heading);
}

.linshang-popover-close {
    background: transparent;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0 4px;
    line-height: 1;
}

.linshang-popover-close:hover {
    color: var(--text);
}

/* ==========================================================================
   v7.9.0 REQUIREMENT R13 (A11) - COLOR SWATCH & CATEGORY TAB MORPHING
   Haute Couture Motion Curves: cubic-bezier(0.16, 1, 0.3, 1) & Micro-Interactions
   ========================================================================== */

.color-swatch:active,
.color-cat-tab:active {
    transform: scale(0.97) !important;
}

.color-swatch,
.color-cat-tab {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.25s ease,
                box-shadow 0.25s ease !important;
    will-change: transform;
}

/* ==========================================================================
   v8.0.0 COLOR HARMONY TOOLBAR, TOAST & HISTORY MODAL
   Haute Couture Aesthetics & Micro-Interactions
   ========================================================================== */

.color-harmony-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    margin: 14px 16px 20px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 243, 235, 0.92) 100%);
    border: 1px solid rgba(122, 84, 64, 0.4);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(100, 75, 55, 0.06), 0 1px 3px rgba(122, 84, 64, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.color-harmony-toolbar:hover {
    border-color: rgba(122, 84, 64, 0.65);
    box-shadow: 0 6px 22px rgba(100, 75, 55, 0.1);
}

.harmony-toolbar-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.harmony-sparkle-icon {
    font-size: 1.25rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(122, 84, 64, 0.4));
    animation: sparklePulse 3s ease-in-out infinite;
}

@keyframes sparklePulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
    50% { transform: scale(1.15) rotate(8deg); opacity: 1; }
}

.harmony-text-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.harmony-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary, #2C2420);
    letter-spacing: 0.02em;
    font-family: var(--nhe-font-body);
    line-height: 1.25;
}

.harmony-subtitle {
    font-size: 0.68rem;
    color: var(--text-light, #7C6E65);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.harmony-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-random-harmony,
.btn-harmony-history {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    line-height: 1.2;
    outline: none;
    user-select: none;
}

.btn-random-harmony {
    background: linear-gradient(135deg, var(--nhe-accent) 0%, var(--nhe-coffee-500) 100%);
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(122, 84, 64, 0.3);
}

.btn-random-harmony:hover {
    background: linear-gradient(135deg, #CEAA7D 0%, #B58A5B 100%);
    box-shadow: 0 4px 12px rgba(122, 84, 64, 0.45);
    transform: translateY(-1px);
}

.btn-random-harmony:active {
    transform: translateY(1px) scale(0.98);
}

.btn-random-harmony svg {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-random-harmony:hover svg {
    transform: rotate(45deg);
}

.btn-harmony-history {
    background: #FFFFFF;
    color: var(--primary, #2C2420);
    border: 1px solid rgba(122, 84, 64, 0.35);
    position: relative;
}

.btn-harmony-history:hover {
    background: rgba(122, 84, 64, 0.08);
    border-color: rgba(122, 84, 64, 0.65);
    color: var(--accent, var(--nhe-coffee-500));
    transform: translateY(-1px);
}

.btn-harmony-history:active {
    transform: translateY(1px) scale(0.98);
}

.harmony-history-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--nhe-coffee-500);
    color: #FFFFFF !important;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    min-width: 18px;
    line-height: 1;
    text-align: center;
    border-radius: 50%;
    padding: 0;
    margin-left: 5px;
    box-sizing: border-box;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Floating Toast Notification - Metallic Glass Theme */
.harmony-active-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 243, 235, 0.98) 100%);
    color: var(--primary, #2C2420);
    border: 1px solid rgba(122, 84, 64, 0.45);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(100, 75, 55, 0.15), 0 2px 6px rgba(122, 84, 64, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 90vw;
}

.harmony-active-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.harmony-toast-sparkle {
    font-size: 1.1rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(122, 84, 64, 0.5));
}

.harmony-toast-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.harmony-toast-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary, #2C2420);
    letter-spacing: 0.01em;
    font-family: var(--nhe-font-body);
    line-height: 1.2;
}

.harmony-toast-scope {
    font-size: 0.72rem;
    color: #7A5C3D;
    font-weight: 500;
    opacity: 0.85;
}

/* History Modal */
.nhe-harmony-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(28, 22, 18, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nhe-harmony-modal-card {
    background: #FFFFFF;
    border: 1px solid rgba(122, 84, 64, 0.3);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 48px rgba(36, 28, 24, 0.25);
    overflow: hidden;
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpModal {
    from { transform: translateY(20px) scale(0.97); }
    to { transform: translateY(0) scale(1); }
}

.nhe-harmony-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(122, 84, 64, 0.15);
    background: #FAF7F2;
}

.nhe-harmony-modal-title {
    font-family: var(--nhe-font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary, #2C2420);
    margin: 0;
}

.nhe-harmony-modal-close {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-light, #7C6E65);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nhe-harmony-modal-close:hover {
    color: var(--primary, #2C2420);
    background: rgba(122, 84, 64, 0.15);
}

.nhe-harmony-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nhe-harmony-modal-body::-webkit-scrollbar {
    width: 5px;
}

.nhe-harmony-modal-body::-webkit-scrollbar-thumb {
    background: rgba(122, 84, 64, 0.3);
    border-radius: 999px;
}

.nhe-harmony-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #FAF7F2;
    border: 1px solid rgba(122, 84, 64, 0.2);
    transition: all 0.2s ease;
}

.nhe-harmony-history-item:hover {
    border-color: rgba(122, 84, 64, 0.5);
    background: #F5EFE6;
    transform: translateY(-1px);
}

.harmony-history-swatches {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.harmony-history-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    background-size: cover;
    background-position: center;
}

.harmony-history-info {
    flex: 1;
    min-width: 0;
}

.harmony-history-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary, #2C2420);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.harmony-history-meta {
    font-size: 0.65rem;
    color: var(--text-light, #7C6E65);
    margin-top: 2px;
}

.btn-apply-history {
    background: linear-gradient(135deg, var(--nhe-accent) 0%, var(--nhe-coffee-500) 100%);
    color: #FFFFFF !important;
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-apply-history:hover {
    opacity: 0.92;
    transform: scale(1.03);
}

.nhe-harmony-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid rgba(122, 84, 64, 0.15);
    background: #FAF7F2;
}

.btn-clear-history,
.btn-close-modal {
    padding: 6px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-history {
    background: transparent;
    border: 1px dashed rgba(122, 84, 64, 0.5);
    color: var(--nhe-coffee-500);
}

.btn-clear-history:hover {
    border-style: solid;
    background: rgba(122, 84, 64, 0.1);
}

.btn-close-modal {
    background: #E8E2D9;
    border: none;
    color: var(--primary, #2C2420);
}

.btn-close-modal:hover {
    background: #DDD5C9;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .color-harmony-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px;
        margin: 12px 12px 16px 12px;
        gap: 12px;
    }

    .harmony-btn-group {
        width: 100%;
        justify-content: flex-start;
    }

    .btn-random-harmony,
    .btn-harmony-history {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.72rem;
    }

    .harmony-active-toast {
        bottom: calc(75px + env(safe-area-inset-bottom, 16px));
        padding: 10px 16px;
        gap: 10px;
        max-width: 92vw;
    }

    .nhe-harmony-modal-card {
        max-width: 95vw;
        max-height: 88vh;
    }
}


/* v8.1.9: Enforce square aspect ratio and cover for pattern swatches */
.color-swatch.is-pattern-swatch {
    aspect-ratio: 1 / 1 !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}
.color-swatch.is-pattern-swatch:not(.out-of-stock) {
    background-image: inherit;
}
