/* ========================================
   Recently Viewed Page - Specific Styles
   ======================================== */

.recently-viewed-page {
    background: #f8fafc;
    padding-bottom: 72px;
}

.recently-viewed-page .catalog-head {
    padding-bottom: 28px;
}

.recently-viewed-page .catalog-title,
.recently-viewed-page .catalog-breadcrumb,
.recently-viewed-page .catalog-head-count,
.recently-viewed-page .btn-clear-history {
    font-family: inherit;
}

.rv-history-tools {
    justify-content: flex-end;
}

.rv-history-count {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

/* Clear History Button */
.btn-clear-history {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}

.btn-clear-history:hover {
    color: #ef4444;
    background: #fff7f7;
    border-color: #fecaca;
    box-shadow: 0 12px 26px rgba(239, 68, 68, 0.10);
    transform: translateY(-1px);
}

.btn-clear-history:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-clear-history i {
    font-size: 13px;
    color: #ef4444;
}

/* Empty State */
.rv-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(100%, 560px);
    min-height: 300px;
    margin: 20px auto 72px;
    padding: 34px 28px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

.rv-empty-icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: #d8f5f0;
    color: #14b8a6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    box-shadow: none;
}

.rv-empty-icon i {
    color: currentColor;
    font-size: 20px;
}

.rv-empty-state h3 {
    max-width: 410px;
    font-size: 1.18rem;
    line-height: 1.28;
    font-weight: 800;
    letter-spacing: 0;
    color: #111827;
    margin: 0 0 10px;
}

.rv-empty-state p {
    font-size: 0.9rem;
    line-height: 1.55;
    font-weight: 500;
    color: #8a8f98;
    margin: 0 0 20px;
    max-width: 370px;
}

.rv-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 20px;
    font-size: 0.86rem;
    font-weight: 800;
    color: #111827;
    background: #84f546;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.rv-empty-btn:hover {
    background: #78ed3d;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(132, 245, 70, 0.26);
    color: #111827;
    text-decoration: none;
}

.rv-empty-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.rv-empty-btn i {
    font-size: 0.9rem;
}

/* Grid uses same styles as products-filter.css via .products-page */

/* Products Grid Override */
.recently-viewed-page .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1200px) {
    .recently-viewed-page .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .rv-history-tools {
        width: 100%;
        justify-content: flex-start;
    }

    .recently-viewed-page .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .rv-empty-state {
        min-height: 290px;
        margin: 28px auto 60px;
        padding: 30px 22px;
    }

    .rv-empty-icon {
        width: 46px;
        height: 46px;
    }

    .rv-empty-state h3 {
        font-size: 1.08rem;
    }
}

@media (max-width: 480px) {
    .rv-empty-state {
        min-height: 280px;
        margin: 20px auto 48px;
        padding: 28px 18px;
        border-radius: 16px;
    }

    .rv-empty-icon {
        width: 46px;
        height: 46px;
    }

    .rv-empty-state p {
        font-size: 0.86rem;
    }

    .rv-empty-btn {
        width: 100%;
    }
}

/* ========================================
   Dark Mode
   ======================================== */
[data-theme="dark"] .btn-clear-history {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
    color: #e5e7eb;
}

[data-theme="dark"] .btn-clear-history:hover {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
    box-shadow: none;
}

[data-theme="dark"] .rv-empty-state h3 {
    color: #f3f4f6;
}

[data-theme="dark"] .rv-empty-state {
    background: #101318;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

[data-theme="dark"] .rv-empty-state p {
    color: #9ca3af;
}

[data-theme="dark"] .rv-empty-icon {
    background: rgba(20, 184, 166, 0.18);
    color: #14b8a6;
    box-shadow: none;
}

[data-theme="dark"] .rv-empty-btn {
    background: #84f546;
    color: #111827;
}

[data-theme="dark"] .rv-empty-btn:hover {
    background: #78ed3d;
    color: #111827;
}
