/**
 * Discovery layer CSS — Compare table + Wishlist grid
 * denti-b2b theme
 */

/* ─── COMPARE TABLE ─────────────────────────────── */
.denti-compare-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.denti-compare-page__title {
    font-family: 'Lora', 'Be Vietnam Pro', serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #000;
    margin-bottom: 2rem;
}

.denti-compare-page__empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #575757;
}

.denti-compare-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.denti-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.denti-compare-table th,
.denti-compare-table td {
    padding: 0.875rem 1rem;
    border: 1px solid #E6E6E6;
    text-align: left;
    vertical-align: top;
}

.denti-compare-table thead th {
    background: #F3F3F3;
    font-weight: 600;
    text-align: center;
}

.denti-compare-table__label-col {
    width: 180px;
    font-weight: 600;
    background: #FAFAFA;
    color: #212121;
}

.denti-compare-table__product-col a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.denti-compare-table__product-col img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 4px;
}

.denti-compare-table__name {
    font-weight: 600;
    color: #212121;
    text-align: center;
    line-height: 1.4;
}

.denti-compare-table__price {
    font-size: 0.8125rem;
    color: #f27131;
    font-weight: 600;
    margin-top: 0.25rem;
}

.denti-compare-table tbody tr:nth-child(even) {
    background: #FAFBFC;
}

/* ─── WISHLIST GRID ─────────────────────────────── */
.denti-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 1024px) {
    .denti-wishlist-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .denti-wishlist-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}

.denti-wishlist-item {
    position: relative;
    background: #fff;
    border: 1px solid #E6E6E6;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.denti-wishlist-item:hover {
    border-color: #415097;
}

.denti-wishlist-item__link {
    display: block;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
}

.denti-wishlist-item__link img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.denti-wishlist-item__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #212121;
    line-height: 1.4;
    margin: 0 0 0.25rem;
}

.denti-wishlist-item__price {
    font-size: 0.8125rem;
    color: #f27131;
    font-weight: 600;
}

.denti-wishlist-item__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border: 1px solid #E6E6E6;
    border-radius: 50%;
    cursor: pointer;
    color: #575757;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.denti-wishlist-item__remove:hover {
    color: #c0392b;
    border-color: #c0392b;
}

/* ─── WISHLIST BUTTON (on product cards) ────────── */
.denti-wishlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #E6E6E6;
    border-radius: 50%;
    cursor: pointer;
    color: #999;
    transition: color 0.2s ease, transform 0.2s ease;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.denti-wishlist-btn:hover,
.denti-wishlist-btn.is-active {
    color: #e74c3c;
    transform: scale(1.1);
}

.denti-wishlist-btn.is-active svg {
    fill: #e74c3c;
}

.denti-wishlist-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #575757;
}

/* ─── TOAST NOTIFICATION ────────────────────────── */
.denti-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #212121;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.denti-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── FLOATING COMPARE BAR ──────────────────────── */
.denti-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #415097;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    z-index: 9990;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
}

.denti-compare-bar.is-visible {
    transform: translateY(0);
}

.denti-compare-bar__link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
}

.denti-compare-bar__link strong {
    font-size: 1.125rem;
    margin: 0 0.25rem;
}

.denti-compare-bar__link:hover {
    text-decoration: underline;
}

.denti-compare-bar__clear {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.denti-compare-bar__clear:hover {
    background: rgba(255,255,255,0.35);
}

/* ─── COMPARE BUTTON ACTIVE STATE ───────────────── */
.denti-compare-add-btn.is-active {
    color: #415097;
    background: rgba(65, 80, 151, 0.1);
}

.denti-compare-add-btn.is-active svg {
    stroke: #415097;
}

/* ─── SEARCH PAGE ───────────────────────────────── */
.denti-search-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.denti-search-page__title {
    font-family: "Lora", "Be Vietnam Pro", serif;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    color: #000;
    margin-bottom: 1.5rem;
}

.denti-search-form {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.denti-search-form__input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #E6E6E6;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.denti-search-form__input:focus {
    border-color: #415097;
}

.denti-search-form__btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #415097;
    color: #fff;
    border: 2px solid #415097;
    border-radius: 0 4px 4px 0;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.denti-search-form__btn:hover {
    background: #354078;
}

/* Search filter tabs */
.denti-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E6E6E6;
}

.denti-search-filter {
    padding: 0.375rem 0.875rem;
    border: 1px solid #E6E6E6;
    border-radius: 20px;
    font-size: 0.8125rem;
    color: #575757;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.denti-search-filter:hover {
    border-color: #415097;
    color: #415097;
}

.denti-search-filter.is-active {
    background: #415097;
    color: #fff;
    border-color: #415097;
}

.denti-search-results__count {
    font-size: 0.875rem;
    color: #575757;
    margin-bottom: 1rem;
}

.denti-search-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #575757;
}

.denti-search-empty svg {
    color: #CCC;
    margin-bottom: 1rem;
}

.denti-search-empty__hint {
    font-size: 0.875rem;
    color: #999;
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    .denti-search-form { max-width: 100%; }
    .denti-search-filters { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
}

/* ─── LIVE SEARCH DROPDOWN ──────────────────────── */
.denti-live-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #E6E6E6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.denti-live-search-dropdown.is-visible { display: block; }

.denti-lsd__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    text-decoration: none;
    color: #333;
    transition: background 0.15s ease;
}

.denti-lsd__item:hover { background: #F5F5F5; }

.denti-lsd__thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.denti-lsd__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.denti-lsd__name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.denti-lsd__sku {
    font-size: 0.75rem;
    color: #999;
}

.denti-lsd__price {
    font-size: 0.8125rem;
    color: #F27131;
    font-weight: 600;
}

.denti-lsd__empty,
.denti-lsd__loading {
    padding: 1rem;
    text-align: center;
    color: #999;
    font-size: 0.875rem;
}

.denti-lsd__section-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #F0F0F0;
}

/* ─── FIX: mobile search filter pills horizontal scroll ──── */
@media (max-width: 768px) {
    .denti-search-filters {
        display: flex;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.375rem;
        padding-bottom: 0.75rem;
        scrollbar-width: none;
    }
    .denti-search-filters::-webkit-scrollbar { display: none; }
    .denti-search-filter { flex-shrink: 0; }
}

/* ─── Wishlist button styling ────────────────────── */
.denti-wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.denti-wishlist-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.denti-wishlist-btn svg {
    transition: all 0.2s ease;
}

.denti-wishlist-btn.is-active svg {
    fill: #F27131;
    stroke: #F27131;
}
