/* WalmShade Frontend Shades Module — Grid, Search, Modal, Favorites, Compare, Print */

/* === Grid Toolbar === */
.walm-color-grid-wrapper {
    margin: 20px 0;
    position: relative;
}
.walm-color-grid-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
}
.walm-grid-search {
    display: flex;
    align-items: center;
    flex: 1 1 240px;
    position: relative;
}
.walm-grid-search-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}
.walm-grid-search-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}
.walm-grid-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
}
.walm-grid-search-btn:hover {
    color: #2271b1;
}
.walm-grid-filters select,
.walm-grid-sort select {
    padding: 7px 28px 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23555'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.walm-grid-filters select:focus,
.walm-grid-sort select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}
.walm-grid-view-switcher {
    display: flex;
    gap: 4px;
    margin-left: auto;
}
.walm-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
}
.walm-view-btn:hover {
    background: #f0f0f0;
    color: #333;
}
.walm-view-btn.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}
.walm-view-btn:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* === Grid Container === */
.walm-color-grid-container {
    position: relative;
    min-height: 200px;
}
.walm-color-grid-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.7);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.walm-color-grid-loader.active {
    opacity: 1;
    pointer-events: auto;
}
.walm-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e2e4e7;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: walm-spin 0.7s linear infinite;
}
@keyframes walm-spin {
    to { transform: rotate(360deg); }
}

/* === Grid View === */
.walm-color-grid {
    display: grid;
    grid-template-columns: repeat(var(--walm-grid-columns, 4), 1fr);
    gap: 14px;
}
.walm-grid-item {
    position: relative;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
}
.walm-grid-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.walm-grid-item:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
.walm-grid-item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #eee;
}
.walm-grid-item-swatch {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 8px;
    border: 2px solid #eee;
}
.walm-grid-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.walm-grid-item-code {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}
.walm-grid-item-name {
    font-size: 12px;
    color: #666;
}
.walm-grid-item-hex {
    font-size: 11px;
    color: #999;
    font-family: 'Courier New', monospace;
}
.walm-grid-item-fav {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    padding: 4px;
    font-size: 16px;
    transition: color 0.15s;
}
.walm-grid-item-fav:hover,
.walm-grid-item-fav.active {
    color: #dc3232;
}
.walm-grid-empty,
.walm-grid-item-fav:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
.walm-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* === List View === */
.walm-color-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.walm-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.walm-list-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.walm-list-item:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
.walm-list-item-image img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}
.walm-list-item-swatch {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}
.walm-list-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.walm-list-item-code {
    font-weight: 600;
    font-size: 14px;
}
.walm-list-item-name {
    font-size: 13px;
    color: #666;
}
.walm-list-item-hex {
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 6px;
}
.walm-mini-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}
.walm-list-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.walm-list-item-actions button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    color: #999;
    transition: all 0.15s;
    font-size: 16px;
}
.walm-list-item-actions button:hover {
    color: #2271b1;
    border-color: #2271b1;
}

/* === Table View === */
.walm-color-table-wrap {
    overflow-x: auto;
}
.walm-color-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
}
.walm-color-table th {
    background: #f8f9fa;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid #e2e4e7;
}
.walm-color-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    vertical-align: middle;
}
.walm-color-table tr:last-child td {
    border-bottom: none;
}
.walm-color-table tr:hover td {
    background: #f8f9fa;
}
.walm-table-swatch {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #ddd;
    vertical-align: middle;
}
.walm-table-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 3px;
    vertical-align: middle;
}
.walm-table-col-code {
    font-weight: 600;
}
.walm-table-col-hex code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}
.walm-table-col-actions {
    white-space: nowrap;
}
.walm-table-col-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 4px;
    font-size: 16px;
}
.walm-table-col-actions button:hover {
    color: #2271b1;
}
.walm-table-empty td {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}

/* === Grid Footer === */
.walm-color-grid-footer {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}
.walm-grid-info {
    font-size: 13px;
    color: #666;
    text-align: center;
    width: 100%;
}
.walm-grid-load-more {
    padding: 10px 24px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.walm-grid-load-more:hover {
    background: #135e96;
}
.walm-grid-load-more:disabled {
    opacity: 0.6;
    cursor: default;
}
.walm-grid-load-more:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
.walm-grid-pagination-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}
.walm-page-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.15s;
}
.walm-page-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}
.walm-page-btn.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}
.walm-page-btn:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
.walm-page-dots {
    padding: 6px 4px;
    color: #999;
}

/* === Live Search === */
.walm-live-search {
    position: relative;
    margin-bottom: 16px;
}
.walm-live-search-field {
    position: relative;
    display: flex;
    align-items: center;
}
.walm-search-icon {
    position: absolute;
    left: 12px;
    color: #999;
    font-size: 18px;
    pointer-events: none;
}
.walm-live-search-input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    border: 2px solid #e2e4e7;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color 0.15s;
}
.walm-live-search-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}
.walm-live-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 4px;
    font-size: 18px;
}
.walm-live-search-clear:hover {
    color: #333;
}
.walm-live-search-spinner {
    position: absolute;
    right: 36px;
    width: 18px;
    height: 18px;
    border: 2px solid #e2e4e7;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: walm-spin 0.7s linear infinite;
}
.walm-live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
}
.walm-live-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s;
}
.walm-live-result:hover,
.walm-live-result.active {
    background: #f0f7ff;
}
.walm-live-result:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}
.walm-live-result-image img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}
.walm-live-result-swatch {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}
.walm-live-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.walm-live-result-code {
    font-weight: 600;
    font-size: 13px;
}
.walm-live-result-name {
    font-size: 12px;
    color: #666;
}
.walm-live-result-hex {
    font-size: 11px;
    color: #999;
    font-family: 'Courier New', monospace;
}
.walm-live-result-card {
    font-size: 11px;
    color: #2271b1;
}
.walm-live-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* === Color Modal === */
.walm-color-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s;
}
.walm-color-modal-overlay.open {
    opacity: 1;
}
.walm-color-modal-overlay.open .walm-color-modal-content {
    transform: translateY(0);
    opacity: 1;
}
.walm-color-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.25s, opacity 0.25s;
    opacity: 0;
}
.walm-color-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: #666;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.15s;
}
.walm-color-modal-close:hover {
    background: rgba(0,0,0,0.1);
    color: #333;
}
.walm-color-modal-close:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
.walm-color-modal-body {
    padding: 24px;
}
.walm-color-modal-loader {
    display: flex;
    justify-content: center;
    padding: 40px;
}
.walm-color-modal-detail {
    --modal-accent: #2271b1;
}
.walm-modal-visual {
    text-align: center;
    margin-bottom: 20px;
}
.walm-color-modal-detail .walm-modal-image {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
}
.walm-modal-swatch-large {
    width: 160px;
    height: 160px;
    border-radius: 12px;
    margin: 0 auto;
    border: 2px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.walm-modal-info {
    text-align: center;
    margin-bottom: 16px;
}
.walm-modal-color-name {
    font-size: 22px;
    margin: 0 0 8px;
    color: #333;
}
.walm-modal-color-code {
    font-size: 15px;
    color: #666;
    margin: 4px 0;
}
.walm-modal-color-hex code {
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 14px;
}
.walm-modal-color-uid,
.walm-modal-color-card,
.walm-modal-color-status {
    font-size: 13px;
    color: #666;
    margin: 4px 0;
}
.walm-modal-related-products,
.walm-modal-related-colors {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.walm-modal-related-products h4,
.walm-modal-related-colors h4 {
    font-size: 14px;
    margin: 0 0 10px;
    color: #333;
}
.walm-modal-related-products ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.walm-modal-related-products li {
    padding: 4px 0;
}
.walm-modal-related-products a {
    color: #2271b1;
    text-decoration: none;
    font-size: 13px;
}
.walm-modal-related-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.walm-modal-related-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.1s;
    min-width: 60px;
}
.walm-modal-related-item:hover {
    background: #f0f7ff;
}
.walm-modal-related-swatch {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 4px;
}
.walm-modal-related-code {
    font-size: 11px;
    color: #666;
}
.walm-color-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #eee;
    justify-content: center;
}
.walm-color-modal-footer .button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}
.walm-color-modal-footer .button:hover {
    background: #f0f0f0;
    border-color: #ccc;
}
.walm-color-modal-footer .button:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* === Favorites Page === */
.walm-favorites-container {
    max-width: 800px;
    margin: 20px auto;
}
.walm-favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.walm-favorites-header h3 {
    margin: 0;
    font-size: 18px;
}
.walm-favorites-count {
    font-size: 13px;
    color: #666;
}
.walm-favorites-grid {
    display: grid;
    gap: 10px;
}
.walm-favorite-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    transition: box-shadow 0.15s;
}
.walm-favorite-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.walm-fav-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}
.walm-fav-swatch {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}
.walm-fav-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.walm-fav-code {
    font-weight: 600;
    font-size: 14px;
}
.walm-fav-name {
    font-size: 13px;
    color: #666;
}
.walm-fav-hex {
    font-size: 12px;
    color: #999;
    font-family: 'Courier New', monospace;
}
.walm-fav-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    padding: 4px;
    font-size: 18px;
    transition: color 0.15s;
}
.walm-fav-remove:hover {
    color: #dc3232;
}
.walm-fav-remove:focus-visible {
    outline: 2px solid #dc3232;
    outline-offset: 2px;
}
.walm-favorites-empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* === Compare Bar === */
.walm-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border-top: 2px solid #2271b1;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
    padding: 12px 20px;
    transform: translateY(100%);
    transition: transform 0.3s;
}
.walm-compare-bar.open {
    transform: translateY(0);
}
.walm-compare-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}
.walm-compare-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.walm-compare-header h4 {
    margin: 0;
    font-size: 15px;
    white-space: nowrap;
}
.walm-compare-count {
    background: #2271b1;
    color: #fff;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}
.walm-compare-items {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    padding: 4px 0;
}
.walm-compare-item {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: 2px solid #e2e4e7;
    overflow: hidden;
}
.walm-compare-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.walm-compare-swatch {
    width: 100%;
    height: 100%;
}
.walm-compare-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc3232;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.walm-compare-item:hover .walm-compare-remove {
    opacity: 1;
}
.walm-compare-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.walm-compare-view {
    padding: 8px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.walm-compare-view:hover {
    background: #135e96;
}
.walm-compare-view:disabled {
    opacity: 0.5;
    cursor: default;
}
.walm-compare-view:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
.walm-compare-clear {
    padding: 8px 16px;
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.walm-compare-clear:hover {
    background: #f0f0f0;
}
.walm-compare-close {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 20px;
    padding: 4px;
}

/* === Compare Table === */
.walm-compare-table-wrapper {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.walm-compare-table-wrapper.open {
    opacity: 1;
    pointer-events: auto;
}
.walm-compare-table-inner {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 960px;
    width: 100%;
    max-height: 85vh;
    overflow: auto;
    padding: 24px;
}
.walm-compare-table-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 20px;
    padding: 4px;
}
.walm-compare-table {
    width: 100%;
    border-collapse: collapse;
}
.walm-compare-table th,
.walm-compare-table td {
    padding: 10px 14px;
    border: 1px solid #e2e4e7;
    text-align: center;
    font-size: 13px;
    vertical-align: middle;
}
.walm-compare-table th {
    background: #f8f9fa;
    font-weight: 600;
}
.walm-compare-table tr td:first-child {
    text-align: left;
    font-weight: 600;
    background: #f8f9fa;
}
.walm-compare-swatch-inline {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ddd;
    vertical-align: middle;
    margin-right: 4px;
}

/* === Recently Viewed === */
.walm-recently-viewed {
    margin: 20px 0;
}
.walm-recently-viewed h3 {
    font-size: 16px;
    margin: 0 0 12px;
    color: #333;
}
.walm-recent-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0;
}
.walm-recent-item {
    flex-shrink: 0;
    width: 72px;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.15s;
}
.walm-recent-item:hover {
    opacity: 0.8;
}
.walm-recent-image {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}
.walm-recent-swatch {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin: 0 auto 4px;
}
.walm-recent-info {
    font-size: 10px;
    line-height: 1.3;
}
.walm-recent-code {
    display: block;
    font-weight: 600;
    color: #333;
}
.walm-recent-name {
    display: block;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.walm-recent-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
    width: 100%;
}

/* === Breadcrumb === */
.walm-breadcrumb {
    margin-bottom: 16px;
    font-size: 13px;
    color: #666;
}
.walm-breadcrumb a {
    color: #2271b1;
    text-decoration: none;
}
.walm-breadcrumb a:hover {
    text-decoration: underline;
}
.walm-breadcrumb-sep {
    margin: 0 6px;
    color: #ccc;
}
.walm-breadcrumb-current {
    color: #333;
    font-weight: 600;
}

/* === Favorites Button (inline) === */
.walm-fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    padding: 4px;
    font-size: 18px;
    transition: color 0.15s;
}
.walm-fav-btn:hover,
.walm-fav-btn.active {
    color: #dc3232;
}
.walm-fav-btn:focus-visible {
    outline: 2px solid #dc3232;
    outline-offset: 2px;
}

/* === Print Styles === */
@media print {
    .walm-color-grid-toolbar,
    .walm-color-grid-footer,
    .walm-compare-bar,
    .walm-color-modal-overlay,
    .walm-live-search {
        display: none !important;
    }
    .walm-color-grid {
        break-inside: auto;
    }
    .walm-grid-item {
        break-inside: avoid;
        box-shadow: none !important;
        transform: none !important;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .walm-color-grid-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .walm-grid-search {
        flex: 1 1 auto;
    }
    .walm-grid-view-switcher {
        margin-left: 0;
        justify-content: center;
    }
    .walm-color-grid {
        --walm-grid-columns: 2 !important;
    }
    .walm-compare-bar-inner {
        flex-wrap: wrap;
    }
    .walm-compare-items {
        order: 3;
        width: 100%;
    }
    .walm-modal-visual {
        float: none;
        margin: 0 0 16px;
    }
}
@media (max-width: 480px) {
    .walm-color-grid {
        --walm-grid-columns: 1 !important;
    }
    .walm-list-item {
        flex-wrap: wrap;
    }
    .walm-color-modal-content {
        border-radius: 0;
        max-height: 100vh;
    }
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {
    .walm-grid-item,
    .walm-color-modal-content,
    .walm-compare-bar,
    .walm-spinner {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
